Skip to content

Classifier mode: own providers, confidence lines, debug inspector - #4

Merged
tshmieldev merged 3 commits into
mainfrom
tshmieldev/classifier
Sep 19, 2026
Merged

tshmieldev merged 3 commits into
mainfrom
tshmieldev/classifier

Conversation

@tshmieldev

Copy link
Copy Markdown
Owner

A decision model now judges posts by default, in place of a chat model. It is faster, nearly free, and returns a probability, which the rest of this PR is built around.

What changes for a reader

  • Classifier by default. One request per post, a score back. Reached through OpenRouter, Vercel AI Gateway or TypeSafe AI, each with its own key. A chat model still works; both connections live under General › AI, each with its own test button, and X › Advanced › Mode picks which one X uses.
  • Confidence lines. "Hide from" and a close-call margin, shown on one bar. Scores are cached, so moving either line costs nothing.
  • Images only when they matter. A vision model describes images, and only for posts whose text-only score falls in a range picked on the same bar. Default image model: google/gemma-4-26b-a4b-it.
  • Banners read "Hidden · 93% sure" or "only 62% sure". Never a model name.
  • Debug mode. A chip on every judged post opens an inspector: request, response, timings per step, thumbnails and descriptions. Kept in the tab's memory only.
  • Settings restructure. X gets Appearance and Advanced tabs for what is X's own; "Misc" is gone. Sections are titled sheets.
  • Concurrency. Up to 64 classifier posts at once; chat requests up to 12.

Upgrade safety

  • The new hosts (ai-gateway.vercel.sh, api.typesafe.ai) are requested on save, not declared in the manifest, so the update does not disable existing installs pending re-approval.
  • A reader who set up a chat model outside OpenRouter before this release keeps that model deciding.

Not verified live

The TypeSafe and Vercel request shapes come from their docs and an open-source client; neither was run against a real key. OpenRouter was.

117 tests pass; bun run check is clean.

… debug inspector

A decision model now judges posts by default: one request per post, a
probability back, no written reason. It is reached through OpenRouter,
Vercel AI Gateway or TypeSafe AI, each under a key of its own, apart from
the chat model's. A chat model still works, and either connection can be
set up and tested without the other.

- The score travels with the verdict and is cached. The hide line and the
  close-call margin are read against it at display time, so moving either
  re-buys nothing.
- Images are described in words by a vision model, and only for posts
  whose text-only score lands in a range the reader picks. A range
  covering every score skips the text-only pass.
- Banners say how sure the hide is ("93% sure", "only 62% sure"), never a
  model name or a bare figure.
- Debug mode puts a chip on every judged post that opens an inspector:
  request, response, timings per step, image thumbnails and descriptions.
  Traces live in the tab's memory only and are never cached.
- Concurrency: a worker-wide gate for the classifier, up to 64 posts at
  once; the chat model's request cap goes to 12.
- Settings: X gets Appearance and Advanced tabs for what is X's own
  (hidden-post style, mode, speed or spending, confidence, images,
  lookahead). General keeps AI connections, routing, debug and
  maintenance. Sections are drawn as titled sheets.
- New hosts are asked for on save rather than declared, so an update
  does not make existing installs re-approve the extension. A reader who
  set up a chat model outside OpenRouter keeps it deciding after updating.
Copilot AI lite review requested due to automatic review settings September 19, 2026 13:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5b7f6acb-58c4-43d3-98fd-6a5f89cb81fa

📥 Commits

Reviewing files that changed from the base of the PR and between f70ecb9 and 33f643c.

📒 Files selected for processing (30)
  • CONTRIBUTING.md
  • README.md
  • privacy-policy.md
  • src/background/classifier.ts
  • src/background/evaluator.ts
  • src/background/index.ts
  • src/background/providers.ts
  • src/background/storage.ts
  • src/common/messages.ts
  • src/common/post.ts
  • src/common/settings.ts
  • src/popup/App.tsx
  • src/popup/GeneralPanel.tsx
  • src/popup/XPanel.tsx
  • src/popup/YouTubePanel.tsx
  • src/popup/Zones.tsx
  • src/popup/style.css
  • src/x/controller.ts
  • src/x/icons.tsx
  • src/x/inspector.tsx
  • src/x/rules.ts
  • src/x/style.css
  • src/x/view.tsx
  • tests/classifier.test.ts
  • tests/comments.test.ts
  • tests/evaluator.test.ts
  • tests/inspector.test.tsx
  • tests/post-menu.test.ts
  • tests/providers.test.ts
  • tests/zones.test.tsx
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

X serves the reader's bookmarks at /i/history as well as /i/bookmarks. Both are pages the reader filled themselves, so nothing on them is judged or hidden.
@tshmieldev
tshmieldev merged commit 8c48d4c into main Sep 19, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants