Conversation
PR #777 (closes #772) and PR #779 (closes #778) tightened §5 c4 across all three phases of context-gateway 409-conflict tests. mtime_ns echo parity, however, was asymmetric: Phases A (Skills) and C (Agents) both asserted `data["mtime_ns"] == str(<file>.stat().st_mtime_ns)`, while Phase B (Commands) did not. The 409 envelope already returns the correct echo from `context_commands.py:248`; the test was just under- asserting. This adds the matching one-line assertion to `TestCommandCRUD.test_mtime_conflict`, mirroring the Skills/Agents shape so a future regression that drops the echo for Commands fails fast. Note: the echo is the retry-hint contract, not §5 c4 itself (which pins the soft-abort label and no-write guarantee — both already covered for Phase B by PR #777). This is hygiene/parity, not a regression of any ADR requirement. Mutation-validation: temporarily mutated `context_commands.py:248` from `str(current_mtime_ns)` to `"0"`. The new echo assertion fails (`'0' == '1777930477924060002'`); the preceding 409 / `status == "aborted"` assertions still pass. Revert clean (`git diff` on the production file is empty). - `uv run pytest -m "not ollama" packages/memtomem/tests/test_web_routes_context.py` — 58 passed. - `uv run ruff check` + `ruff format --check` on the test file — clean. Co-Authored-By: Claude <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Closes #780. Adds the one-line
mtime_nsecho assertion toTestCommandCRUD.test_mtime_conflictso all three phases of thecontext-gateway 409-conflict tests assert the retry-hint contract
identically.
status: "aborted"mtime_nsechotest_web_routes_context.py:224)test_web_routes_context.py:585)test_web_routes_context.py:793)The 409 envelope already returns the echo correctly from
context_commands.py:248; the test was just under-asserting.Why this isn't an ADR §5 c4 fix
§5 c4 pins the soft-abort label + no-write guarantee — both already
covered for Phase B by PR #777. The
mtime_nsecho is theretry-hint contract from
context_commands.py:241-250, not §5 c4.This is hygiene/parity, not a regression of any ADR requirement.
PR #779 explicitly called this out as a "file separately if the team
wants strict three-phase echo parity" follow-up.
Mutation-validation
Mirrored PR #779's pattern. Temporarily changed
context_commands.py:248from:to:
Result:
The new assertion fails as expected. The preceding 409 and
status == "aborted"assertions still pass — confirming the new lineis what catches a dropped/wrong echo, not the existing assertions.
Reverted;
git diffoncontext_commands.pyis empty.Test plan
uv run pytest -m "not ollama" packages/memtomem/tests/test_web_routes_context.py— 58 passed.uv run ruff check packages/memtomem/tests/test_web_routes_context.py— clean.uv run ruff format --check packages/memtomem/tests/test_web_routes_context.py— clean.code; existing assertions still pass; revert is clean.
Refs: #779 (Phase A tightening, where this was filed as a follow-up),
#777 (Phase B no-write pin), #761 (parent RFC), #769 (ADR §5).
🤖 Generated with Claude Code