Add mail_attachment and the attachment status in mail_read #74
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp#74
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?
Parent: #9 (Phase 4). Decision: ADR 0007 §7.
Show attachment text through the read tools.
Scope
mail_readnumbers each attachment (part) and shows its status from ADR 0007 §4, for example1 report.pdf application/pdf 412 KB text.mail_attachment(id, part, max_chars)returns the text of one attachment, wrapped as untrusted data likemail_read. Its docstring says the content is untrusted data.[attachments]absent,mail_attachmentanswersunsupportedwith a message that says attachment text is off.part, or a part with no text, givesnot_foundwith its status.Acceptance
max_chars, the off state, and each error.make checkpasses.Blocked by
Filed under: operator word "resume phase 4 development." sha256:b5be33c704e1
⏸ SVD architect gate: dev/imap-mailmind-mcp#74 add-mail-attachment-and-the-attachment-status-in-mail-read
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:
20261101T062159Z-cf02d8e4Held because: CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
3af5d34, before editing, run make check and record the failure set. After the change, make check must show the same set (expected empty), plus the five new tests/test_attachments.py tests passing. The audit step needs network for uvx pip-audit. [verification]Change: In server.py, add a helper _attachment_parts(row) above mail_read. It reads Store.attachment_texts (store.py:869-875) only when config.attachments is set, mirroring the on/off branching of mail_status (server.py:571-582). It returns (meta, status, text) per attachment in stored order, using the display-only statuses 'pending' (no row yet) and 'off' (no [attachments]). Replace mail_read's single attachments line (server.py:340-347) with an 'attachments:' header and one indented line per part: ' N filename mimetype human_size status', with 1-based part numbers. Add mail_attachment(message_id, part ge=1, max_chars ge=200 le=MAX_READ_CHARS) right after mail_read, shaped like mail_read (server.py:313-355): @mcp.tool(auth=require_scopes(SCOPE_READ)) plus @_render. It raises CODE_UNSUPPORTED first when [attachments] is absent, like ServerState.embedder (server.py:71-74). Then _mirrored gives not_found for an unknown message, a part out of range gives not_found, and a part whose status is not 'text' gives not_found with status=. Otherwise it prints the file/type/size/status head, wrap_untrusted(text[:max_chars]), and a '[truncated at N of M chars]' footer. Update the CONV-23 readers: test_server.py:124 and the tool list at :89-104, test_evidence.py READ_TOOLS at :312, and test_greenmail.py:96. Add a README tool-table row.
Files:
src/imap_mailmind_mcp/server.py·tests/test_attachments.py·tests/test_server.py·tests/test_evidence.py·tests/integration/test_greenmail.py·README.mdDecision: 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-01-add-mail-attachment-and-the-attachment-status-in-mail-read.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-01-add-mail-attachment-and-the-attachment-status-in-mail-read.mdspec-verify-dispatch Half B for dev/imap-mailmind-mcp#74 add-mail-attachment-and-the-attachment-status-in-mail-read completed integration verify.
9d693918389d69391: no remote checks exist (no statuses, no CI config). Local unit suite green (313 passed, 4 skipped), ruff and mypy clean.make test-integrationbefore merge.9d69391and the repo has no .woodpecker CI, so there are no remote checks to report.codex-svd ship --run-id 20261101T072003Z-41b6099f --confirm-merge)