Repository navigation
fix(recall): default the memory_recall window to 5 rows, not 20 (#409) - #416
Conversation
|
Composition note. Measured alone, and this one changes the default rather than hiding behind a flag. It is also the reason #415 exists: a shorter window makes near-duplicate crowding more expensive, because copies take slots that distinct facts would otherwise use. r1 and r3 unchanged, precision 4.1% → 13.1%, 74% of returned characters removed. Combined numbers against #415 and #418 are not yet measured. |
|
Repushed ( Two changes: The "precision 4.1% → 13.1%" framing was denominator arithmetic hiding that gold loss, and the PR now says so. Also disclosed: at limit 5, ranks 6–20 stop feeding the use ledger and frontier-tap counters (a slow feedback into ranking), and this PR conflicts with #415 on the same line — if both ship they must be re-measured together. This PR is now a disclosed trade (context vs recall in ~6.5% of answered queries), not a harm-free win. Ship-as-trade or close — maintainer's call. |
A live audit joined 1,090 recall events to their session transcripts: a returned row at rank 1 shows up in a later tool call at 3.4x the rate of a random store row, ranks 11-20 at 1.16x, which is noise against a 0.129 null. At 17.7 rows per call, 62% of the window was context nobody read. The tighten sweep (limit x admission floor, stores 52/200/400) shows the cut is free at the top: r1 and r3 identical to limit 20, precision 4.1% -> 13.1%, 74% of returned characters gone, and every dropped gold row sitting at ranks 6-20. Limit 3 is rejected because it starts evicting ranks 4-5, which still carry signal. An explicit limit still overrides and the header still reports the full match count.
- limit is coerced: non-positive, NaN or fractional values fall back to the default. An unclamped negative limit made slice(0, -n) return MORE rows than the default, not fewer. - the PR framing is corrected with adjudicated per-query numbers: at limit 5 the window holds an answer for 216 of 404 queries versus 231 at limit 20 (15 lost, 0 gained, p<0.001; held-out 131 -> 125, p=0.031), for 69% fewer rows and 74% fewer non-answering rows. The earlier 'precision rises 4.1% -> 13.1%' headline was denominator arithmetic that hid the gold loss. - disclosures added: rows at ranks 6-20 stop feeding the use ledger and frontier-tap counters at limit 5, and #415 edits the same line, so the two lanes must be re-measured together if both ship.
72a0326 to
2961a7e
Compare
|
🎉 This PR is included in version 0.26.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What
Changes the
memory_recalldefault window from 20 rows to 5. No flag: this changes behaviour for every user on upgrade. An explicitlimitstill overrides, and the header still reports the full match count.Why 5
The live audit (#409 §12) joined 1,090 recall events to their session transcripts: a rank-1 row goes on to be referenced at 3.4x the rate of a random store row, ranks 2–3 at 2.4x, ranks 4–10 at 1.4x, ranks 11–20 at 1.16x — statistically noise. The tool returned 17.7 rows per call.
The honest cost — per query, not as a precision ratio
The first version of this body led with "precision rises 4.1% → 13.1%". That was denominator arithmetic: precision rises mostly because fewer rows are returned. Re-measured through the shipped handler over the 404 case-bank queries with adjudicated full-text labels (
poc-409/casebank/limit-windows.ts), the question is whether the window still holds an answer:This is a disclosed trade, not a free win: 69% less context per call, paid for with the answer in ~6.5% of the queries that had one (they reach it only at ranks 6–20). The use-audit says those ranks are referenced at noise level; the label audit says a few queries genuinely need them. Both are true at different sample sizes.
Two disclosures the first version missed:
noteHitsand the frontier-tap counters only see returned rows. At limit 5, rows at ranks 6–20 stop accumulating use signals, which feeds back into the use-boost ranking over time. Not measured here; flagged as a known feedback path.src/tools/recall.ts; whichever merges second needs a rebase. If both ship, the window is deduped and narrowed — the per-lane numbers above do not compose; they must be re-measured together before both are on.Fixes in this push
limitis clamped: non-positive,NaNor fractional values coerce to the default (slice(0, -n)silently returned more rows than the default — pinned by a test).Tests
5 tests: default 5, header count, explicit override, negative/zero clamp, filter-only path keeps newest.
bun run gate(tsc + biome + unit + e2e) green.Decision this PR now asks for
Ship-as-disclosed-trade (context is the binding constraint) or close (recall is). The lane is no longer claimable as harm-free.