Stop the evidence drain on the first mailmind-unavailable #53
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:fire
svd:go
svd:hold
svd:respec
svd:skip
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/people-mind-mcp#53
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
When Mail Mind is unreachable, a People sync pass ends after the first failed evidence request instead of trying every address in the batch.
Context
Found at the #49 grill (2026-11-04).
_mail_drain(src/people_mind_mcp/sync.py:440-512) catchesmailmind-unavailable, incrementsattemptsand continues with the next address. It raises only after the whole batch, which holds up topage_limitaddresses (default 100). With the defaults (request_timeout_seconds60,page_limit100), a Mail port that drops packets holds one sync pass for about 100 minutes. A refused connection ends it in about 22 s at the 4/s pacer.people_findkeeps answering, so this is a freshness defect, not an outage.README.md:117says a request over the timeout "fails the pass". The code does not do that today.This bug does not gate #49: ADR 0009 Amendment 1 makes the I01 deadline per request.
Scope
_mail_drain, on the firstmailmind-unavailable, record the attempt for that address and stop the batch; raise the failure after the transaction that records it.mailmind-busy: record the attempt and continue.tests/test_mailpeer.pythat queues more addresses than one, makes the first request fail as unavailable, and asserts that the pass ends after one request and that only that address'sattemptschanged.Acceptance criteria
tests/test_mailpeer.pytests pass unchanged.README.md:117is true as written.Filed under: operator word "accept/agree. yes. go" sha256:f76d6cac557a (#49 #50 grill)
⏸ SVD architect gate: dev/people-mind-mcp#53 stop-the-evidence-drain-on-the-first-mailmind-unavailable
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:
20261103T221217Z-d7f441f2Held because: CLEAN but 3 open risk(s) (1 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
511e7cebefore the first edit, runuv run python3 -m pytest tests/test_mailpeer.py -qand record the failure set. After the change it must be identical except the removed [unavailable] id and the two new passing ids. [verification]Change: In
_mail_drain(src/people_mind_mcp/sync.py:449-458), keep the existing busy/unavailable handler and itswith transaction(conn)attempts increment. After that block, addif exc.code == "mailmind-unavailable": raisebeforefailure = exc; continue. The attempt commits first, then the batch ends; busy still continues and raises at :510-511. In tests/test_mailpeer.py, addtest_unavailable_evidence_ends_the_pass_after_one_address, parametrized over [error, timeout]. Its setup mirrors the retry-exhaustion test (:420-454) and the timeout test (:1053-1073). It queues ADDRESS and OTHER and checks: the pass raises mailmind-unavailable; only ADDRESS is requested ([ADDRESS]*(MAX_RETRIES+1) in error mode, [ADDRESS] in timeout mode); pending attempts are [(ADDRESS,1),(OTHER,0)]; the cursor is "2" with applied_at None; and the recovery pass calls [OTHER, ADDRESS] and leaves nothing pending. Narrow the existing test's parametrization at :420 from ["busy","unavailable"] to ["busy"], because its unavailable case encodes the defect.Files:
src/people_mind_mcp/sync.py·tests/test_mailpeer.pyDecision: accept the 3 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-stop-the-evidence-drain-on-the-first-mailmind-unavailable.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-stop-the-evidence-drain-on-the-first-mailmind-unavailable.mdspec-verify-dispatch drift guard halted dev/people-mind-mcp#53 stop-the-evidence-drain-on-the-first-mailmind-unavailable before implementation.
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-stop-the-evidence-drain-on-the-first-mailmind-unavailable.mdbaseBranchOverride/allowNoHashesdeliberately?⏸ SVD architect gate: dev/people-mind-mcp#53 stop-the-evidence-drain-on-the-first-mailmind-unavailable
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:
20261103T230126Z-e173245cHeld because: CLEAN but 1 open risk(s) (1 verification) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
.venv/bin/python3 -m pytest tests/test_mailpeer.py -q -p no:cacheprovider). The Half-A sandbox refused again with 'Operation not permitted'.f4dd669did not touch tests/test_mailpeer.py. Check: on pristinef4dd669before the first edit, runuv run python3 -m pytest tests/test_mailpeer.py -qand record the failure set. After the change it must be identical, except that retry_exhaustion[unavailable] is removed and the two new test_unavailable_evidence_ends_the_pass_after_one_address ids pass. [verification]Change: In
_mail_drain(src/people_mind_mcp/sync.py:449-458), keep the existing busy/unavailable handler and itswith transaction(conn)attempts increment. Directly after that block, addif exc.code == "mailmind-unavailable": raise, then the existingfailure = exc; continue. The attempt commits first and then the batch ends. Busy still continues and raises at :510-511. Mirror the singleexc.codemembership-test shape at :450. In tests/test_mailpeer.py, addtest_unavailable_evidence_ends_the_pass_after_one_address, parametrized over ["error","timeout"]. Its setup mirrors :420-454 and :1053-1073. It queues ADDRESS and OTHER and asserts:Narrow the existing test's parametrization at :420 to ["busy"], as approved at the prior gate. This is the approved prior lean, re-derived at base
f4dd669, where the code is hash-identical.Files:
src/people_mind_mcp/sync.py·tests/test_mailpeer.pyDecision: accept the 1 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-stop-the-evidence-drain-on-the-first-mailmind-unavailable.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-03-stop-the-evidence-drain-on-the-first-mailmind-unavailable.mdspec-verify-dispatch Half B for dev/people-mind-mcp#53 stop-the-evidence-drain-on-the-first-mailmind-unavailable completed integration verify.
955e248083codex-svd ship --run-id 20261103T232309Z-de8f174b --confirm-merge)