Repository navigation
fix(prompt): don't delete or rewrite memories nobody asked to change - #53
Merged
kuitos merged 1 commit intoOct 7, 2026
Merged
Conversation
kuitos
added this pull request to stack #55
October 7, 2026 14:53
kuitos
force-pushed
the
fix/memory-edit-guardrails
branch
2 times, most recently
from
October 7, 2026 15:23
9d3d552 to
ceedb02
Compare
Reported in #49 and traced to the prompts: - the main agent deleted a memory naming a missing script on a read-only "How do I deploy?" in 6/6 runs, following "update or remove the stale memory rather than acting on it"; - extraction turned "last week" into an invented "Oct 2, 2026" ("Convert relative dates to absolute"), appended an unverified note to a memory about an unrelated system, and duplicated a memory the main agent had just saved; - auto-dream rewrote every description ("Rewrite vague descriptions") and added "**Why:** not recorded" lines ("ensure content is structured as"). Prompts: - main agent: answer from what is observed now; update a stale memory with what was observed instead of deleting it; delete only on request or when clearly wrong and superseded (memory_delete's description says the same); - extraction: resolve a relative date only when it can be worked out from today's date (now passed with the transcript), else keep the wording; touch only memories this conversation adds to; list the memories written while the conversation ran so they are not duplicated; - auto-dream: keep names and descriptions unless the content changed or the description is misleading, never add placeholder Why/How lines, keep merging duplicates and pruning clearly obsolete entries. Logging: extraction and auto-dream log the memory files their fork saved and deleted (memory_delete now reports deletions like memory_save does). Refs #49
kuitos
force-pushed
the
fix/memory-edit-guardrails
branch
from
October 7, 2026 15:33
ceedb02 to
be1bff1
Compare
kuitos
marked this pull request as ready for review
October 7, 2026 15:35
|
🎉 This PR is included in version 2.1.3 🎉 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
#49 reports memories that were deleted or rewritten when nobody asked, each traced to a prompt line:
scripts/deploy.shin 6/6 runs (Claude Code: 0/2). The line it followed: "update or remove the stale memory rather than acting on it" (sections.ts).MEMORY.md("Rewrite vague descriptions");Fix
Main agent (
prompt/sections.ts,prompt/systemPrompt.ts,memory_delete/memory_savedescriptions):scripts/deploy.shnot found as of 2026-03-05"), not deleted. It may live on another branch, and the note is still history.Extraction (
extraction/prompts.ts,ExtractionCoordinator.ts):Auto-dream (
AUTODREAM_PROMPT):MEMORY.mdby hand.Logging:
Memory extraction completed {sessionID, saved}.Auto-dream consolidation completed {saved, deleted}, also on failure.memory_deletenow reports deletions to the coordinator, asmemory_savealready did.Tests
test/prompt.test.ts: the deletion rule, the date rules, the unrelated-memory rule and the saved-during list.test/extraction/ExtractionCoordinator.test.ts: the fork gets today's date and the memories written while the conversation ran.test/extraction/autodream.test.ts: the summary log of saved and deleted files.test/tools.test.ts: thememory_deleteguidance, thememory_savecontent guidance, and that deletions are reported.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; counts are honest, some are not wins)1. Stale
deploy.shmemory + "How do I deploy this project?"sections.ts.memory_savewith what was observed ("not found … as of 2026-10-07").MEMORY.mdline with its ownedittool. Nothing in the plugin can prevent that.2. Extraction after a read-only question (decorators):
3. "Last week we finished migrating billing to Postgres 17":
memory_savecontent guidance. This is a model-adherence limit for that model, not fixed here.4. Auto-dream over 5 seeded memories (hand-written index under
##headings, a duplicate pair, an expired sprint goal):no-db-mocks.md(new description plus an invented "How to apply:" line);user-role.mdandno-db-mocks.mdbyte-identical;{"saved":["short-replies.md"],"deleted":["terse-answers.md","sprint-goal.md"]}.Refs #49
🤖 Generated with Claude Code