Repository navigation
Memory citations: store file:line evidence and verify before injecting - #495
Merged
currentbits merged 1 commit intoAug 18, 2026
Merged
Conversation
Closes #395. Learned memory entries can now carry file/thread/commit citations. When project is a live worktree, bootstrap/search/get verify file excerpts against that tree, heal drifted lines, and invalidate contradictions instead of injecting stale facts.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/memory-citations-store-file-line-evidenc-0f0b34
branch
October 3, 2026 16:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #395.
Offline curation of learned facts is a trap; what works is citations plus just-in-time verification. Every learned memory entry can now carry its evidence, and the agent that is about to apply it checks that evidence against the current worktree first.
Why
Shared memory rots when a fact outlives the code it described. A separate curation service does not fix that. This is GitHub's production lesson: store the citation, verify at use, write back on contradiction. Self-healing memory without a janitor.
Sharpens #299 (citation data the governance UI can later surface), #300 (drift at inject time, not a batch job), and #301 (contradiction cleanup no longer needs sleep-time consolidation).
What changed
Entries store an optional
citationslist:file— path, line, and a short excerpt of the supporting codethread— the thread idcommit— shaWhen
projectis a live working directory (the cwd agents already pass),memory_bootstrap,memory_search, andmemory_getverify file citations against that tree before returning the entry:verifiedUncited entries still inject, so existing memory is unchanged. The bootstrap protocol tells agents to cite learned facts.
Also:
memory_store/memory_supersedeacceptcitationssrc/auth.ts:12chipsTests
memory-server/test/citations.test.js— normalize, path safety, excerpt matchmemory-server/test/citation-verify.test.js— store, heal, invalidate-on-contradiction, slug skipREST, proxy, MemoryTab, and run-record coverage
tsc --noEmitcleanPR created by the Grok agent