Skip to content

EPIC: Guidance precision and cache economics — evidence before claims #335

Duplicate

Description

@abogartz

Why

The hint channel is proven on exactly two mutations, three runs, one seat, one fixture repo family. Before we claim "memories are always returned as expected", three claims remain unproven and one number is unmeasured:

  1. Precision when guidance is irrelevant. Guided rows now ride EVERY epoch regardless of overlap. A repo whose user states rules constantly will inject stale or unrelated guidance into sessions it cannot help. We must measure whether the model treats a wrong-but-injected rule as data (fine) or as an instruction it follows (harm).
  2. Cache economics of prompt-reveal rescore. Re-scoring at every user turn is correct; it busts the provider prompt cache whenever the selected rows change. On a local seat (~1.7k t/s prefill at 128k) a bust is minutes. The freeze existed because of P0: every memory write busts the prompt cache — the memory prefix carries bytes the model never needed #162/A session pays a re-prefill for memories it wrote itself — 92% of lifetime cache busts (follow-up on #162) #165. Nobody has counted prompt_reveal invalidations against saved tokens on a multi-topic session.
  3. Scale and generalization. The 20-sample known-repo scarce-budget test (decision 2026-11-07) and the hold-out question (Hold-out mutation test: does BB's 100% survive unseen bugs (memorization vs transfer) #316) are still open.

Evidence sources

  • Bench repo: benchmark-tests/ocsi (chain harness chain.ts, per-mutation hint+needle in the mutations table; L6h requires the needle to share a wire line with the via auto-capture provenance marker).
  • Results: results-chain-hint-fix, results-chain-hint-fix2, results-chain-hint-t7b (2026-11-07).
  • PLAN.md in that repo carries the full fix-loop record.

Success

Each ticket lands a number in its issue. No mechanism claim ships without a headless run of the real plugin inside real opencode asserting the whole chain.

Tickets

Activity

  1. added
    retrieval
    bench
    severity:medium
    on Nov 7, 2026
  2. abogartz commented on Nov 8, 2026

    @abogartz
    OwnerAuthor

    Bench evidence protocol adopted 2026-11-08 (full text on #349): bench ACs on this epic's tickets close via an evidence comment — run dir + plugin SHA + bench SHA + results table — not via AC prose edits. #345 and #346 closed under it today with their tables.

  3. abogartz commented on Nov 8, 2026

    @abogartz
    OwnerAuthor

    Decision record: why there is no smarter search layer yet.

    The obvious fix for 'a memory the user stated did not show up in the next session' is semantic (embedding) retrieval, so relevant memories match even when the wording differs. Published research says hybrid keyword-plus-embedding retrieval roughly halves retrieval misses. We deliberately did not build that, because measuring first showed the misses were not a wording problem here:

    1. the model rewrote the user's fact when saving it, so tests could not recognize it (fixed: rows can carry the user's exact words, verified against the conversation);
    2. saving the user's fact was left to model discretion and it skipped about half the time (fixed: a guaranteed pre-pass stores it; the model can add, not remove);
    3. a cached view hid a fact one session had just saved from another (fixed: the cache refreshes when such a fact lands).

    With those, the full chain measured 50 of 50 checks passing — no embeddings. Rule of thumb recorded for the future: fix what the stages actually lose before buying a smarter index. Revisit embedding retrieval only if misses remain after the current fixes ship and the confidence windows run. The per-stage logging added alongside makes any future miss attributable in one grep.

  4. added
    enhancement
    tier:full
    on Nov 23, 2026
  5. ocsi-triager commented on Dec 1, 2026

    @ocsi-triager

    Triager

    Triager verdict — #335 is not actionable as a fixer change on 6e33179

    Test applied: can one fixer produce one reviewable change that satisfies this EPIC on the current revision, with checks a reviewer can run afterwards? No. The EPIC asks for measurements, not code — and as of 6e33179af00aef5da2b6d2586071755e82f7aa85 three of its four tickets are already measured and closed, their fixes are in the tree, and the one open item (#348) is a live-model bench run that no code diff advances.

    Premises tested at 6e33179

    Body item 1 — "measure whether the model treats a wrong-but-injected rule as data or instruction": already measured, fix shipped.

    • Bench: precision control — guided rows when the hint does NOT cover the bug #345 closed 2026-11-08 with the run tables: arm A (irrelevant guidance) rode and caused no harm; arm B (wrong $50 rule) was OBEYED — the agent rewrote a correct threshold; round 2 with the header caveat: 3/3 resisted.
    • The fix is in the current tree: the guided-block caveat src/recall/relevant.ts:126-127 ("user-stated guidance may be stale — verify against the current code…"), riding the header line because capToBudget trims lines (src/recall/relevant.ts:122-125), and the generic frame src/inject/budget.ts:13. The harm finding also drove the contradiction surface, which merged after: src/capture/checked.ts:20,103,126, neutralization at src/gate/gate.ts:665, conflict check in the epoch path src/inject/epochs.ts:357-361,450.
    • The body's framing ("now ride EVERY epoch regardless of overlap", unknown harm) describes 2026-11-07, not this revision.

    Body item 2 — "nobody has counted prompt_reveal invalidations against saved tokens on a multi-topic session": false at HEAD.

    Body item 3 — scale/generalization: hold-out closed, confidence runs closed, one item open.

    The claims mechanism does not rescue actionability — it is already what "evidence before claims" means here

    bench/claims.json + test/host/claims.test.ts (CI through bun run test, .github/workflows/ci.yml:56) already: hold every published number as data with n/seat/metric/estimator/record; require the README ## What memory is worth, measured section to quote each; pin retracted figures out of every markdown file (claims.test.ts, "a figure retracted in the data file never comes back"); and gate any new claim through the data file first. It needs no change from this ticket. And #335 has no surviving claim to feed it: the EPIC-era token figures (#345's warm/cold sums, #347's 2.70× ratio, the body's "~1.7k t/s prefill… a bust is minutes") are pre-#392 numbers #392 says cannot be re-derived — adding them to claims.json would be republishing a withdrawn cost claim, the same defect that made the sibling EPIC #315 unsatisfiable as written.

    Classification of each item

    Measured / documented-asserted / assumed

    What remains and who owes it

    One slice is actionable and it is not a code change: run #348 — 20 warm/cold samples on the inference server, closed by an evidence comment per the 2026-11-08 protocol. That belongs to the owner, who controls the server capacity the run needs (a prior fan-out saturated it and was stopped). Once #348 lands or is explicitly descoped, #335's remaining work is checklist bookkeeping — checking off #345/#346/#347 and closing the EPIC — which is an issue-state edit the owner makes, not a repo change. Until then there is nothing for a fixer to write that would make this ticket closer to done, and forwarding it would spend one seat to rediscover the three closures above.

  6. abogartz commented on Dec 1, 2026

    @abogartz
    OwnerAuthor

    Closed as a duplicate. Three of four legs measured and closed 2026-11-08/10 (#345 #346 #347). The one remaining leg is #348's live-model 20-sample run, owner-scheduled and tracked there.

    The work belongs to the ticket named above, which stays open. Anything recorded here that the other ticket lacks is worth moving over before this thread stops being easy to find.

    Superseded by #348.

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

    benchenhancementretrievalseverity:mediumtier:full

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions