Serve the Mail peer change feed and peer info #160
Labels
No labels
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/mail-mind-mcp#160
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?
Outcome
Peers can read Mail's v1 change feed directly:
mail_peer_inforeports identity, the supported profile and the implemented operations, andmail_peer_changes_v1serves bounded, signed-cursor pages from the unit 1 log. Unit 2 of the epic #152.Decision substrate
ADR 0012 (rules 9–11, 13, 14), ADR 0010, the contract kit
contracts/mind-v1/(README,schema.json,requests.schema.json, fixtures,recovery.md), and ADR 0008. The grill record is on #152.Scope and acceptance criteria
mail_peer_info({})returns the exact profilemail-people/1.0,source_id, epoch,retention_seconds, and the operations it implements:evidenceandchanges. It never advertisessnapshot.mail_peer_changes_v1with the exact negotiated request and output schemas, published with their full$defs; evidence scope and the existing rate-limit bucket; a structured error setsisError=true.scope_idis the salted hash of source, epoch, contract and the account selection (ADR 0012 rule 9). HMAC-SHA256 cursors bound to source, epoch, scope, contract and position; a token from another scope, epoch or key returnsinvalid_cursor; a position below the floor returnscursor_expired, never an empty success.limit1–100, default 100; a finite high-water mark captured per page asthrough; strictly increasing sequences at mostthrough;has_more=trueonly with a nonempty page and a new continuation; an empty page may advance across irrelevant events. An index onpeer_events(account, seq)serves single-account scopes. The 1 MiB response cap and per-record caps returnrecord_too_largewithout advancing the cursor.make checkpasses.Non-goals
mail_peer_snapshot_v1, advertisingsnapshot, writer or schema changes beyond the index, People consumer changes, release or deploy.Blocked by
⏸ SVD architect gate: dev/mail-mind-mcp#160 serve-the-mail-peer-change-feed-and-peer-info
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:
20261103T095651Z-195b53bbHeld because: CLEAN but 5 open risk(s) (1 verification · 4 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
uv run python3 scripts/bench_feed.pyon the dispatched branch and confirm the PR quotes the I02 JSON line with host and commit against each budget. The snapshot leg of rule 14 is deferred to unit 3 (#161). [verification]Change: Copy the #158 mail_peer_evidence_v1 slice.
(1) Turn server.py:1010-1024 PeerEvidenceTool into a base _PeerTool whose schemas are ClassVars. Add PeerInfoTool and PeerChangesTool, registered like server.py:1085-1092: SCOPE_EVIDENCE, READ_ONLY, the shared peer.Jobs pool. Copy the mail_peer_evidence_v1 flow at server.py:1027-1083 line for line: contract mismatch gives unsupported_version, an unknown account gives invalid_arguments, the selection is the sorted configured accounts.
(2) Add Store.peer_changes(cursor, accounts, limit, budget) and Store.peer_identity. Copy the dedicated read-connection discipline of Store.peer_evidence at store.py:2609-2785. In one read txn:
(3) In peer.py:
(4) Add CREATE INDEX IF NOT EXISTS peer_events_account ON peer_events(account, seq) to _SCHEMA after store.py:239. No version bump.
(5) Amend the ADR 0008 §1 tool list and add §9. Update the tool lists in README, SECURITY, CLAUDE.md and config.example.
(6) Add scripts/bench_feed.py for I02, shaped like bench_search.py:24-60 and test_peer_evidence.py:751-833.
Files:
src/mail_mind_mcp/peer.py·src/mail_mind_mcp/server.py·src/mail_mind_mcp/store.py·tests/test_peer_changes.py·tests/test_server.py·tests/test_evidence.py·scripts/bench_feed.py·docs/adr/0008-evidence-scope.md·README.md·SECURITY.md·CLAUDE.md·config.example.tomlDecision: accept the 5 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-03-serve-the-mail-peer-change-feed-and-peer-info.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-serve-the-mail-peer-change-feed-and-peer-info.mdspec-verify-dispatch Half B for dev/mail-mind-mcp#160 serve-the-mail-peer-change-feed-and-peer-info completed integration verify.
6d9bd7c1bccodex-svd ship --run-id 20261103T102225Z-e6461552 --confirm-merge)