Adopt Mail peer v1 with durable bounded evidence recovery #47

Closed
opened 2026-11-03 00:19:17 +00:00 by svc-agent-writer · 2 comments

Outcome

Adopt the pinned Mail peer contract with bounded, durable progress in People Mind. A restart during evidence processing repeats only unfinished bounded work; it must not skip derived effects or replay an entire completed evidence pass.

Decision substrate

Operator-approved ADR 0009 adopts Mail ADR 0010. docs/contracts/mail-peer-v1.md pins the exact wire specification, schemas, fixtures and recovery matrix. People ADR 0003 remains authoritative for reference-only evidence storage, asserted-field ownership and Forget. #45 landed as PR #46 (8395238); integrate its configurable deadline, do not duplicate or revert it.

Scope and acceptance criteria

  1. Select the explicit profile and validate structured responses; preserve an explicitly configured legacy mode without silently downgrading on protocol/version/auth errors. No runtime dependency on another mind's source tree, database, Kubernetes or a broker.
  2. Atomically commit a bounded page's reference effects, pending work and received cursor. Fetch evidence outside graph transactions, then atomically commit permitted derivations and completion of that work generation. New invalidations during a fetch must survive old completion. Received and applied freshness are distinct.
  3. Persist only approved derived fields, identities and references. No raw response JSON, signature lines, subjects or mail text in checkpoints, pending/staging tables, WAL or quarantine. Do not mark an address resolved separately from committing its effects.
  4. Enforce event identity/revision/deletion fences, retract only source-specific support, preserve other sources and asserted fields, and stage consistent replacement snapshots before atomic generation activation. Failed/partial snapshots cannot retire the current projection. Unknown/expired cursors rebuild explicitly, never silently start at now.
  5. Serialize Forget with enqueue, staging, activation and final evidence commit. Remove pending/staged personal data and recheck salted-handle tombstones before late replies commit. A replay or restored snapshot cannot resurrect a forgotten Person.
  6. Bound requests/retries/concurrency, pending records/bytes, and work per transaction; pause ingestion before queue capacity is exceeded. Expose honest applied freshness and sanitized lag/backlog/error state; continue useful local service without an available peer.
  7. Pass C01–C10 and I01–I04 from the pinned matrix using synthetic stores and actual process/HTTP failures, including concurrent Forget. make check and existing CardDAV/vCard behaviour pass. Do not treat wire fixtures as runtime certification.

Non-goals

Bus/fabric delivery, calendar/attention implementation, off-host derivation, broader evidence fields, package publication and production deployment.

Blocked by

  • dev/mail-mind-mcp#161 — the snapshot and feed handoff; the last unit of the epic dev/mail-mind-mcp#152 (ADR 0012), which also lands the feed in #160.
  • dev/people-mind-mcp#45 — satisfied: merged as PR #46; preserve the landed deadline.
## Outcome Adopt the pinned Mail peer contract with bounded, durable progress in People Mind. A restart during evidence processing repeats only unfinished bounded work; it must not skip derived effects or replay an entire completed evidence pass. ## Decision substrate Operator-approved ADR 0009 adopts Mail ADR 0010. `docs/contracts/mail-peer-v1.md` pins the exact wire specification, schemas, fixtures and recovery matrix. People ADR 0003 remains authoritative for reference-only evidence storage, asserted-field ownership and Forget. #45 landed as PR #46 (`8395238`); integrate its configurable deadline, do not duplicate or revert it. ## Scope and acceptance criteria 1. Select the explicit profile and validate structured responses; preserve an explicitly configured legacy mode without silently downgrading on protocol/version/auth errors. No runtime dependency on another mind's source tree, database, Kubernetes or a broker. 2. Atomically commit a bounded page's reference effects, pending work and received cursor. Fetch evidence outside graph transactions, then atomically commit permitted derivations and completion of that work generation. New invalidations during a fetch must survive old completion. Received and applied freshness are distinct. 3. Persist only approved derived fields, identities and references. No raw response JSON, signature lines, subjects or mail text in checkpoints, pending/staging tables, WAL or quarantine. Do not mark an address resolved separately from committing its effects. 4. Enforce event identity/revision/deletion fences, retract only source-specific support, preserve other sources and asserted fields, and stage consistent replacement snapshots before atomic generation activation. Failed/partial snapshots cannot retire the current projection. Unknown/expired cursors rebuild explicitly, never silently start at now. 5. Serialize Forget with enqueue, staging, activation and final evidence commit. Remove pending/staged personal data and recheck salted-handle tombstones before late replies commit. A replay or restored snapshot cannot resurrect a forgotten Person. 6. Bound requests/retries/concurrency, pending records/bytes, and work per transaction; pause ingestion before queue capacity is exceeded. Expose honest applied freshness and sanitized lag/backlog/error state; continue useful local service without an available peer. 7. Pass C01–C10 and I01–I04 from the pinned matrix using synthetic stores and actual process/HTTP failures, including concurrent Forget. `make check` and existing CardDAV/vCard behaviour pass. Do not treat wire fixtures as runtime certification. ## Non-goals Bus/fabric delivery, calendar/attention implementation, off-host derivation, broader evidence fields, package publication and production deployment. ## Blocked by - dev/mail-mind-mcp#161 — the snapshot and feed handoff; the last unit of the epic dev/mail-mind-mcp#152 (ADR 0012), which also lands the feed in #160. - dev/people-mind-mcp#45 — satisfied: merged as PR #46; preserve the landed deadline.
Collaborator

