Change feed follow-ups from the #54 reviews: lock-wait docs, ack test gaps and notes #68
Labels
No labels
boundary:crosses
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/messages-mind-mcp#68
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The correctness review and the security review of PR #67 (head
2efd6b6) found no blocker. Every mutation named in the spec table fails its test in under 8 s. The findings below are in the code at the edges of the new checks, in two documents and in the tests. They land here so that #54 closes with slice A.Should fix first
README.md:24andSECURITY.md:89say a lock wait on the store "ends after 5 seconds". The ack's positions transaction now gives up after 1 s (POSITIONS_BUSY_TIMEOUT). Only the docstrings changed. An ack also runs two transactions now, and each has its own 10 sCALL_SECONDSdeadline, so the "a tool call that reads for more than 10 seconds stops" sentence needs a qualifier for the ack.Test gaps (mutations that survived)
views.ack,views.py:413-416). Withlast_seq=10**18, or withparse_cursorin place ofdecode_cursor, every test passes, because the reader pre-check hides both. This re-check is the guard against a Rebuild or a prune between the reader check andacking. Fix: a test that makesviews.ack_replyreturnNoneand asserts thatcursor-aheadandcursor-expiredare still refused and that no position is written.store.transactionsurvives on its own. The test covers the case wherein_transactionis false; theexcept sqlcipher.Error: passbranch never runs. Add a case whereROLLBACKitself fails while a transaction is open, and assert the first error is the one raised.test_an_ack_waits_at_most_a_short_time_for_the_lockis 3 s, so a busy timeout up to about 2.5 s passes. Tighten the bound, or assert the pragma value on the positions connection.Notes
Tokensbackstop wrapper instartup.startcannot be reached (startup.py:141-149).first_equalalready refuses every pair thatTokens.__post_init__checks, and a mutation of its location list survived. Delete it, or keep it and say why.syncwriter stays inside it, and the nested-join rule absorbs later writes without a commit. The old code left the connection in the same state; the swallow now hides it. Consider closing the connection in that case.README.md:401,SECURITY.md:66) can read as if the api did not compare tokens with each other. It does. Reword.checkcatches that pair. The documents say so.CALL_SECONDSplus 1 s in the worst case (two connections, each with its own deadline).make checkon macOS runstest_real_time_machine_exclusion(tests/test_host.py:357). It adds a real Time Machine exclusion to a throwaway directory under$HOME. The ACL tests runchmod +a, and one test makes a directory under$HOME. A review lane that must not change host settings has to deselect these 11 tests. Consider an opt-in variable for the tests that change host state.Human act
ruling: the operator rules on the ROLLBACK and
Tokensbackstop notes and approves dispatch withsvd:go(CONV-40)Blocked by
startup.pyandstore.py, as the ROLLBACK and backstop notes do)Filed under: operator word "I grant authority to merge T4 through 21:00 aedt" sha256:cec4dd4fecbd
Triage Notes
Checked against
mainat99a849c.Item 1 (salt vs normalised key): confirmed.
read_key_file(src/messages_mind_mcp/store.py:136-143) strips whitespace and folds hex to lowercase.read_secret_file(src/messages_mind_mcp/kit/secrets.py:18-42) returns raw bytes and removes one trailing newline only.startup.py:127-136appends the salt in raw form. Thestrip().lower()loop covers the held tokens only.A reproduction with synthetic files and the shipped
read_key_file,read_secret_fileandfirst_equal:The intended behaviour is already decided. The #54 ruling Q3 says: compare every pair, "the store key (and its
strip().lower()form) and the tombstone salt, including the salt against the key". The shipped check does not meet that text for the salt.SECURITY.md:66andREADME.md:401say thattokens-equalcompares "the value of every secret". The comparison is on raw values only, except tokens against the key. The documents overstate the check.Exposure: a salt that is a variant of the key can be derived from the key file. ADR 0007 keeps the salt apart from the Tombstone export, and the key and the salt sit in the same secrets directory, so a party with the key usually has the salt too. The defect is a missed configuration guard and a document claim that is wider than the code.
The salt reaches HMAC as raw bytes (
tombstones.py:44-50). A fix must normalise for the comparison only. A change to the HMAC input changes every existing Tombstone hash and the salt check.Item 2 (lock-wait docs): confirmed.
README.md:24andSECURITY.md:89say a lock wait "ends after 5 seconds". The positions connection usesPRAGMA busy_timeout=1000(store.py:94,store.py:313).Items 3 to 5 (test gaps): each is a mutation that the #67 reviewers ran and that left the suite green. Not run again here.
File overlap.
startup.pyandtests/test_config_cli.py. #56 (at its gate, spec base99a849c) writestests/test_config_cli.py,README.mdandSECURITY.md. A merge that changes those files before #56 dispatches makes the #56 source hashes stale.startup.py,store.pyandviews.py. The ROLLBACK note and theTokensbackstop note write the same files.Change feed follow-ups from the #54 reviews: salt vs normalised key, lock-wait docs and ack test gapsto Change feed follow-ups from the #54 reviews: lock-wait docs, ack test gaps and notesTriage outcome
The operator accepted each lean (operator word "accept").
bug,ready-for-human), with the normalisation scope widened to every secret pair. It dispatches after #56 and before #65.enhancement, nowready-for-human: CONV-40 rule 3 fires, because theTokensbackstop note touches the startup secret check. It is blocked by #65, which writesstartup.pyandstore.py.