Skip to content

recall: 7 of 21 curated query/gold pairs retrieve nothing, even with the gold alone in the store (needShared=2) #405

Open

Description

@abogartz

Summary

Seven of the 21 curated transport queries in bench/fixtures/recall-dataset.ts do not retrieve their own gold when that gold is the only row in the store. Not "lose to competition" — the selector returns nothing at all.

This was found by a control added to bench/runners/availability-policy-compare.ts in #403: the bench had a negative control (a budget too small can score nothing) and nothing proving a hit could ever be found. Adding the positive direction showed the recall denominator was inflated.

Measured on 2932672, macOS, selectRelevant(q, 30, [goldOnly], undefined, undefined, { budget: 100_000, guidedCap: 3 }), gold carrying its own keywordsFor set.

The pairs

gold query gold text gold keywords
m01 starting the local verification loop for the backend run the widget-api test suite with make test-api; it boots postgres in docker compose first "api tests", "how to run the suite", "test command", "docker compose up", "integration test setup"
m02 why do my throttling rules never take effect locally widget-api rate limiter reads from Redis DB 3, not DB 0 like the rest of the stack "throttling", "rate limit store", "redis database number", …
m04 kubernetes keeps restarting pods that are actually fine the /healthz endpoint lags when the connection pool is exhausted; it is not a reliable readiness signal "health check", "readiness probe", "liveness endpoint", …
m07 users report they can still act after signing out jwt middleware caches revoked tokens for 60s via the jti list; logging out does not kill active sessions immediately "logging out", "token revocation", "still signed in", …
m08 spin up dummy accounts for manual testing seeds: bun run seed creates 42 fixture users; always run it against a throwaway database "seed data", "fixtures", "fake users", "test data setup"
m12 why do my slow query report groups look cut off postgres 16 pg_stat_statements truncates query names at 1kb; normalize before aggregating "query statistics", "statement truncation", "normalise query text", …
m14 production froze during a schema performance fix add index must run CONCURRENTLY on widget_events or writes block for minutes "create index", "indexing without locking", "writes blocked", …

The mechanism, named

src/recall/score.ts:

const LONG_QUERY_TOKENS = 3;
const needShared = query.size >= LONG_QUERY_TOKENS ? 2 : 1;
...
.filter((s) => s.shared >= needShared)

Any query with three or more non-stopword tokens must share two distinct tokens with the row's haystack (scope + type + content + keywords), or it is dropped before scoring. Measured token overlap for three of the seven:

m02: q_tokens=7 shared=[throttling]
m08: q_tokens=6 shared=[]
m14: q_tokens=6 shared=[]

m02 is the case that argues the rule is too strict rather than merely lexical: the keyword list literally contains throttling, the query literally contains throttling, and the row is still discarded because a second token does not also collide. One exact keyword hit is the signal the keyword list exists to provide.

The shape of the remaining gap

The other six are paraphrases across a vocabulary the scorer does not bridge. spin up dummy accounts and the keyword fake users are the same request with no shared token. kubernetes keeps restarting pods and readiness probe are the same failure described from opposite ends — the memory states the mechanism, the user states the symptom.

What it costs

  • The availability bench reports transport recall out of a ceiling of 14, not 21. Its report now states that ceiling explicitly (bench/availability-results.md), because "9/21" reads as 43% recall and is really 9 of the 9 that are retrievable at all.
  • More importantly: these are the curated pairs, written to match. A user's real phrasing is further from the stored wording than a curated paraphrase, so 7/21 is a lower bound on how often a real question fails to reach a memory that exists.
  • The store cannot help. A row that is never selected is invisible to every downstream feature — injection, memory_recall, consolidation.

Where to look

scoreMemories in src/recall/ and whatever threshold gates selected. Two candidate directions, with the cost of each stated:

  1. Relax needShared when the shared token is an exact keyword hit rather than an incidental content word — the keyword list is authored precisely to be the matching surface, and today one exact keyword hit loses to a two-token accidental collision. Cheap, local to scoreMemories, and testable against these seven pairs plus the existing recall suite. Risk: it admits more weak matches, so it needs a precision check on the 180-row background, not just a recall check.
  2. A synonym or embedding layer. This is the only thing that closes the six with zero shared tokens. It costs a model call or a local embedding index on every read, which is a different cost profile from anything in this repo today, and it would need its own bench with the same must-go-red controls before it is trusted.

Neither is proposed here as a fix. The finding is the number, the pairs and the constant; the ceiling is now reported wherever the bench reports recall, so the gap cannot be quietly averaged over.

Reproduction

bun bench/runners/availability-policy-compare.ts

reports the ceiling line and names the unretrievable golds in a control. To drive one pair directly, build the single-row store as the control does: gold only, budget: 100_000, and read selected.

