Startup secret check: compare the salt with the key as the key reader reads it, and pin the documented limits #75
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/messages-mind-mcp#75
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?
Findings from the two fresh reviews of PR #74 (#69) at
1eac958that the merge-gate rework does not fix. Neither review found a blocker. The rework fixes the raw-salt test fixture (it now catches a case fold) and rewrites thetokens-equalparagraph in README and SECURITY so that it states the limits below. Line numbers are at1eac958.Should fix
startup.py:129-139).read_key_file(store.py:136-144) reads the key asdecode("ascii").strip().lower(). That strips\x1c-\x1fas well as ASCII whitespace. The startup check compares the salt with the key only in the normalised form, which keeps\x1c-\x1f. A salt file holding"\x1c" + keyorkey + "\x1f"passescheck,syncandforgeton the base and on #74's head. The key reader would read that same file as the key, so the salt is a copy of the key. This is the class of copy #69 targets. It is pre-existing, and the #69 spec ruled it out of scope.\x1caround it is not refused". Change that sentence with the fix.Test gaps
salt = key + NBSPor"\x1c" + keyis not refused, so a change in either direction goes unnoticed. Pin the limit, or pin the refusal after item 1.check,syncandforget(probekey-x1c-salt-raw), but nothing pins it.Notes
KEY_HEX.upper(), and a Consumer token equal to the Feeder token. The base reportsfeed.consumers,feeder.token_file, and #74 reportsauth.read_token_file,store.key_file. This follows the "first pair in order" rule, so it is not a defect.compare_digestnow gets normalised inputs, which can differ in length, as the raw inputs could on the base.stripandlowertake time that depends on the data. Everything runs once at startup on local files, so no remote party observes it. Not a regression.Triage decisions (2026-11-16)
The operator accepted these decisions ("Yes, my way").
decode("ascii").strip().lower(), as inread_key_file). A salt that does not decode as ASCII is skipped in that comparison only. It is never refused for that reason, and the HMAC path still gets the raw salt.cp key saltcase (comment 1) is refused by the same fix. Add a test for it."\n"and"\r";normalisedover all 256 byte values;\x1c-\x1f.str.strip()andstr.lower(), which also remove\x1c-\x1f). Say that a non-ASCII key file is refused withkey-format, so a no-break-space salt cannot come from a copy.Sequencing
Run SVD after #65 and #78 merge, because #65 also writes
startup.py.Filed under: #69 merge gate, fresh reviews of PR #74 at
1eac958.Additions from the two fresh reviews of PR #76 at
6a7dde9, the re-dispatch of #69 after PR #74 closed. Neither review found a blocker. The rework already fixed the lower-case raw-salt fixture and the over-broad paragraph. Line numbers are at6a7dde9.Filed under: #69 merge gate, fresh reviews of PR #76 at
6a7dde9.cp key saltpassescheck,syncandforgetwhen the key file has\x1c-\x1faround the hex, for example both files holding"\x1c" + hex + "\x1c\n". The paragraph's sentence "two values that are equal byte for byte are refused" can be read as "two identical files are refused", which is false in this case. The salt-gap sentence covers it. When item 1 is fixed, also note that the no-break-space example for the salt cannot come from a copy: the key reader refuses a non-ASCII key file withkey-format.salt.rstrip(b"\n")intoSecretskeeps every test green (593 targeted, and the full suite). That change would alter the Tombstone hash of any salt file ending in two or more line endings. The fixture" " + "Ss" * 16 + " "ends in the single newline thatread_secret_fileremoves. Fix: end the fixture in"\n"or"\r". No known-answer test pins "less one final newline" inread_secret_file; the raw-salt test compares with the reader itself.normalisedstrips exactly six bytes. Adding\x00to_ASCII_WHITESPACEsurvives the targeted tests. The\x1cassertion pins one byte outside the set, not every byte. Assert over all 256 byte values.str.isspace. It also removes\x1c-\x1f, which are not Unicode White_Space. The code refuses more than the paragraph says (a read token of"\x1c" + keyis refused bycheckandapi). Name the rule exactly.first_equal, so its operands are normalised a second time. Harmless and idempotent.The operator accepted the triage decisions on 2026-11-16. They are now in the issue body under "Triage decisions (2026-11-16)". State: ready-for-agent.
⏸ SVD architect gate: dev/messages-mind-mcp#75 startup-secret-check-compare-the-salt-with-the-key-as-the-ke
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
standard· dispatch effortmediumRun:
20261116T104510Z-0fa7f947Held because: CLEAN but 2 open risk(s) (2 verification) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
205d5dfbefore the first edit and record the counts. After the change, make check must show no failures, and the pass count must rise by at least the number of new cases (2 salt rows, 4 read-key rows, 1 copy test, 3 non-canonical-key cases, 2 non-ASCII-salt cases, 1 extra raw-bytes ending). [verification]messages-mind-mcp check --config <live config>on the operator's host still prints config=ok. [verification]Change: Mirror the token-vs-key text loop at src/messages_mind_mcp/startup.py:143-148. After it, and before the tokens-equal raise at line 149, add a salt-vs-key comparison. When salt is not None, try salt.decode("ascii").strip().lower(); on UnicodeDecodeError skip this comparison only. Otherwise compute first_equal([("store.key_file", key.encode()), ("store.tombstone_salt_file", salt_text.encode())]) unconditionally and assign it to pair only when pair is None. Secrets.salt stays the raw read_secret_file bytes. Update the line-143 comment, and the identical sentences at README.md:439 and SECURITY.md:66, to name Python str.strip()/str.lower() (str.strip() also removes \x1c-\x1f). Those sentences must also say the salt gets the text comparison when it is ASCII, that a non-ASCII salt is skipped (the NBSP limit stays), and that a non-ASCII key file is refused with key-format. Pin it all with parametrize rows and new tests in tests/test_config_cli.py (around 2044-2141), a 256-byte normalised loop in tests/test_kit.py:306, an NBSP key-format case in tests/test_store.py:88, and updated phrase asserts in tests/test_feed.py:494-520.
Files:
src/messages_mind_mcp/startup.py·README.md·SECURITY.md·tests/test_config_cli.py·tests/test_kit.py·tests/test_feed.py·tests/test_store.pyDecision: accept the 2 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-startup-secret-check-compare-the-salt-with-the-key-as-the-ke.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-startup-secret-check-compare-the-salt-with-the-key-as-the-ke.md— messages-mind@voyager
spec-verify-dispatch Half B for dev/messages-mind-mcp#75 startup-secret-check-compare-the-salt-with-the-key-as-the-ke completed integration verify.
fc9a45dff6messages-mind-mcp check --config <live config>on the host and expect config=ok.codex-svd ship --run-id 20261116T112350Z-e128c482 --confirm-merge)