Skip to content

Gate

The second pipeline stage asks of every new item: is it worth my attention? Items it filters out leave the stream, but they’re never deleted (SI-539). Code: pipeline/stages/gate.ts, pipeline/stages/triage.ts and services/gate.ts. In the app: Settings → Gate (/settings/gate) and Filtered in the stream (/?show=filtered).

The approach comes from the SI-513 spike, which measured jev against hand-labelled items.

How an item is judged

The gate is a user stage: one verdict per user and item, because it depends on the user’s interests and threshold. It runs after extract and reads the text extract stored: the article, the transcript, or the feed’s text. In this order:

  1. Always show. When the user marked the item’s source Always show, the item passes, whatever jev says. For favorites such as a podcast whose feed text is only a teaser, which jev can’t judge. jev is still asked when the item has at least 50 characters of text, only for its scores (SI-541, scores.md).
  2. Too little text. Less than 50 characters of text: a code rule, no call. jev and GPT-6 Luna both let these through, though they’re mostly empty or teaser posts. An article is filtered out. A video passes: it has the video itself.
  3. jev. One triage call to jev through OpenRouter with the title, the source, the date, the first 2,400 characters of the text and the user’s interests. It asks four questions at once: worth (yes or no, as a probability), and Hype, Facts and Signal (0–3). After them come the user’s own checks, if they have any (SI-567, checks.md). The item passes when worth reaches the user’s threshold.
  4. The fallback. When jev fails (its endpoint is an alpha, with one provider), GPT-6 Luna answers the same questions, with reasoning off. Its worth is a plain yes or no, so it counts as 100 % or 0 %. The step’s note says so.

If both fail, the step fails and the item stays in the stream. Run again in Executions tries once more.

The questions are the spike’s Hotaru prompts, word for word (spikes/jev-bench/commands/hotaru/triage); a test checks that they still match. The reference prompts from jev’s repo are written for someone else and drop most good items.

What is stored

Per user and item, on user_items (migration 0012_item_gate):

Column
gate passed or filtered. Null: not judged yet (the item is shown)
gate_reason worth (jev or the fallback against the threshold), empty (the rule for too little text), always_show
worth jev’s probability, 0–1. Null without a call. Stored for Always show items too, but never compared with the threshold
hype, facts, signal jev’s scores, 0–1 (the level divided by 3), shown on the cards and used to sort and filter the stream (scores.md)
gate_model The model that answered, as resolved: jev-latest moves, so it’s logged with every answer
gated_at When

A re-run overwrites them. The call is a once() memo, so a crash in the middle of the stage doesn’t pay twice (pipeline.md).

The stream and the Filtered view

  • The stream (Unread and All), its counts, the “new items” pill and Mark all as read leave filtered items out. An item shows until the gate has judged it, usually a few seconds after it arrives.
  • Filtered (/?show=filtered, the “3 filtered out” link beside the stream’s count) lists the filtered items, newest first, each with the reason: “Filtered out: worth 21 %, below your threshold of 35 %”, or “too little text to judge”. Like Starred, it has no tag filter.
  • Search finds filtered items like any other, marked “Filtered out”.
  • Starred shows every starred item, filtered or not.
  • Always show applies at once, also to items filtered before: the stream checks the flag when it reads, not only the gate. The switch is in the source’s editor on Sources. Turning it off applies to new items: the items that arrived while it was on were never judged and stay in the stream. Run again judges one.

Settings

Settings → Gate, or GET / PUT /api/v1/gate (stored in user_settings.preferences.gate):

  • Interests, one per line, up to 50. Saving sorts them alphabetically, and the page counts them as you type. Empty: the names of the user’s tags, which are usually their topics, as the spike used Inoreader’s folders. They tell jev what “off topic” means and steer Signal. New interests apply to items judged from then on; Run again judges an item anew.
  • Threshold, 5–95 %, default 35 %. A new threshold applies at once to every item jev already judged: the stored worth is compared again, with no call. The rule for too little text doesn’t depend on it.

The stage can be turned off in Settings → Executions like any other. Items are then never filtered.

Costs

The gate is the first paid stage: about $0.055 per 1,000 items (1,300 tokens in, none out, at $0.042 per million), so $0.60–0.85 a month at 350–500 items a day. The same call scores Signal, Facts and Hype, so the scores cost nothing more. The user’s own checks add only their questions’ tokens (checks.md). Items of “always show” sources are scored too, at the same price. Items without text cost nothing. Over the monthly budget, the stage is skipped and items stay in the stream (costs.md). It needs OPENROUTER_API_KEY (deployment.md); without it, the stage fails for every item that needs a call, and those items stay in the stream.

Checking for false negatives

On the spike’s sample. The stored jev answers for the 100 real items of SI-513, run through the gate’s own decision code and compared with the hand labels (92 with a sure label: 78 good, 14 filler):

Threshold Good items dropped Filler caught
25 % 1 of 78 (1.3 %) 9 of 14
35 % (default) 3 of 78 (3.8 %) 9 of 14
40 % 7 of 78 (9.0 %) 10 of 14
50 % 8 of 78 (10.3 %) 12 of 14

At 35 %, jev drops a short math post and a sensational crash explainer, and the rule for too little text drops a 46-character post that was worth reading. The rule catches filler jev lets through, so together they catch 9 of 14 filler items, where jev alone caught 8. YouTube items in the sample had only their description; in the app most have a transcript.

In the app. Labels are Claude’s, not mine, so the real check is the Filtered view: look through it every few days for the first weeks. A good item there means: mark its source Always show (a favorite), add the topic to the interests, or lower the threshold.

API

GET /api/v1/gate Interests, the interests in use (readerInterests), threshold, default threshold, and how many items are filtered out
PUT /api/v1/gate { "interests": "…", "threshold": 0.35 }, either or both. Needs a session or a write token
GET /api/v1/stream?filtered=true The Filtered view, with filteredCount
PATCH /api/v1/subscriptions/:id { "alwaysShow": true }

Stream items carry gate, gateReason, worth and alwaysShow, and the scores signal, facts and hype (scores.md). The SDK has gateSettings(), setGateSettings() and stream({ filtered: true }).

Taste examples

jev’s taste_examples holds up to eight recent items you liked or disliked, from your votes and labels (SI-546, feedback.md). The fallback gets them as lines in its instructions.

Not yet

  • Always show for a tag. The issue allows it; for now it’s per source.
  • A topic per item (matched_topic). The spike found it useful but didn’t test it in the combined call.