提交图

2 提交

作者 SHA1 备注 提交日期
c1acfce738 fix: keep sleep-decay summaries retrievable, and stop excluding two tests
Sleep decay compresses a batch of stable memories into one summary row and
archives the originals. The summary was built without memory_domain, and
MemoryRecord.memory_domain defaults to "unknown" -- a truthy value, so the
`if not self.memory_domain:` classification branch in ensure_defaults has
never once executed. The summary stored as unknown, the retrieval gate only
admits user_memory and drops it before scoring, and the sources were already
archived out of the candidate query. Summary unreachable plus originals
unreachable meant the whole thread disappeared, silently, every night the
job ran.

Summaries now inherit the domain of their source records, and the decay
bucket key includes the domain so a bucket cannot mix domains and leave the
question undecidable. Before archiving anything, the summary is read back and
checked through the same gate the retrieval side uses; if the source was
reachable and the summary is not, the archive is skipped with a warning
rather than turning live memory into dead rows. A maintenance.memory_decay_
dry_run switch runs the whole selection and summarisation without writing.

ensure_defaults itself is left alone -- changing that default would reclassify
every write that omits a domain.

The two test_security_cache tests that have been excluded from the test
command for five rounds turned out to have the same root cause: the fixture
built a record without a domain, so search returned an empty set. Those tests
are about ACL and cache invalidation, not domain classification; with an
explicit domain the file passes 6/6 and no longer needs excluding.

Memory suite 330 passed, was 323 passed / 2 failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 05:27:07 +08:00
2f24824b4f chore: import memory companion baseline 2026-07-24 00:25:42 +08:00