mailmind Source: a failure late in the evidence phase repeats every mail_evidence call on the next pass #48

Closed
opened 2026-11-03 00:21:30 +00:00 by svc-agent-writer · 1 comment

This was generated by AI during triage.

Problem

A mailmind pass keeps the results of the mail_evidence phase only in memory. When the pass fails during that phase, the next pass repeats every evidence call from the start. Since #45 (PR #46), a Mail Mind restart fails the pass after request_timeout_seconds instead of hanging. A failure late in a large pass is now recoverable, but it is expensive.

At the rc.6 checkpoint (5,505 pending addresses), one repeat costs about 23 minutes of evidence calls at the default 4 req/s. A Mail Mind restart during every pass would stop the evidence phase from ever finishing.

This was fix step 3 in #45. The triage brief and the approved spec left it out of scope as open risk R1.

Triage Notes

What we've established so far:

  • MailmindSource._fetch checkpoints the mail_changes phase per page: cursor plus the pending map of addresses and interaction refs. The evidence phase writes nothing to state until the pass succeeds.
  • run_pass saves state only on a fetch failure or at pass end. Ingest is all-or-nothing: "Only fetch failures can checkpoint; ingest rollback must keep replayable state" (sync.py, run_pass).
  • Saving evidence results in the checkpoint conflicts with ADR 0003. §2 says the service never stores mail text, and signature lines are mail text. §8 says Forget removes everything about a person, and checkpoint state is outside Forget's reach.
  • Saving only the set of resolved addresses does not help by itself. The pass still needs each address's evidence (sent, signatures) to build its SourceRecord at pass end.

What we still need from you:

  • Which design should be pursued?
    • (a) Ingest resolved evidence records in batches during the pass, and drop their events from pending. This changes the all-or-nothing ingest contract of run_pass, so it needs an ADR 0004 amendment.
    • (b) Keep the pass atomic, and accept the repeat cost.
    • (c) Something else.
  • If (a): what batch size or time bound should trigger an intermediate ingest? And must a Forget that runs mid-pass also remove the person's events from pending?
  • #45: the timeout fix (closed by PR #46).
  • ADR 0003 §2 and §8; ADR 0004 (Sources and record stores).

Filed under: operator word "ok" sha256:2689367b205c

> *This was generated by AI during triage.* ## Problem A mailmind pass keeps the results of the `mail_evidence` phase only in memory. When the pass fails during that phase, the next pass repeats every evidence call from the start. Since #45 (PR #46), a Mail Mind restart fails the pass after `request_timeout_seconds` instead of hanging. A failure late in a large pass is now recoverable, but it is expensive. At the rc.6 checkpoint (5,505 pending addresses), one repeat costs about 23 minutes of evidence calls at the default 4 req/s. A Mail Mind restart during every pass would stop the evidence phase from ever finishing. This was fix step 3 in #45. The triage brief and the approved spec left it out of scope as open risk R1. ## Triage Notes **What we've established so far:** - `MailmindSource._fetch` checkpoints the `mail_changes` phase per page: `cursor` plus the `pending` map of addresses and interaction refs. The evidence phase writes nothing to `state` until the pass succeeds. - `run_pass` saves state only on a fetch failure or at pass end. Ingest is all-or-nothing: "Only fetch failures can checkpoint; ingest rollback must keep replayable state" (`sync.py`, `run_pass`). - Saving evidence results in the checkpoint conflicts with ADR 0003. §2 says the service never stores mail text, and signature lines are mail text. §8 says Forget removes everything about a person, and checkpoint state is outside Forget's reach. - Saving only the set of resolved addresses does not help by itself. The pass still needs each address's evidence (`sent`, `signatures`) to build its `SourceRecord` at pass end. **What we still need from you:** - Which design should be pursued? - **(a)** Ingest resolved evidence records in batches during the pass, and drop their events from `pending`. This changes the all-or-nothing ingest contract of `run_pass`, so it needs an ADR 0004 amendment. - **(b)** Keep the pass atomic, and accept the repeat cost. - **(c)** Something else. - If (a): what batch size or time bound should trigger an intermediate ingest? And must a Forget that runs mid-pass also remove the person's events from `pending`? ## Related - #45: the timeout fix (closed by PR #46). - ADR 0003 §2 and §8; ADR 0004 (Sources and record stores). Filed under: operator word "ok" sha256:2689367b205c
Author
Member

This was generated by AI during triage.

Duplicate of #47, which was filed at the same time and already covers this work under an approved decision (ADR 0009). It specifies bounded, durable evidence progress with reference-only checkpoints (ADR 0003) and serialized Forget. Closing in favour of #47.

> *This was generated by AI during triage.* Duplicate of #47, which was filed at the same time and already covers this work under an approved decision (ADR 0009). It specifies bounded, durable evidence progress with reference-only checkpoints (ADR 0003) and serialized Forget. Closing in favour of #47.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#48
No description provided.