Repository navigation
fix(store): keep hand-written MEMORY.md index lines - #51
Merged
Merged
Conversation
kuitos
added this pull request to stack #55
October 7, 2026 14:53
This was referenced Oct 7, 2026
kuitos
marked this pull request as ready for review
October 7, 2026 15:19
MemoryStore.save() replaced any existing pointer for the saved file with the generated `- [name](file) — description` line, and an identical re-save only counted as unchanged when that exact generated line was in the index. A hand-written line (Claude Code's `- [Title](file.md) — hook`) was therefore overwritten on every save, and auto-dream re-saving its memories replaced all of them. An existing pointer is now kept unless it is still exactly the line generated from the memory's previous name and description; a memory without a pointer gains one, and an otherwise identical re-save only adds that missing pointer without rewriting the file. Refs #49
kuitos
force-pushed
the
fix/keep-hand-written-index-lines
branch
from
October 7, 2026 15:19
31c2b38 to
fe329ba
Compare
|
🎉 This PR is included in version 2.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Problem
MemoryStore.save()rewrote a memory'sMEMORY.mdline on every save, even when someone had written that line by hand. The line was rebuilt as- [<name>](<file>) — <description>, and a re-save by the main agent, an extraction fork or auto-dream replaced the user's own title and hook with it (#49: "it also rewrote … the whole MEMORY.md, which replaced our hand-written index lines").Reproduced with
MemoryStoreon main (ef15ddb). The test seeds a memory, writes its index line by hand, then re-saves it with a new description:Fix
save()adds a pointer line only when the index has none for the file.findIndexPointerLine()(store/indexFile.ts) finds the line that points at a file. All edits still go throughupsertIndexLine/removeIndexLine.Tests
test/store/MemoryStore.test.ts("MemoryStore index lines written by hand (Memories deleted or rewritten without being asked (read-only questions, extraction, auto-dream) #49)"):test/store/indexFile.test.ts:findIndexPointerLine.bun run lint,bun run typecheck,bun testandbun run buildpass.Real-environment verification (OpenCode 2.0.22, isolated DB/config, memory agents on
opencode/gpt-6-luna)Auto-dream run over 5 seeded memories, with a hand-written
MEMORY.mdunder##headings, a duplicate pair and an expired sprint goal. Measured on the top of this stack, since the dream prompt changes in #53:[slug] — descriptionline.[Terse please]and[Real DB in tests]were lost.Refs #49
🤖 Generated with Claude Code