test_m6_r2_real_dto_shape resolved the companion repo as a sibling directory,
which is only true of the development checkout. On the VM the skipif was
always true, so the seven cases that exercise the companion's real DTO builder
-- the only genuine check of the cross-plugin envelope shape -- never ran in
the environment that most needed them, and a skip shows up as a missing dot
rather than a failure.
test_ops_migration had the harder version of the same bug: the import simply
failed, and working around it with PYTHONPATH let the memory side's own
core/ops_migration shadow the companion module, producing two failures that
looked like product defects and were not.
Resolution now lives in tests/_companion_repo.py and tries, in order, the
COMPANION_PLUGIN_ROOT override, the sibling development directory, the
sibling deployed directory (_ops suffix), and one level up. The path helper
inserts at the front of sys.path deliberately: getting that order wrong fails
as "green but testing the wrong module", which is worse than an ImportError.
Memory suite 330 passed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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>