Repository navigation
Closed
Labels
enhancementNew feature or requestreleasedretrievalRetrieval ranking, use telemetry, negative evals, consolidationseverity:lowEnhancement, refactor proposal, decision record, docs polish
Description
Problem
The plugin records that a memory rode, and nothing about what happened next.
recordHits (src/hits/ledger.ts:112) writes ev=memory_used ts src sid mem=[ids] terms=[…]. That is the whole use record. Consequences:
neverRetrieved(src/hits/ledger.ts:233) is reporting-only —src/status/store-summary.tsreads it, nothing mutates on it.useBoost(src/recall/relevant.ts:41) is a +1 tie-break, not a quality signal.- Nothing distinguishes a row that helped from a row that misled. A row that reliably sends the agent the wrong way accrues hits and therefore gets boosted.
The Prime Agent paper's continual-harness claim rests on each refinement recording its trigger and the outcome it produced, with rollback of a bad edit by ID. Our store has the trigger half only. That gap, not capture volume, is why no benchmark we run can currently say the plugin helped — see #123 and the non-equivalence analysis for #315.
What already exists (checked, not assumed)
- Turn index:
SessionState.turns, bumped bymarkTurn(src/capture/triggers.ts:322) fromsession.prompt(src/events.ts:184). Not on any ledger line. - Tool outcome:
classifyPASS/FAIL from exit code and regex (src/capture/triggers.ts:122-138), already used for FAIL→PASS pairs (t4_learning). - Ledger readers filter on
f.ev !== "memory_used"and read named fields only (src/hits/ledger.ts:187,:224), so extra fields and newev=kinds inhits.logfmtare backward-compatible. No store format migration is needed:toMemory(src/store/files/load.ts:64-91) drops unknown keys, so an outcome counter cannot live on the row anyway. - No session-end hook, and no user-correction observer.
session.execution.failedis declared and deliberately unsubscribed (src/capture/runtime.ts:94-96).
Work
- Add an optional
turntorecordHitsand to thememory_usedline. Pass it from the callers that know it; do not import session state into the ledger. - Emit one aggregated line per turn into the same ledger:
ev=turn_outcome ts sid turn outcome=clean|fail calls n fails n. Source it from the existingclassify, worst-outcome-wins, so volume stays ~1 line per turn inside the 2 MB ring. - Read-only join in
src/hits/: for each row, rides, turns-with-a-fail after the ride, turns clean. Expose throughmemory_statusasused=n clean=m fail_after=k. - Report eviction candidates — rows with ≥5 rides and 0 clean turns. Do not supersede automatically.
Non-goals
- No user-correction detector. Nothing parses prompt text today; inferring "the user is correcting me" is a separate, error-prone problem.
- No auto-eviction. A loop that edits its own memory on an inferred signal is exactly the failure the paper reports as reward hacking in Factorio, and closure/merge authority here sits with the human.
- No row format migration.
Honesty constraints
recordHitsdrops writes on lock contention and is documented as "a best-effort ledger, not proof of non-use" (src/hits/ledger.ts:149-151). Every count it yields is a floor, never a tally. Say so in the report.- A FAIL after a ride is correlation. The report must not print a causal word.
- The ring rotates, so
sincebounds the window; a row with zero rides is "zero sincesince", not unused.
Follows from the #315 benchmark work and the Prime Agent non-equivalence finding. Blocks a paper-shaped eval under #123.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestreleasedretrievalRetrieval ranking, use telemetry, negative evals, consolidationseverity:lowEnhancement, refactor proposal, decision record, docs polish
Activity
abogartz commentedon Nov 8, 2026
A proof-of-concept exists and is now pushed for safekeeping: branch
332-outcome-edge, commite70d61f("turn on rides, gate verdicts, join, status line"). Deliberately NOT proposed for merge, and the commit message says why: an outcome signal built on an end-to-end loop that is still being proven measures the wrong thing. The bench side of this loop now exists (per-stage attribution from the published harness), so when the current confidence windows land, this POC becomes the natural starting point for the real implementation.abogartz commentedon Nov 9, 2026
Not shipped in this pass, and the reason is worth recording so the next run does not start from zero.
A WIP implementation already exists:
origin/332-outcome-edgeate70d61f("wip(332): row-to-outcome edge — turn on rides, gate verdicts, join, status line", 9 files, +591). It covers all four work items —turnon thememory_usedline,ev=turn_outcomesourced fromclassifyviarecordOutcomeinsrc/capture/triggers.ts:201, the read-only join insrc/hits/ledger.ts, and eviction candidates insrc/status/store-summary.tsat five rides with no clean turn, with no auto-supersede.State of that branch, measured today:
bun x tsc --noEmitclean.bun test test/hits.test.ts— 29 pass / 1 skip / 0 fail.bun run test— 1049 pass / 0 fail across 101 files, against main's 1190 pass across 111 files.That gap is the blocker, not the code. The branch is 93 commits behind
main(merge-base0561d05), and four of the files it edits also changed on main:So this ticket needs a rebase, not new code: replay
e70d61fonto currentmain, resolve those four, and re-run the suite against main's 1190-pass baseline. The design in that commit matches the ticket's honesty constraints as written — rides stay a floor (the throttle key deliberately excludesturn), a turn with no gate command records no line so the surfaces say "outcome unknown" rather than "clean", and no causal wording appears in the report.Left alone deliberately: the branch is unmerged and untouched, so nothing was lost either way.
WhollyMindless commentedon Nov 19, 2026
Claiming this follow-up. I will bring e70d61f onto current main, verify the turn-level ledger and status behavior, and post a tested PR.
abogartz-opencode-self-improvement commentedon Nov 19, 2026
🎉 This issue has been resolved in version 0.32.0 🎉
The release is available on:
Your semantic-release bot 📦🚀