Activity

  1. abogartz commented on Nov 13, 2026

    @abogartz
    OwnerAuthor

    Correction: the blind count depends on whether the row carries keywords, and the shipped prompt asks for them

    The numbers in the body above were measured with each gold carrying the dataset's keywordsFor set. A review round on #403 then measured the same ceiling against the rows the availability bench actually retrieves, and the count moves.

    gold representation blind pairs (of 21 curated transport queries)
    with the authored kw set 7 — m01, m02, m04, m07, m08, m12, m14
    the same rows with keywords stripped 12 — m01, m02, m04, m05, m07, m08, m10, m11, m12, m14

    Five pairs — m05, m07, m10 and both m11 queries — are retrievable only because of the keyword list. The mechanism in this issue is unchanged and is still the cause: LONG_QUERY_TOKENS = 3 forces needShared = 2, so a query sharing one token is discarded before scoring. What changes is the size of the hole, and which row is the realistic one.

    Which row is realistic is the question worth answering

    src/capture/prompt.ts asks the model for "3-5 search keywords for how a DIFFERENT session would ask for this — synonyms and alternate names, other verb forms, the literal command or file name", and adds "Omit (or []) when the content already uses those words." candidates.ts cleans the list and runtime.ts persists it. So capture is asked to produce exactly the field that closes five of these pairs, and is simultaneously told it may skip it.

    This bench scripts the reply, so it cannot say what the real model does. That is a measurement worth making outside this issue, and it decides the priority of everything below:

    • If the shipped model usually supplies keywords, the 7/21 figure is the one users hit and (1) below is the cheap partial fix.
    • If it often omits them, 12/21 is the real figure, and the keyword field is being written without the scorer being able to use it — which is a different bug from the one this issue describes.

    The three directions, restated

    1. Relax needShared when the shared token is an exact keyword hit. Cheap, local to scoreMemories. m02 is the case that argues it: the query shares throttling, an exact authored keyword, and the row is discarded for want of a second token. Costs precision, so it needs a check against the 180-row background, not just a recall check.
    2. A synonym or embedding layer. Still the only thing that closes the zero-overlap pairs (spin up dummy accounts vs fake users; kubernetes keeps restarting pods vs readiness probe). Costs a model call or a local embedding index on every read — a cost profile nothing in this repo has today — and would need its own bench with must-go-red controls before it is trusted.
    3. Make the keyword field mean something, or stop asking for it. If one exact keyword hit is discarded anyway, then either the scorer should treat an authored keyword as the strong signal it was authored to be, or the prompt is spending output tokens on a field the reader ignores. Both readings are actionable; neither is decided here.

    What is unchanged

    • The seven pairs, their texts and their keyword lists, as listed in the body.
    • src/recall/score.ts: const needShared = query.size >= LONG_QUERY_TOKENS ? 2 : 1; and the filter on s.shared >= needShared.
    • The token measurements (m02 shares exactly one token and is discarded; m08 and m14 share none).
    • The conclusion that a row which is never selected is invisible to injection, memory_recall and consolidation.

    The availability bench now prints its ceiling beside every recall figure, states which representation it was measured on, and prints the keyword-stripped counterfactual next to it, so this gap cannot be quietly averaged over again.

  2. added
    bug
    retrieval
    severity:high
    on Nov 14, 2026
  3. WhollyMindless commented on Nov 19, 2026

    @WhollyMindless
    Contributor

    Claiming the exact authored keyword case (m02). I will check tight-budget delivery and distractor admissions and post the measured scope. The zero-overlap cases remain open.

  4. WhollyMindless commented on Nov 19, 2026

    @WhollyMindless
    Contributor

    Scope update for #441 after review: the unique authored keyword exception now applies only when someone calls memory_recall. Automatic injection retains its two-concept rule because a single term admitted wrong-sense memories on CPU throttling and stadium lighting prompts. On the 21-query transport fixture with 180 distractors, explicit recall@3 recovered 14 golds vs 13 on main, including the Redis throttling query. This leaves automatic retrieval and the broader paraphrase gap open. The PR links the commands, fixtures and limits of the measurement.

  5. ocsi-fixer commented on Nov 21, 2026

    @ocsi-fixer

    Real-store control: the 7-of-21 figure does not generalize

    Measured on a copy of the maintainer's own store, 2026-11-21. No row content was recorded anywhere: every measurement is an aggregate or a sha256[:10]. The store was copied to a temp directory and nothing pointed at the original.

    Store shape. 2121 rows, 1685 injectable and visible, 298 scopes, median 35 content tokens per row, 8 rows below MIN_CONTENT.

    Arm 1 — the positive control #403 said the bench lacked. One row alone in an empty store, queried with the first 6 content tokens of that same row. If a miss happens here it cannot be competition. Sampled 150 rows; 25 were correctly hidden by repo-scoped visibility and excluded from the denominator rather than counted as misses.

    found in top 5 116 / 125 = 92.8%
    not found 9

    Arm 2 — the same rows with all 1685 competing.

    in top 5 84.0%
    rank 1 72.0%
    empty windows 0

    Reading. The scorer finds real rows: 92.8% when the row is the only thing in the store and the query is built from the row's own words. Competition for a window of 5 costs 8.8 points. Neither number resembles 7-of-21 = 33% unretrievable.

    That points at the dataset rather than the scorer. The curated pairs are written so the query shares little surface with the gold; real rows queried in their own vocabulary are findable. The wall is paraphrase distance, which is what #420 is about, not a selector defect.

    Suggested re-scope, for the ticket owner to decide: keep #405 for the seven pairs as a dataset task — either re-author those queries so they share surface with their gold, or move them to #420 as the semantic-search arm — and record here that the shipped selector was measured at 92.8% availability on real rows.

    Two measurement hazards found on the way, both worth keeping in mind for anyone replaying this.

    1. Reconstructing queries from hits.logfmt needs a logfmt parser that handles quoted fields. A whitespace split truncates every multi-word terms value and the whole replay silently returns No matching memories for all of it — a clean-looking zero, not an error.
    2. No memories found and No matching memories are different failures. The first means the row was filtered before scoring, usually correct repo isolation. Counting those as retrieval misses inflated an early figure here from 7.2% to 23%.
  6. added
    tier:standard
    tier:full
    and removed
    tier:standard
    on Nov 23, 2026
  7. added
    severity:medium
    tier:standard
    and removed
    severity:high
    tier:full
    on Nov 25, 2026
  8. ocsi-architect commented on Nov 25, 2026

    @ocsi-architect

    Re-scoped per the real-store control measured on this ticket (see the maintainer-store comment above): the shipped selector retrieves real rows at 92.8% alone / 84.0% under competition, so the severity:high claim of a selector defect is falsified. Remaining substance is the seven curated pairs — a dataset authoring task (re-author toward shared surface) or fold them into #420's semantic-search arm; medium/standard matches that work.

  9. ocsi-triager commented on Dec 1, 2026

    @ocsi-triager

    Triager

    Triage #405 at 6e33179 — not actionable as one fixer change

    Measured, not inherited.

    The claim reproduces, but one of the seven is already fixed. Direct drive at this revision (gold alone in the store carrying its authored kw, selectRelevant(q, 30, [gold], undefined, undefined, {budget: 100_000, guidedCap: 3}), rows built in memory): 7 blind of 21, the exact set m01, m02, m04, m07, m08, m12, m14; 12/21 with keywords stripped — both figures match this thread. But m02 is now admitted on the explicit-recall path: #441 merged 2026-11-19 and its exact-alias exception (src/recall/gate.ts exactAliasMatches, applied in src/tools/recall.ts:57-69) returns the Redis-throttling row today — measured toolWouldReturn=true. Auto-injection still drops it (src/recall/score.ts:145 needShared = concepts >= 3 ? 2 : 1, filter at :172), which is the deliberate half of #441, not an oversight.

    The remaining six group into two causes, neither a defect a fixer closes. Whole-word concepts at this revision:

    The named reproduction is broken on main and no ticket owns it. bun bench/runners/availability-policy-compare.ts exits 1 at 6e33179 with 7 failing controls, headlined by conservation: only 4 of 16 scripted capture candidates reach the store. The shipped write gate (src/gate/gate.ts, enforced as the prompt states at src/capture/prompt.ts:86) rejects learning rows that do not open When <symptom>:, and the bench's scripted candidates predate it. Bisected on a throwaway /tmp copy (destroyed): green at 2932672 (exit 0, 16/16 stored), first bad commit 8781894 "feat(gate): enforce symptom-first learning/blocker rows (#423)" — so the harness has been red on main since 2026-11-17, and no workflow in .github/workflows runs this bench, so nothing noticed. Worse than plain red: the red run still prints PASS — the hit metric can score at all: 7/21 transport … unretrievable golds: m01, m02?, m04?, … where the ? entries are rows that never reached the store — write-gate refusals riding a PASS line beside genuine scorer blindness. The scorer-level 7/21 is real (measured here without the capture path); the committed report conflates the two losses.

    What remains, and who owes it.

    1. New bug ticket: repair the availability harness on main — re-author the scripted capture candidates to pass the symptom-first write gate, and make the ceiling control count only queries whose gold is actually in the store, so ? entries drop out of the denominator instead of riding a PASS. On the strength bar this family demands: conservation is not a pin that pins nothing — it died by itself at 8781894, which is how this was found. The ceiling-control hardening carries its mutation proof by construction: delete the symptom opener from one scripted learning candidate — with the guard, conservation goes red and the ceiling falls by that query; without it (today) the same edit silently shifts the reported ceiling while the control line still reads PASS. Filing, labelling, and where it sits against epic EPIC: Plugin effectiveness benchmark — results banked, hold-out validity + latency + publishing left #315 is the repo owner's call.
    2. The paraphrase pairs (all six remaining, or the four zero-overlap ones) belong to Recall across fully rephrased queries needs semantic (embedding) search #420's semantic arm; the owner sets its priority.
    3. Injection-side needShared stays as shipped unless the owner reopens the fix(recall): admit unique exact keywords in explicit memory lookup #441 precision decision.

    Handing nothing to a fixer or architect from this ticket: the scorer-side defect it names is either already fixed on its realistic arm (m02) or is a #420 design decision, and the only thing still editable here — the fixture — is unverifiable through its own red harness until item 1 lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugretrievalseverity:mediumtier:standard

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions