Mail peer pass reports a local store error as mailmind-unavailable and drops the sync_log row #87
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/people-mind-mcp#87
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?
What happens
A local store error during a Mail peer pass is reported as
mailmind-unavailable. When the store also refuses thesync_logwrite, the pass leaves nosync_logrow, and nothing records that the write failed.Seen live on rc.9, 2026-11-04 (
peoplemind-piers):mail_peer_evidence_v1call,outcome: ok.source=mail kind=mailmind status=error code=mailmind-unavailable.copy_file_range: no space left on device. The 1Gi data volume was full (starbase/iac#339 grows it).sync_loghas no row for this pass. The last mail row is id 545 (mailmind-rebuild, 14:02:56Z).Mail Mind was up. The fault was the local disk, and the log named the wrong component.
Cause
_peer_passinsrc/people_mind_mcp/sync.py(lines 667–676):SourceError, includingsqlite3.Errorfrom a store write in_mail_drain, becomesmailmind-unavailable.sync_logwrite is dropped silently.The worker loop already maps
sqlite3.ErrorandStoreErrortostore-unavailable(sync.py:740), and the embed worker does the same (sync.py:758). The Mail peer pass hides those errors from the loop by turning them into aSourceErrorfirst.What to change
_peer_pass, recordsqlite3.ErrorandStoreErrorasstore-unavailable(or theStoreErrorcode), notmailmind-unavailable. Then re-raise them so the worker loop printscode=store-unavailable.mailmind-unavailablefor transport failures from the Mail client (sources/mailpeer.pyalready raisesSourceErrorfor those).sync_logfails, print one line,source=<name> kind=mailmind sync_log=lost code=<code>, in place ofpass.Acceptance
_mail_drainraisesqlite3.OperationalError("database or disk is full"). The pass raises an error whose code isstore-unavailable, and the worker output iscode=store-unavailable.sync_loginsert also fails asserts thesync_log=lostline and no other change in behaviour.mailmind-unavailable,mailmind-busyandmailmind-rebuildpass unchanged.Out of scope
sync.py:131–160) records non-SourceErrorfailures assync-failedand has the same silentexcept sqlite3.Error: pass. Leave it unchanged here.Filed under: operator word "yes, proceed" sha256:ddb61daa709f
⏸ SVD architect gate: dev/people-mind-mcp#87 mail-peer-pass-reports-a-local-store-error-as-mailmind-unava
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:
20261104T213742Z-bcf9022cHeld because: CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
peoplemind sync --onceprintstore=error code=store-unavailablefor a Mail store fault (the lean, via cli.main at cli.py:149-150, consistent with vCard/CardDAV store faults)? Or should cli._sync also catch StoreError and print the per-sourcesource=mail kind=mailmind status=error code=store-unavailableline? The second option adds cli.py to the written set. [decision]source=mail kind=mailmind status=error code=store-unavailableand either a sync_log row with error='store-unavailable' or async_log=lost code=store-unavailableline. If it still logs mailmind-unavailable, the fault came in as a non-store exception and needs a new issue. [verification]uv run python3 -m pytest tests/test_mailpeer.py -m "not integration"andmake checkon the pristine base. After the change, assert the failure set is unchanged apart from the three new passing tests. [verification]Change: Edit only the
except Exception as exc:block of_peer_passin src/people_mind_mcp/sync.py:667-676. Classifysqlite3.Error/StoreErrorfirst: code = StoreError.code, or "store-unavailable" for sqlite3.Error. Otherwise keep today's lines 668-670 unchanged: SourceError.code, else "mailmind-unavailable", with HTTP 401/403 giving "mailmind-auth". Replaceexcept sqlite3.Error: passaround the error-row INSERT_SYNC_LOG withprint(f"source={source.name} kind=mailmind sync_log=lost code={code}"). RaiseStoreError(code) from Nonefor store faults andSourceError(code) from Noneotherwise. This mirrors open_writer's wrap at store.py:177-182. The worker loop at sync.py:739-741 already printscode=<StoreError.code>, so it needs no change. Do not touch the CardDAV/vCard handler at sync.py:131-160 or cli.py.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-04-mail-peer-pass-reports-a-local-store-error-as-mailmind-unava.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-04-mail-peer-pass-reports-a-local-store-error-as-mailmind-unava.mdspec-verify-dispatch Half B for dev/people-mind-mcp#87 mail-peer-pass-reports-a-local-store-error-as-mailmind-unava completed integration verify.
82f83658facodex-svd ship --run-id 20261104T215151Z-847d81f4 --confirm-merge)