flying_crp on X: with memory on, the digest in the agent's instructions
disagreed with the project's own rules, and things that belong in the
project were saved to memory instead, while the user keeps the
project's docs tidy themselves.
- The digest's header (internal/memory/digest.go) now puts the
project's own instruction files (AGENTS.md and the like) and docs
first: where a memory disagrees, the agent follows the files and
says which memory is out of date. A project's rule or fact belongs in
its files; memory keeps what holds for the user across projects.
- memory_save's description says the same, and a new save made in a
project whose root holds AGENTS.md, CLAUDE.md, GEMINI.md,
.github/copilot-instructions.md or .cursorrules ends with a note
naming the files found: for a memory of the caller's project (any
kind but profile and preference), to offer to write it there and
forget the memory once it is; for a global rule or procedure, the
same when it holds only in this project (projectFilesNote). The save
itself is kept.
- Distillation's instructions leave a project's rules and conventions
to its files, and drop what disagrees with them.
- The texts name neither magpie nor a vendor (checked in each test).
The only filenames named are AGENTS.md "and the like" in the fixed
text, and in the save note the files actually found on disk.
- docs/subsystems/memory.md says all three.
Tests, each red on the old code (the three source files put back to
origin/main by hand, tests kept), green with the change:
TestDigestDefersToTheProjectsFiles (internal/memory), TestWhatIsSent
(internal/memdistill), TestMemorySavePointsProjectRulesToItsFiles
(internal/gateway, -tags nogui).
Real agents, sandbox HOME and CLAUDE_CONFIG_DIR, model through the live
gateway as an endpoint only, nothing live written:
- Digest: a git project whose CLAUDE.md/AGENTS.md say "Python code here
is indented with tabs", and a digest in the sandbox CLAUDE.md with a
project memory "Indent Python code with 4 spaces". Asked to write
add.py, with the old header Claude Code (haiku and sonnet) both used 4
spaces, following memory; with the new header both used a tab and
said the memory was out of date.
- Save: a sandbox `magpie serve` built from this tree on 127.0.0.1:3471,
Claude Code (sonnet) with its memory server over --mcp-config, asked
to "remember for this project: tests always run with pytest -x". The
save came back with the note naming AGENTS.md, CLAUDE.md, and the agent
offered to add the rule to them and then delete the memory.
Full suite (`go test -timeout 45m ./...`, mica):
- at a9696f14d: mica's disk filled during the run; reds in 17 packages
were "no space left on device". Not counted.
- at 8647ac995 (origin/main + this): 101 ok, 3 red, each filed and not
in code this change touches: internal/dirent watch tests (#7031),
internal/gateway TestOpenCodeGoOwnFreeModelGetsNothingOfOpenCodes
(#7117), internal/gui TestGatewayModeListsNoOwnSessions (#7064).
- at d67beb049 (this commit's tree, on origin/main 67405d560): 101 ok,
the same 3 filed reds (#7031, #7117, #7064), nothing else.
GOOS=linux and GOOS=windows go vet of memory, memdistill and gateway:
ok. gofmt -l: clean. No GUI or i18n change, so no GUI suite run.
Not tried: Codex or other agents (Claude Code only); a memory server
reached from another computer (the note stats the project roots that
computer named, on this one: at worst an advisory note).