Files
magpie/internal/memory
yetone 0a08c37080 memory: Tidy merges and sets aside, Untidy undoes it
The store side of the nightly tidy (Dreaming). Tidy takes a plan: merges
of memories that say the same thing, memories to set aside, and a date
before which unreviewed distilled candidates are set aside. What the user
wrote or pinned is never rewritten or set aside; merged with others it is
the one kept, word for word, and two of them are never merged. A merge
across scopes or of a memory no longer in use isn't done. Each change is
returned with the states it replaced, and Untidy puts back only what is
still as Tidy left it; a merged memory the user edited since stays.

Run: mote-run go test -count=1 ./internal/memory: ok.
Broken by hand: dropping the user/pinned guard on stale turns
TestTidyNeverChangesTheUsers red; dropping Untidy's "still archived"
check turns TestUntidyKeepsWhatTheUserChanged red (undo: 3).
2026-11-10 03:25:45 +08:00
..