test(mem0): lock the D-7 interlock's absent-capture fail-safe - #552
Merged
Merged
Conversation
resolve_capture()'s final `return "auto", "default"` is the fleet-wide
fail-safe that keeps the D-7 interlock ENGAGED on any profile whose
mem0.json omits a `capture` key -- which is every non-root profile here.
Nothing asserted it.
Measured: mutating that literal to `return "off", "default"` disarms the
interlock on every such profile and the existing mem0 suite stayed green
(28/28 pass against the mutant: 15 in tests/plugins/memory/
test_mem0_remember.py + 13 in plugins/memory/mem0/test_capture_pipeline.py).
Adds two tests:
- test_resolve_capture_defaults_on_when_absent — pins value + source, and
that empty/whitespace inputs fall through to the same default.
- test_interlock_engages_when_profile_config_omits_capture — drives the
real provider against a profile-shaped HERMES_HOME whose mem0.json has
no `capture` key; asserts the write is suppressed and no POST /memories
is ever issued.
Verified:
clean tree -> 17 passed (was 15)
mutant M1 (auto->off in the default return)
-> 2 failed, 15 passed; exactly the 2 new tests
mutant M2 ("auto" dropped from _CAPTURE_ON)
-> 4 failed, 13 passed (2 new + 2 pre-existing)
scripts/run_tests.sh tests/plugins/memory/
-> 22 files, 449 tests passed, 0 failed
Test-only change; plugins/memory/mem0/__init__.py is byte-identical to the
base commit.
Refs: kanban t_760693df
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 10, 2026
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.
What
Adds two regression tests pinning
resolve_capture()'s finalreturn "auto", "default"— the fleet-wide fail-safe that keeps the D-7interlock engaged on any profile whose
mem0.jsonomits acapturekey(that is every non-root profile in this fleet).
Test-only.
plugins/memory/mem0/__init__.pyis byte-identical to the base commit.Why (measured)
Filed from kanban card
t_760693df, which asserted the D-7 interlock wasdisarmed on 9 worker profiles because the profile
mem0.jsonlacks acapturekey. That mechanism is falsified — absent config resolves to("auto", "default"), i.e. capture ON, so the interlock engages. The cardhad the polarity backwards; the card's prescribed fix (resolve the ROOT
mem0.jsoninstead) measured inert: 0 of 10 profiles change theircapture_is_ondecision.But the audit did find one real, unguarded invariant. The whole fail-safe is a
single literal, and nothing tested it:
Verification
auto->offin the default return)"auto"dropped from_CAPTURE_ON)scripts/run_tests.sh tests/plugins/memory/Reviewer note
The 2 new tests are the entire behavioural claim. M1 is the mutation they were
written to catch; it passed 28/28 before this commit.