Change feed: close the decisions, hardening items and test gaps from the PR #53 reviews #54
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#54
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?
PR #53 (issue #15, the change feed) merged as
7eb5080, pinned to the gated head3e65d49. A correctness review and a security review ran before each rework round; the last pair reviewed3e65d49. Rework rounds 2 to 6 fixed every blocker and the items in spec rows R13-R45. The items below were found and not fixed in that PR. None is a blocker. Each was checked against the code by its reviewer. "Mutation survives" means the change left the full suite green.Decision for the operator
docs/adr/0001-service-and-read-only-scope.md:13says "Message text never reaches People Mind".GLOSSARY.md:89says "Evidence is the only thing People Mind receives about a message".README.md:233andSECURITY.md:25now say that a Consumer token gives People Mind message text through the feed, which is true of the code. No code ties a Consumer name to its holder, so the ADR rule is policy only. Decide one of two: amend ADR 0001 and the glossary so that a Consumer token for People Mind is allowed, or keep ADR 0001 and make the README and SECURITY say "never give People Mind a Consumer token". ADRs are an operator surface.Should fix
store.pyacking,server.pymessages_changes_ack).BEGIN IMMEDIATEruns for a garbage cursor and for a no-op re-ack. Whilesyncholds a long page transaction, each ack waits up tobusy_timeout(5 s) in a worker thread, and the call deadline does not cover a lock wait. One Consumer at the rate-limit burst can fill the shared threadpool and slow every read tool and/healthz/sync. Fix: check the cursor shape before the store opens; read the position on a reader and openackingonly when the ack moves the position forward; consider a shortbusy_timeouton the positions connection.m<id>andc<id>in insert order, soedit m340ordel m5can name a different message than the Consumer's copy holds (reasoned from AUTOINCREMENT, not reproduced). The README tells a Consumer to read with no cursor, so it never seescursor-expired. Fix: tell a Consumer to pass its lastnext_cursoron every read, or to compare the epoch tag, and oncursor-expiredto drop or reconcile its copy. Record the limit on the Consumer's duty to delete inSECURITY.mdbefore the Forget slice lands.auth. The verifier no longer passesrequired_scopes, so a tool registered later withoutauth=is reachable by every Consumer token. Add a test over the registered tool list.tokens-equalcompares the read, evidence and Consumer tokens with each other only. A token file that holds a copy of the Feeder token or of the store key passescheck(reproduced atfdd7cf3).checkreads all of them and could compare the values. The documents state this limit (spec R41).behind-retentionwith its own token. The README tells it to reconcile with the read tools and a separate read token. Every new Consumer starts at position 0, so after the first prune it is behind at once and needs a read token too; the feed-only scope is then nominal. State this inSECURITY.mdunder who can read message text, or give the feed a way to reconcile.row()caps each cell atLEGEND_CHARS, not the line. A feed page of 100 events from 100 senders gives one legend line of about 6,700 characters; the transcript legend_legendhas the same property. Check this against the README page budget and decide on a cap with a+Ncell.requires-python = ">=3.12"admits 3.13, wherePath.resolve()does not raise on a symlink loop. The image and.python-versionpin 3.12. On 3.13 a looped secret path answerssecret-unreadable, or nothing under a verb that does not open it, and thesecret-path-invalidtest and sentence no longer hold. No path leaks. Fix: pin<3.13, or detectELOOPwithos.statinload_config._refuse_shared_secret_files, or document the limit.store.pathcrashessyncwith a traceback (store.pycreate_private, raised fromopen_writer). This is older than PR #53. CatchValueErrorthere, and checktombstone_pathtoo.CONSUMER_TOKEN_VERBSdoes not control which verbs read Consumer tokens. The check atstartup.py:112sits inside theAUTH_TOKEN_VERBSbranch, so an edit ofCONSUMER_TOKEN_VERBSchanges the README table but not the behaviour (a mutation toif Truesurvives). Gate the read onCONSUMER_TOKEN_VERBSalone.[feed] consumers = []now fails config validation, and no upgrade note exists. Add one line to the README or the changelog.Test gaps
3e65d49). Withmessages_changeschanged to useacking(),test_messages_changes_never_opens_a_positions_connection(tests/test_server.py:86-101) ran more than 9 minutes. The guard callspytest.fail, aBaseException, which_loggeddoes not catch; thecall()helper (tests/conftest.py:329) has no timeout. Fix: raiseRuntimeErrorin the guard, or givecall()a timeout.ackingand inprune_eventscan be removed (mutation survives ate533cb4).tests/test_server.pybudget test no longer assertsREAD_TOOLS_SHAREon its own (:339-340assert only the sum), so the read tools can grow into the feed tools' slack.server.py_Refusals): a bad argument tomessages_changes_ackwould logtool=-.not change.from_me(views.py) is not pinned: removing it survives because Owner rows carry no Handle in the fixtures. The ack'supdated_atvalue has no assertion either.test_each_token_reaches_only_its_own_toolscallsmessages_peer_evidence_v1(tests/test_feed.py:181), which does not exist, so its "Consumer reaches no evidence tool" half proves nothing.Notes
Tokensis frozen but holds the caller's Consumer dict by reference; storeMappingProxyType(dict(consumers)).tokens-equalandsecret-file-sharederrors always namefeed.consumersandauth.evidence_token_file, even when the config has neither.feed_needs_authadds a second, falsefeedlocation when[auth]itself fails validation.kit/feed.pyrequire_consumerand theunknown-consumercode have no caller.kit/secrets.py); README says "owner-only file". This is a*secret*path: operator surface.ROLLBACKinstore.transaction(store.py:160-172) can raise a second error that hides the first, so the reply carries the wrong code.README.md:274andSECURITY.mdsay "After a Backfill or a Rebuild this is the whole history". That holds only until the 30-day prune removes the Backfilladdevents. As an upper bound on what a Consumer token reads, it is still safe.start < floor) correctly does not. The ADR wording only.Acceptance criteria
Triage rulings (2026-11-15)
Operator word "accept leans / after #13, triage #58 and dispatch" (sha256:a999fb29c997).
README.mdandSECURITY.mdsay "never give People Mind a Consumer token". ADR 0001 andGLOSSARY.md:89do not change.ready-for-agent. The follow-ups #52, #54 and #56 run one at a time, after #13 and #58.kit/secrets.py, a*secret*path. It is in scope. The merge is T4.Blocked by
Filed under: operator word "Merge 53 on green" sha256:a75d284a15f8
Moved to
ready-for-agentunder ruling 8. Item 1 is decided: ruling 2B keeps ADR 0001, and the README and SECURITY say "never give People Mind a Consumer token". The body now holds the rulings. Dispatch waits for the operator'ssvd:go, after #52.⏸ SVD architect gate: dev/messages-mind-mcp#54 change-feed-close-the-decisions-hardening-items-and-test-gap
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
substrate· dispatch efforthighRun:
20261115T034951Z-132d289fHeld because: CLEAN but 6 open risk(s) (1 sequencing · 1 verification · 4 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
aae7999(#63) may be #52's merge. The drain must check #52 is closed before dispatch, and rebaseline the README/SECURITY hashes if #52 lands after spec baseaae7999. [sequencing — blocked by #52, #13, #58]Change: Slice A of 2 (issueBinding: refs). Item 2: follow ReadTools._read (server.py:286-288). messages_changes_ack (server.py:356-361) first shape-checks the cursor with a new kit/page.parse_cursor, split from decode_cursor at page.py:79. It then validates on a reader through a new views.ack_reply, which shares feed.check_seq lifted from kit/feed.py:37-40, and opens acking() only when the position would move forward. views.ack still re-validates inside the write transaction. open_positions gets a 1 s busy_timeout through an _open_guarded keyword. store.transaction (store.py:159-171) rolls back only if conn.in_transaction and keeps the first error. startup.start (startup.py:92-126) gates Consumer-token reads on CONSUMER_TOKEN_VERBS alone, and compares every secret value the verb read pairwise through a new kit/scopes.first_equal over _equal. It raises tokens-equal at the exact pair of locations. Tokens.scrub replaces the longest token first, and Tokens stores MappingProxyType(dict(consumers)). The dead require_consumer is deleted. README/SECURITY: ruling 2B "Never give People Mind a Consumer token" (README.md:279, SECURITY.md:25), plus doc-only items 3, 4, 7 and 13, the item-6 sentence and the Backfill sentence, each with its pinned test in tests/test_feed.py. Test gaps 14–19 and item 5 are each pinned by a named mutation-killing test.
Files:
src/messages_mind_mcp/server.py·src/messages_mind_mcp/store.py·src/messages_mind_mcp/views.py·src/messages_mind_mcp/startup.py·src/messages_mind_mcp/kit/feed.py·src/messages_mind_mcp/kit/page.py·src/messages_mind_mcp/kit/scopes.py·README.md·SECURITY.md·tests/test_server.py·tests/test_feed.py·tests/conftest.py·tests/test_kit.py·tests/test_config_cli.py·tests/test_store.pyDecision: accept the 6 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-15-change-feed-close-the-decisions-hardening-items-and-test-gap.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-change-feed-close-the-decisions-hardening-items-and-test-gap.mdspec-verify-dispatch Half B for dev/messages-mind-mcp#54 change-feed-close-the-decisions-hardening-items-and-test-gap completed integration verify.
2efd6b6a7bcodex-svd ship --run-id 20261115T041011Z-2c5fc911 --confirm-merge)