⏸ SVD architect gate: dev/people-mind-mcp#47 adopt-mail-peer-v1-with-durable-bounded-evidence-recovery

Status: CLEAN after 1 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity substrate · dispatch effort high

Run: 20261103T194658Z-c6a5ac02

Held because: CLEAN but 8 open risk(s) (2 verification · 6 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. Re-slice approval. This spec is the 16-file People consumer core, with the durable pass placed in sync.py (not a new mailsync.py) to stay at the ceiling. Deferred: the contract status line, vendoring schema/fixtures, the overlay protocol comment, packaged I01, and I02. Approve this slice and the 'Mail peer v1 pair acceptance and contract vendoring' follow-up, or split further (for example migration plus wire client first)? [decision]
  2. I01 on the packaged #45 consumer and #148 Mail baseline cannot run in Half A. After merge: run make image plus a Mail image containing PR #169, pair them over direct MCP, and podman kill Mail during mail_peer_evidence_v1. Record that the sync line ends mailmind-unavailable within request_timeout_seconds, that the next pass resumes from the stored cursor, and that people_find keeps answering. [verification]
  3. I02 is unmapped: which budgets are pre-declared (p50/p95/p99 for people_find and /healthz, throughput, peak queue bytes, RSS), and on which packaged pair? [decision]
  4. The default protocol mail-people/1.0 makes existing deployments fail explicitly with mailmind-version until Mail serves v1 or the operator sets legacy-text. Is the v1 default approved? [decision]
  5. Snapshot activation is one set-based transaction proportional to the snapshot (capped by max_staged_records) and may enqueue more than max_pending_records. Accept this as the documented exception to per-transaction bounds, or require an active-generation flip with bounded GC batches? [decision]
  6. C08 byte-level erasure: the forgotten Person's handle values may persist in SQLite free pages, WAL frames and Litestream replicas. Add secure_delete plus a post-Forget wal_checkpoint(TRUNCATE) in this slice, or treat it as an ADR 0003 follow-up? [decision]
  7. Adjacent: in explicit legacy-text mode, the zlib checkpoint in source_state (sync.py:27-35) holds addresses that graph.forget does not purge (pre-existing). File a follow-up? [decision]
  8. The pinned contract was read through a summarizing web fetch. Before encoding the models, dispatch must open schema.json and requests.schema.json at 21e279da byte-exact, check every quoted bound, and report any mismatch as a deviation. [verification]

Change: Add a v1 wire client in new sources/mailpeer.py, mirroring MailmindSource._fetch (mailmind.py:163-266: one Client per pass, the #45 timeout, _Pacer, _retry_delay, sanitized excepts), and read only structured_content. The durable bounded pass now lives in sync.py as run_peer_pass, dispatched from run_pass:38. That frees the ceiling slot for tests/test_identity.py:445. Migration 6 adds new tables only, mirroring store.py:91-95. Page commit, snapshot activation and per-address evidence units each run in one transaction. Source-specific retraction uses two per-(source,address) SQL constants. RETRACT_UNSUPPORTED deletes interactions whose (entity, direction, at) is no longer in mail_support. It runs at page commit for every affected address (del, add-revision narrowing, direction/at change) and again in each evidence unit. RESTORE_SUPPORTED re-inserts from mail_support after ingest_record, because ingest_record's rec_hash 'unchanged' shortcut (graph.py:267-268) skips the INSERT OR IGNORE at :339-342. Forget purges the mail* rows. views exposes applied freshness.

Files: src/people_mind_mcp/config.py · src/people_mind_mcp/store.py · src/people_mind_mcp/sources/mailpeer.py · src/people_mind_mcp/sources/__init__.py · src/people_mind_mcp/sync.py · src/people_mind_mcp/graph.py · src/people_mind_mcp/views.py · src/people_mind_mcp/server.py · README.md · tests/test_mailpeer.py · tests/test_mailmind.py · tests/test_server.py · tests/test_config_cli.py · tests/test_embed.py · tests/test_deploy.py · tests/test_identity.py

Write-set divergence: present table wins. structured return named src/people_mind_mcp/config.py, src/people_mind_mcp/store.py, src/people_mind_mcp/sources/mailpeer.py, src/people_mind_mcp/sources/init.py, src/people_mind_mcp/sync.py, src/people_mind_mcp/graph.py, src/people_mind_mcp/views.py, src/people_mind_mcp/server.py, README.md, tests/test_mailpeer.py, tests/test_mailmind.py, tests/test_server.py, tests/test_config_cli.py, tests/test_embed.py, tests/test_deploy.py, tests/test_identity.py, src/people_mind_mcp/mailsync.py; table names src/people_mind_mcp/config.py, src/people_mind_mcp/store.py, src/people_mind_mcp/sources/mailpeer.py, src/people_mind_mcp/sources/init.py, src/people_mind_mcp/sync.py, src/people_mind_mcp/graph.py, src/people_mind_mcp/views.py, src/people_mind_mcp/server.py, README.md, tests/test_mailpeer.py, tests/test_mailmind.py, tests/test_server.py, tests/test_config_cli.py, tests/test_embed.py, tests/test_deploy.py, tests/test_identity.py.

Decision: accept the 8 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):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-adopt-mail-peer-v1-with-durable-bounded-evidence-recovery.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-adopt-mail-peer-v1-with-durable-bounded-evidence-recovery.md

### ⏸ SVD architect gate: dev/people-mind-mcp#47 adopt-mail-peer-v1-with-durable-bounded-evidence-recovery **Status:** CLEAN after 1 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity `substrate` · dispatch effort `high` **Run:** `20261103T194658Z-c6a5ac02` **Held because:** CLEAN but 8 open risk(s) (2 verification · 6 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Re-slice approval. This spec is the 16-file People consumer core, with the durable pass placed in sync.py (not a new mailsync.py) to stay at the ceiling. Deferred: the contract status line, vendoring schema/fixtures, the overlay protocol comment, packaged I01, and I02. Approve this slice and the 'Mail peer v1 pair acceptance and contract vendoring' follow-up, or split further (for example migration plus wire client first)? [decision] 2. I01 on the packaged #45 consumer and #148 Mail baseline cannot run in Half A. After merge: run make image plus a Mail image containing PR #169, pair them over direct MCP, and podman kill Mail during mail_peer_evidence_v1. Record that the sync line ends mailmind-unavailable within request_timeout_seconds, that the next pass resumes from the stored cursor, and that people_find keeps answering. [verification] 3. I02 is unmapped: which budgets are pre-declared (p50/p95/p99 for people_find and /healthz, throughput, peak queue bytes, RSS), and on which packaged pair? [decision] 4. The default protocol mail-people/1.0 makes existing deployments fail explicitly with mailmind-version until Mail serves v1 or the operator sets legacy-text. Is the v1 default approved? [decision] 5. Snapshot activation is one set-based transaction proportional to the snapshot (capped by max_staged_records) and may enqueue more than max_pending_records. Accept this as the documented exception to per-transaction bounds, or require an active-generation flip with bounded GC batches? [decision] 6. C08 byte-level erasure: the forgotten Person's handle values may persist in SQLite free pages, WAL frames and Litestream replicas. Add secure_delete plus a post-Forget wal_checkpoint(TRUNCATE) in this slice, or treat it as an ADR 0003 follow-up? [decision] 7. Adjacent: in explicit legacy-text mode, the zlib checkpoint in source_state (sync.py:27-35) holds addresses that graph.forget does not purge (pre-existing). File a follow-up? [decision] 8. The pinned contract was read through a summarizing web fetch. Before encoding the models, dispatch must open schema.json and requests.schema.json at 21e279da byte-exact, check every quoted bound, and report any mismatch as a deviation. [verification] **Change:** Add a v1 wire client in new sources/mailpeer.py, mirroring MailmindSource._fetch (mailmind.py:163-266: one Client per pass, the #45 timeout, _Pacer, _retry_delay, sanitized excepts), and read only structured_content. The durable bounded pass now lives in sync.py as _run_peer_pass, dispatched from run_pass:38. That frees the ceiling slot for tests/test_identity.py:445. Migration 6 adds new tables only, mirroring store.py:91-95. Page commit, snapshot activation and per-address evidence units each run in one transaction. Source-specific retraction uses two per-(source,address) SQL constants. RETRACT_UNSUPPORTED deletes interactions whose (entity, direction, at) is no longer in mail_support. It runs at page commit for every affected address (del, add-revision narrowing, direction/at change) and again in each evidence unit. RESTORE_SUPPORTED re-inserts from mail_support after ingest_record, because ingest_record's rec_hash 'unchanged' shortcut (graph.py:267-268) skips the INSERT OR IGNORE at :339-342. Forget purges the mail_* rows. views exposes applied freshness. **Files:** `src/people_mind_mcp/config.py` · `src/people_mind_mcp/store.py` · `src/people_mind_mcp/sources/mailpeer.py` · `src/people_mind_mcp/sources/__init__.py` · `src/people_mind_mcp/sync.py` · `src/people_mind_mcp/graph.py` · `src/people_mind_mcp/views.py` · `src/people_mind_mcp/server.py` · `README.md` · `tests/test_mailpeer.py` · `tests/test_mailmind.py` · `tests/test_server.py` · `tests/test_config_cli.py` · `tests/test_embed.py` · `tests/test_deploy.py` · `tests/test_identity.py` **Write-set divergence:** present table wins. structured return named src/people_mind_mcp/config.py, src/people_mind_mcp/store.py, src/people_mind_mcp/sources/mailpeer.py, src/people_mind_mcp/sources/__init__.py, src/people_mind_mcp/sync.py, src/people_mind_mcp/graph.py, src/people_mind_mcp/views.py, src/people_mind_mcp/server.py, README.md, tests/test_mailpeer.py, tests/test_mailmind.py, tests/test_server.py, tests/test_config_cli.py, tests/test_embed.py, tests/test_deploy.py, tests/test_identity.py, src/people_mind_mcp/mailsync.py; table names src/people_mind_mcp/config.py, src/people_mind_mcp/store.py, src/people_mind_mcp/sources/mailpeer.py, src/people_mind_mcp/sources/__init__.py, src/people_mind_mcp/sync.py, src/people_mind_mcp/graph.py, src/people_mind_mcp/views.py, src/people_mind_mcp/server.py, README.md, tests/test_mailpeer.py, tests/test_mailmind.py, tests/test_server.py, tests/test_config_cli.py, tests/test_embed.py, tests/test_deploy.py, tests/test_identity.py. **Decision:** accept the 8 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`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-adopt-mail-peer-v1-with-durable-bounded-evidence-recovery.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-adopt-mail-peer-v1-with-durable-bounded-evidence-recovery.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/people-mind-mcp#47 adopt-mail-peer-v1-with-durable-bounded-evidence-recovery completed integration verify.

  • PR: #51
  • Branch: feat/svd-dev-people-mind-mcp-47-adopt-mail-peer-v1-with-durab-0f16dd63
  • Commit: 82c9404ebd
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/73/pipeline/15/1
  • Checks: PR #51 head 82c9404: Woodpecker ci/woodpecker/pr/validation green. Local: 69 mailpeer tests, 264 regression (2 skipped) and 371 non-integration (5 skipped) all pass. No blockers.
  • Warning: Deferred as approved: packaged-pair I01 acceptance, I02 soak (unmapped; Open Risk 3 names it), contract vendoring, physical erasure. The follow-up issue 'Mail peer v1 pair acceptance and contract vendoring' must be filed before merge, because the PR closes #47.
  • Warning: tests/test_deploy.py is integration-only and was not run here (4 deselected). Subagent reports container integration passed.
  • Warning: The system python3 lacks phonenumbers; tests ran under uv run.
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261103T202208Z-0f16dd63 --confirm-merge)
spec-verify-dispatch Half B for dev/people-mind-mcp#47 adopt-mail-peer-v1-with-durable-bounded-evidence-recovery completed integration verify. - PR: https://git.groupthink.asia/dev/people-mind-mcp/pulls/51 - Branch: feat/svd-dev-people-mind-mcp-47-adopt-mail-peer-v1-with-durab-0f16dd63 - Commit: 82c9404ebdb700b73e44693d5baa2404ffe3536f - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/73/pipeline/15/1 - Checks: PR #51 head 82c9404: Woodpecker ci/woodpecker/pr/validation green. Local: 69 mailpeer tests, 264 regression (2 skipped) and 371 non-integration (5 skipped) all pass. No blockers. - Warning: Deferred as approved: packaged-pair I01 acceptance, I02 soak (unmapped; Open Risk 3 names it), contract vendoring, physical erasure. The follow-up issue 'Mail peer v1 pair acceptance and contract vendoring' must be filed before merge, because the PR closes #47. - Warning: tests/test_deploy.py is integration-only and was not run here (4 deselected). Subagent reports container integration passed. - Warning: The system python3 lacks phonenumbers; tests ran under uv run. - Decision: review the PR and merge? (`codex-svd ship --run-id 20261103T202208Z-0f16dd63 --confirm-merge`)
svc-svd-writer 2026-11-03 20:56:28 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/people-mind-mcp#47
No description provided.