mailmind Source: one envelope address with whitespace fails the whole pass with mailmind-protocol #39
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#39
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?
Problem
On the gate instance (image 0.1.0-rc.3, people-mind-mcp
5e0a500) the first full mailmind pass runs paced at about 3.2 requests per second for 8 minutes, accepts about 1,500mail_changespages (cursor 150200), then fails withcode=mailmind-protocol.Traced in the sync container with a structure-only spy on
_call(no values printed): the failing page has 101 lines, a matching footer, 100addrows of 7 cells, everyseqnumeric, every address cell matchable, and exactly one normalised address handle that contains whitespace._addressesraisesSourceError("mailmind-protocol")for that one handle, so the whole pass fails and every later pass fails at the same page.One malformed envelope address in a 150,000-change mailbox should not stop the Source. The protocol check is for the shape mailmind promises (columns, footer, sequence order); a single address value that does not normalise is data quality, not protocol breakage.
Fix
In
src/people_mind_mcp/sources/mailmind.py:_addressesno longer raises on an unmatchable handle or a handle containing whitespace. It drops that handle and reports the count, so the caller can add it toself.unreadable.to/ccaddress is dropped, the others still count.unreadable=Nas the only trace. No address is logged.Keep the strict shape checks (cell count, numeric
seq, kinds, footer) unchanged.Acceptance
mail_changespage whose rows include one address with internal whitespace and one without an@; the pass completes,unreadablecounts 2, the other addresses on those rows produce interactions, and noSourceErroris raised.seq, and a footer mismatch.source=mail kind=mailmind status=ok(recorded on #10).Primary files
src/people_mind_mcp/sources/mailmind.py(_addressesand its call site in_fetch)tests/test_mailmind.pyBlocked by
None.
⏸ SVD architect gate: dev/people-mind-mcp#39 mailmind-source-one-envelope-address-with-whitespace-fails-t
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:
20261102T050617Z-0fca5b4bHeld because: CLEAN but 4 open risk(s) (2 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
len(sender) + from_dropped > 1keeps today's behaviour. The alternative treats it as data quality: drop the bad handle and keep the remaining sender. [decision]unreadablemeaning (envelope address handles dropped on accepted pages) in ADR 0004 or the README? ADR 0004 currently defines unreadable only for vCard and CardDAV. Lean: no. The issue names two files, and this would be a one-line docs follow-up. [decision]status=okis printed by no code path;grep -rn "status=" srcfinds only status=error and status=missing. After deploying the merged image, check that the sync container logs the run_pass success linesource=mail kind=mailmind seen=… unreadable=N fetched=…, that nosource=mail kind=mailmind status=errorline appears for the pass that crosses cursor 150200, and that the latest sync_log row for source 'mail' has error IS NULL and unreadable >= 1. [verification]uv run python3 -m pytest tests/test_mailmind.py -qon pristine base5e0a500. After the change, it must confirm the failure set is unchanged apart from the new and extended tests passing. [verification]Change: Change
_addresses(mailmind.py:95-101) to return(kept_handles, dropped_count). It keeps a handle only whenhandle.matchableis true and its value has no whitespace (today's predicate, negated), dedups the kept handles withdict.fromkeys, and no longer raises. In_fetch: setself.unreadable = 0at the start of the pass, mirroringCardDAVSource.fetchat carddav.py:240. Count drops per page in a localpage_unreadableand add it toself.unreadablejust beforecursor = footer[1](:218), so only accepted pages count. Change the single-sender check tolen(sender) + from_dropped > 1, so a two-handle From cell is still a protocol error. A dropped sender yields no interaction (targets = sender = ()). Leave every other shape check unchanged. Add no logger line: theunreadable=Nthat sync.py:92 already prints is the only trace. Tests mirrortest_mailmind_interactions_both_directions_and_idempotent(tests/test_mailmind.py:236-251) and extend the parametrize oftest_bad_change_rows_are_protocol_errorswith a non-numeric seq case and a two-handle From case.Files:
src/people_mind_mcp/sources/mailmind.py·tests/test_mailmind.pyDecision: accept the 4 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-02-mailmind-source-one-envelope-address-with-whitespace-fails-t.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mailmind-source-one-envelope-address-with-whitespace-fails-t.mdArchitect gate (Half-A CLEAN, run 20261102T050617Z-0fca5b4b). Spec approved with two rulings edited into the spec body and its tables (not only the Agent Adjustments section, per dev/stables#1842):
len(sender) > 1over the kept handles. A malformed From handle is dropped and counted like ato/cchandle, and the row proceeds with whatever sender remains. Two well-formed From handles staymailmind-protocol. Reason: this issue's own principle is that an address value that does not normalise is data quality, and dev/mail-mind-mcp#129 shows the formatter can emit a display name with a comma. Under the Half-A lean that row would kill the pass again.status=ok; no code prints that. The live evidence is therun_passsuccess line forsource=mail kind=mailmindand async_logrow witherror IS NULLandunreadable >= 1.5e0a500: 65 passed intests/test_mailmind.py, 175 across the four neighbour files.Riders in the spec: basetemp on every pytest command,
python3 -m pytest, no nested.git. Operator pastessvd:goto release Half-B.spec-verify-dispatch Half B for dev/people-mind-mcp#39 mailmind-source-one-envelope-address-with-whitespace-fails-t completed integration verify.
c611a19eb0c611a19: Forgejo returned an empty status list and the repo has no CI config. Local: 295 passed, 5 skipped; ruff and mypy clean.python3 -m pytest --collect-onlyfailed outside uv (No module named 'phonenumbers' in conftest); collection was proven withuv run python3 -m pytestinstead: 10 tests collected, covering all named spec tests.codex-svd ship --run-id 20261102T052121Z-42f87828 --confirm-merge)