Forward drafts: forward_id in mail_draft #194
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#194
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?
Part of epic #187. Implements ADR 0013 item 7.
Read
docs/adr/0013-trash-forward-and-draft-edits.mdand ADR 0004 first. ADR 0013 is the contract. If the code shows that a ruling cannot work, stop and report; do not change the ruling here.Standing rules: tools only queue to the outbox and never call a mail server. The sync worker applies each action through the existing source
applyinterface. Logs carry counts, roles and error codes only. Secrets are files. Add no new test seam: use the tools over HTTP with the stand-in worker, the sourceapplyinterface with the fake IMAP session or the fake JMAP server, and the GreenMail and Stalwart integration targets.What to build
mail_draftgains the argumentforward_id. It is exclusive withreply_to_id; both together isinvalid_argument. It implies the account, asreply_to_iddoes.Fwd:plus the original subject. Set neitherIn-Reply-TonorReferences.body_textof the mirror row. Do not read the raw message.drafts_per_day. Its undo is the existing draft undo.Acceptance criteria
forward_idqueues one draft action;forward_idwithreply_to_idis refused; an unknown id is refused as forreply_to_id.make checkpasses.Out of scope
Attachment bytes, HTML bodies, Bcc and any sending path.
Blocked by
⏸ SVD architect gate: dev/mail-mind-mcp#194 forward-drafts-forward-id-in-mail-draft
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
substrate· dispatch efforthighRun:
20261112T190657Z-a01807eaHeld because: CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
1481d94, before the first edit, runmake checkand record the failure set. After the change, the failure set must be unchanged, and the new tests in tests/test_actions.py, tests/test_write_tools.py and tests/test_jmap.py must pass. [verification]make checkalone does not prove it. Check:make test-integrationpasses tests/integration/test_greenmail_writes.py::test_draft_forward_then_undo, and the PR quotes the run. [verification]Change: Mirror the reply path one-for-one. In server.py mail_draft (:1535-1558), add forward_id. Check that it is exclusive with reply_to_id first (invalid_argument). Then load the original with _mirrored (not_found) and apply the same cross-account check as the reply branch at :1548-1553. Store params["forward"] = _ref(row): a ref only, never quoted text. Switch the early refusal at :1557 to compose_draft(sender, draft_from(params, None, forwarded)), swapping the Draft import for draft_from. In outbox.py, add a Forwarded Protocol (shaped like Original :44-52), forward_subject = literal "Fwd: " + subject (shaped like reply_subject :73-74), and forward_body. forward_body writes a separator plus From/Date/Subject/To lines and an optional "Attachments (n): names" line. Every line has CR and LF removed and is cut to 1,000 characters. Bounding against MAX_BODY_CHARS is exact: always reserve the marker line, refuse with CODE_LIMIT when caller body plus fixed material exceeds 200,000, and otherwise cut body_text and append FORWARD_CUT_MARKER. Extend draft_from(params, original, forward=None) to refuse both, and to leave a forward without threading headers. In actions._draft (:214-237) and jmap._draft (:900-927), load params["forward"] the same way the reply_to row is loaded (store.get_message / self._row) and pass it to draft_from. In server._action_detail (:1640-1647), add a " forward" marker. There is no schema, cap or undo change: a forward is kind "draft".
Files:
src/mail_mind_mcp/outbox.py·src/mail_mind_mcp/server.py·src/mail_mind_mcp/actions.py·src/mail_mind_mcp/jmap.py·tests/test_actions.py·tests/test_write_tools.py·tests/test_jmap.py·tests/integration/test_greenmail_writes.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-12-forward-drafts-forward-id-in-mail-draft.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-forward-drafts-forward-id-in-mail-draft.md✅ SVD architect gate: dev/mail-mind-mcp#194 forward-drafts-forward-id-in-mail-draft
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
unclassified· dispatch effortunclassifiedRun:
20261112T190657Z-a01807eaFiles:
src/mail_mind_mcp/outbox.py·src/mail_mind_mcp/server.py·src/mail_mind_mcp/actions.py·src/mail_mind_mcp/jmap.py·tests/test_actions.py·tests/test_write_tools.py·tests/test_jmap.py·tests/integration/test_greenmail_writes.pyWrite-set divergence: present table wins. 0 sourceHashes vs 16-row table.
Decision: dispatch this spec (
svd:go)?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-12-forward-drafts-forward-id-in-mail-draft.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-forward-drafts-forward-id-in-mail-draft.mdspec-verify-dispatch Half B for dev/mail-mind-mcp#194 forward-drafts-forward-id-in-mail-draft completed integration verify.
31d5dc75accodex-svd ship --run-id 20261112T192838Z-bce73e06 --confirm-merge)