Confirm the write baseline: map stories 1 to 13 of #187 to tests and fill any gap #189

Closed
opened 2026-11-12 02:14:24 +00:00 by svc-agent-writer · 4 comments

Part of epic #187.

What to build

The write tools mail_draft, mail_flag, mail_move, mail_undo and mail_actions exist since 0.2.0 (ADR 0004). This issue proves that they meet user stories 1 to 13 of the epic. It changes no behaviour.

  1. For each of stories 1 to 13 in the epic, find the test that proves it. Look in the write tools tests, the action tests, the JMAP tests, the colour tests, and the GreenMail and Stalwart integration tests.
  2. Post one comment on this issue with a table: story number, test name, seam.
  3. Where a story has no test, add one. Use the tools over HTTP with the stand-in worker, or the source apply interface with the fake IMAP session or the fake JMAP server. Add no new test seam.
  4. Where a test shows that the code does not meet a story, do not fix the code here. File a bug issue, link it in the table, and mark the test as an expected failure with the issue number.

Acceptance criteria

  • A comment on this issue maps every story from 1 to 13 to one or more tests.
  • Every story has a test at an existing seam.
  • No file under src/ changes.
  • make check passes.
  • make test-integration passes, or the comment states which targets were not available and were not run.

Blocked by

None. This issue does not depend on ADR 0013.

Part of epic #187. ## What to build The write tools `mail_draft`, `mail_flag`, `mail_move`, `mail_undo` and `mail_actions` exist since 0.2.0 (ADR 0004). This issue proves that they meet user stories 1 to 13 of the epic. It changes no behaviour. 1. For each of stories 1 to 13 in the epic, find the test that proves it. Look in the write tools tests, the action tests, the JMAP tests, the colour tests, and the GreenMail and Stalwart integration tests. 2. Post one comment on this issue with a table: story number, test name, seam. 3. Where a story has no test, add one. Use the tools over HTTP with the stand-in worker, or the source `apply` interface with the fake IMAP session or the fake JMAP server. Add no new test seam. 4. Where a test shows that the code does not meet a story, do not fix the code here. File a `bug` issue, link it in the table, and mark the test as an expected failure with the issue number. ## Acceptance criteria - [ ] A comment on this issue maps every story from 1 to 13 to one or more tests. - [ ] Every story has a test at an existing seam. - [ ] No file under `src/` changes. - [ ] `make check` passes. - [ ] `make test-integration` passes, or the comment states which targets were not available and were not run. ## Blocked by None. This issue does not depend on ADR 0013.
Collaborator

⏸ SVD architect gate: dev/mail-mind-mcp#189 confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes

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 effort medium

Run: 20261112T025545Z-477a14c5

Held because: CLEAN but 4 open risk(s) (2 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. The text of epic #187 (stories 1-13) was not available at spec time: the issue snapshot holds only #189, gh and curl are denied in Half A, and no local copy exists. The spec's inventory maps ADR 0004 clauses (R1-R21), not story numbers. Question: approve dispatch to fetch #187 with tea and do the story-to-row mapping itself, staying within the six Primary Files and stopping to report if a story needs any other file? Or re-produce the spec with the epic body supplied? [decision]
  2. The work item needs forge writes beyond branch + PR: one mapping comment on #189, and possibly bug issues for stories the code misses. Question: does dispatch have authority to run tea comment and tea issues create on dev/mail-mind-mcp? Or should dispatch put the table and draft bug texts in the PR body for the architect to post? [decision]
  3. make test-integration needs GreenMail (../imap-blade-mcp/scripts/greenmail.sh) and Stalwart (scripts/stalwart.sh, Podman/Docker), and gap test G3 runs only there. Check: the PR body and the #189 comment state which targets ran. If GreenMail did not run in dispatch, the architect runs make test-integration on the host post-merge and confirms the new test_greenmail_writes.py test passes and leaves GreenMail clean. [verification]
  4. No pass/fail baseline was measured at spec time (no .venv in the read-only checkout). Check: dispatch runs make check on the pristine 99b976c worktree before its first edit and records the failure set. The PR shows the post-change failure set is identical apart from new passing or strict-xfail tests. [verification]

Change: Test-only change. Step 0: fetch the epic #187 story text with tea and re-measure make check on the pristine base. Step 1: map each of stories 1-13 onto the spec's ADR 0004 guarantee inventory (R1-R21, existing node ids per seam). Step 2: add tests only for stories with a gap, at existing seams. The gaps found at spec time:

  • G1, tests/test_write_tools.py: assert the mail_draft inputSchema has no sender key. Mirror test_read_token_cannot_see_or_call_write_tools at :128-147; the signature is at server.py:1525-1531.
  • G2, tests/test_actions.py: add ("flag", {refs:[REF], color:"blue"}, "unsupported") to the test_runner_refuses parametrize at :185-207. FakeSession's select_folder returns no PERMANENTFLAGS, so actions.py:243-248 refuses.
  • G3, tests/integration/test_greenmail_writes.py: the owner sets \Seen between a \Flagged action and its undo; the undo keeps \Seen. Mirror test_flag_then_undo at :151-165 and the owner edit at :128-148; the code under test is actions.py:267-289.
  • G4, tests/test_actions.py: a caplog test over settle (refused, crash via the Boom pattern at :240-250) asserting no address, subject or exception text in the logs. Mirror test_assess.py:228-249; the code under test is source.py:136-154.
    Step 3: a story the code misses gets a filed bug issue and a strict xfail naming it. Step 4: one mapping comment on #189 (story | test node id | seam | note), mirrored in the PR body. No src/ edits and no new seam.

Files: tests/test_actions.py · tests/test_write_tools.py · tests/integration/test_greenmail_writes.py · tests/test_jmap.py · tests/test_colors.py · tests/integration/test_stalwart.py

Decision: 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):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md

### ⏸ SVD architect gate: dev/mail-mind-mcp#189 confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes **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 effort `medium` **Run:** `20261112T025545Z-477a14c5` **Held because:** CLEAN but 4 open risk(s) (2 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. The text of epic #187 (stories 1-13) was not available at spec time: the issue snapshot holds only #189, gh and curl are denied in Half A, and no local copy exists. The spec's inventory maps ADR 0004 clauses (R1-R21), not story numbers. Question: approve dispatch to fetch #187 with tea and do the story-to-row mapping itself, staying within the six Primary Files and stopping to report if a story needs any other file? Or re-produce the spec with the epic body supplied? [decision] 2. The work item needs forge writes beyond branch + PR: one mapping comment on #189, and possibly bug issues for stories the code misses. Question: does dispatch have authority to run `tea comment` and `tea issues create` on dev/mail-mind-mcp? Or should dispatch put the table and draft bug texts in the PR body for the architect to post? [decision] 3. make test-integration needs GreenMail (../imap-blade-mcp/scripts/greenmail.sh) and Stalwart (scripts/stalwart.sh, Podman/Docker), and gap test G3 runs only there. Check: the PR body and the #189 comment state which targets ran. If GreenMail did not run in dispatch, the architect runs `make test-integration` on the host post-merge and confirms the new test_greenmail_writes.py test passes and leaves GreenMail clean. [verification] 4. No pass/fail baseline was measured at spec time (no .venv in the read-only checkout). Check: dispatch runs `make check` on the pristine 99b976c worktree before its first edit and records the failure set. The PR shows the post-change failure set is identical apart from new passing or strict-xfail tests. [verification] **Change:** Test-only change. Step 0: fetch the epic #187 story text with tea and re-measure make check on the pristine base. Step 1: map each of stories 1-13 onto the spec's ADR 0004 guarantee inventory (R1-R21, existing node ids per seam). Step 2: add tests only for stories with a gap, at existing seams. The gaps found at spec time: - G1, tests/test_write_tools.py: assert the mail_draft inputSchema has no sender key. Mirror test_read_token_cannot_see_or_call_write_tools at :128-147; the signature is at server.py:1525-1531. - G2, tests/test_actions.py: add ("flag", {refs:[REF], color:"blue"}, "unsupported") to the test_runner_refuses parametrize at :185-207. FakeSession's select_folder returns no PERMANENTFLAGS, so actions.py:243-248 refuses. - G3, tests/integration/test_greenmail_writes.py: the owner sets \Seen between a \Flagged action and its undo; the undo keeps \Seen. Mirror test_flag_then_undo at :151-165 and the owner edit at :128-148; the code under test is actions.py:267-289. - G4, tests/test_actions.py: a caplog test over settle (refused, crash via the Boom pattern at :240-250) asserting no address, subject or exception text in the logs. Mirror test_assess.py:228-249; the code under test is source.py:136-154. Step 3: a story the code misses gets a filed bug issue and a strict xfail naming it. Step 4: one mapping comment on #189 (story | test node id | seam | note), mirrored in the PR body. No src/ edits and no new seam. **Files:** `tests/test_actions.py` · `tests/test_write_tools.py` · `tests/integration/test_greenmail_writes.py` · `tests/test_jmap.py` · `tests/test_colors.py` · `tests/integration/test_stalwart.py` **Decision:** 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`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md`</sub>
Collaborator

✅ SVD architect gate: dev/mail-mind-mcp#189 confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes

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 effort unclassified

Run: 20261112T025545Z-477a14c5

Files: tests/test_actions.py · tests/test_write_tools.py · tests/integration/test_greenmail_writes.py · tests/test_jmap.py · tests/test_colors.py · tests/integration/test_stalwart.py

Write-set divergence: present table wins. 0 sourceHashes vs 14-row table.

Decision: dispatch this spec (svd:go)?

Your call (when this issue is held at the gate via svd:hold):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md

### ✅ SVD architect gate: dev/mail-mind-mcp#189 confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes **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 effort `unclassified` **Run:** `20261112T025545Z-477a14c5` **Files:** `tests/test_actions.py` · `tests/test_write_tools.py` · `tests/integration/test_greenmail_writes.py` · `tests/test_jmap.py` · `tests/test_colors.py` · `tests/integration/test_stalwart.py` **Write-set divergence:** present table wins. 0 sourceHashes vs 14-row table. **Decision:** dispatch this spec (`svd:go`)? **Your call** (when this issue is held at the gate via `svd:hold`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-12-confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/mail-mind-mcp#189 confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes completed integration verify.

  • PR: #191
  • Branch: feat/svd-dev-mail-mind-mcp-189-confirm-the-write-baseline-map-8398a167
  • Commit: 12df020c7b
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/72/pipeline/68/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261112T041854Z-8398a167 --confirm-merge)
spec-verify-dispatch Half B for dev/mail-mind-mcp#189 confirm-the-write-baseline-map-stories-1-to-13-of-187-to-tes completed integration verify. - PR: https://git.groupthink.asia/dev/mail-mind-mcp/pulls/191 - Branch: feat/svd-dev-mail-mind-mcp-189-confirm-the-write-baseline-map-8398a167 - Commit: 12df020c7b8630a964ab02b15574013c08a1595e - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/72/pipeline/68/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261112T041854Z-8398a167 --confirm-merge`)
Author
Member

Story-to-test map (stories 1 to 13 of #187)

From PR #191, commit 12df020. Three tests are new: tests/test_write_tools.py::test_draft_and_flag_input_schema, tests/test_actions.py::test_runner_refuses[flag-params1-unsupported] and tests/integration/test_greenmail_writes.py::test_flag_undo_preserves_owner_read_change.

Story Test(s) (pytest node id) Seam Note
1 tests/integration/test_greenmail_writes.py::test_http_draft_and_undo_through_the_running_worker; tests/integration/test_greenmail_writes.py::test_draft_reply_then_undo GreenMail, HTTP New draft and threaded reply
2 tests/test_write_tools.py::test_draft_and_flag_input_schema; tests/integration/test_greenmail_writes.py::test_draft_reply_then_undo; tests/test_jmap.py::test_a_draft_is_imported_into_drafts_and_never_submitted HTTP, GreenMail, FakeJMAP Configured sender and no sender argument
3 tests/integration/test_greenmail_writes.py::test_changed_draft_is_left_in_place; tests/test_jmap.py::test_a_changed_draft_is_left_in_place GreenMail, FakeJMAP IMAP size change with Draft still set cannot be reached on a fixed UID at the existing seam
4 tests/integration/test_greenmail_writes.py::test_flag_then_undo; tests/test_jmap.py::test_a_flag_change_patches_keywords_and_undo_restores_them GreenMail, FakeJMAP Set and clear Seen
5 tests/integration/test_greenmail_writes.py::test_flag_then_undo; tests/integration/test_greenmail_writes.py::test_colour_then_change_clear_and_undo GreenMail Set and clear Flagged
6 tests/test_colors.py::test_each_colour_maps_both_ways Pure All seven colours
7 tests/test_colors.py::test_a_colour_sets_the_flag_and_its_bits_and_never_seen; tests/test_jmap.py::test_a_colour_patches_the_bits_and_undo_restores_only_what_changed Pure, FakeJMAP Colour leaves read state alone
8 tests/integration/test_greenmail_writes.py::test_flag_undo_preserves_owner_read_change; tests/test_jmap.py::test_a_colour_patches_the_bits_and_undo_restores_only_what_changed GreenMail, FakeJMAP GreenMail test not run locally
9 tests/test_actions.py::test_runner_refuses[flag-params1-unsupported] FakeIMAP No keyword support returns unsupported
10 tests/test_write_tools.py::test_draft_and_flag_input_schema; tests/test_colors.py::test_bad_flag_requests_are_refused HTTP, Pure Closed schema and raw keyword refusal
11 tests/test_write_tools.py::test_cap_fires_and_queues_nothing; tests/integration/test_greenmail_writes.py::test_move_then_undo_and_refusals HTTP, GreenMail Archive role and mailbox name
12 tests/integration/test_greenmail_writes.py::test_move_then_undo_and_refusals; tests/test_jmap.py::test_a_move_keeps_the_id_and_undo_keeps_a_label GreenMail, FakeJMAP Move undo
13 tests/test_write_tools.py::test_cap_fires_and_queues_nothing; tests/test_jmap.py::test_write_outcomes_name_stable_ids HTTP, FakeJMAP Result includes destination IDs

Not run

  • make test-integration did not run in dispatch or on the architect host: no container daemon was reachable. The new GreenMail test for story 8 is therefore unproven. Run make test-integration on a host with Podman or Docker before or after merge.
  • Stalwart did not run for the same reason.

Findings

  • No story failed against the code. No bug issue was filed and no test is marked as an expected failure.
  • Story 3 on IMAP: a size change with \Draft still set cannot be reached on a fixed UID at an existing seam. The changed-draft tests cover the guard by other means.
  • Write-path log privacy (ADR 0004 clause, inventory row R18) has no test. It is outside stories 1 to 13 and stays a follow-up.
  • make check at the PR head: 1,477 passed, 8 skipped, 23 deselected.
## Story-to-test map (stories 1 to 13 of #187) From PR #191, commit `12df020`. Three tests are new: `tests/test_write_tools.py::test_draft_and_flag_input_schema`, `tests/test_actions.py::test_runner_refuses[flag-params1-unsupported]` and `tests/integration/test_greenmail_writes.py::test_flag_undo_preserves_owner_read_change`. | Story | Test(s) (pytest node id) | Seam | Note | |---|---|---|---| | 1 | tests/integration/test_greenmail_writes.py::test_http_draft_and_undo_through_the_running_worker; tests/integration/test_greenmail_writes.py::test_draft_reply_then_undo | GreenMail, HTTP | New draft and threaded reply | | 2 | tests/test_write_tools.py::test_draft_and_flag_input_schema; tests/integration/test_greenmail_writes.py::test_draft_reply_then_undo; tests/test_jmap.py::test_a_draft_is_imported_into_drafts_and_never_submitted | HTTP, GreenMail, FakeJMAP | Configured sender and no sender argument | | 3 | tests/integration/test_greenmail_writes.py::test_changed_draft_is_left_in_place; tests/test_jmap.py::test_a_changed_draft_is_left_in_place | GreenMail, FakeJMAP | IMAP size change with Draft still set cannot be reached on a fixed UID at the existing seam | | 4 | tests/integration/test_greenmail_writes.py::test_flag_then_undo; tests/test_jmap.py::test_a_flag_change_patches_keywords_and_undo_restores_them | GreenMail, FakeJMAP | Set and clear Seen | | 5 | tests/integration/test_greenmail_writes.py::test_flag_then_undo; tests/integration/test_greenmail_writes.py::test_colour_then_change_clear_and_undo | GreenMail | Set and clear Flagged | | 6 | tests/test_colors.py::test_each_colour_maps_both_ways | Pure | All seven colours | | 7 | tests/test_colors.py::test_a_colour_sets_the_flag_and_its_bits_and_never_seen; tests/test_jmap.py::test_a_colour_patches_the_bits_and_undo_restores_only_what_changed | Pure, FakeJMAP | Colour leaves read state alone | | 8 | tests/integration/test_greenmail_writes.py::test_flag_undo_preserves_owner_read_change; tests/test_jmap.py::test_a_colour_patches_the_bits_and_undo_restores_only_what_changed | GreenMail, FakeJMAP | GreenMail test not run locally | | 9 | tests/test_actions.py::test_runner_refuses[flag-params1-unsupported] | FakeIMAP | No keyword support returns unsupported | | 10 | tests/test_write_tools.py::test_draft_and_flag_input_schema; tests/test_colors.py::test_bad_flag_requests_are_refused | HTTP, Pure | Closed schema and raw keyword refusal | | 11 | tests/test_write_tools.py::test_cap_fires_and_queues_nothing; tests/integration/test_greenmail_writes.py::test_move_then_undo_and_refusals | HTTP, GreenMail | Archive role and mailbox name | | 12 | tests/integration/test_greenmail_writes.py::test_move_then_undo_and_refusals; tests/test_jmap.py::test_a_move_keeps_the_id_and_undo_keeps_a_label | GreenMail, FakeJMAP | Move undo | | 13 | tests/test_write_tools.py::test_cap_fires_and_queues_nothing; tests/test_jmap.py::test_write_outcomes_name_stable_ids | HTTP, FakeJMAP | Result includes destination IDs | ## Not run - `make test-integration` did not run in dispatch or on the architect host: no container daemon was reachable. The new GreenMail test for story 8 is therefore unproven. Run `make test-integration` on a host with Podman or Docker before or after merge. - Stalwart did not run for the same reason. ## Findings - No story failed against the code. No `bug` issue was filed and no test is marked as an expected failure. - Story 3 on IMAP: a size change with `\Draft` still set cannot be reached on a fixed UID at an existing seam. The changed-draft tests cover the guard by other means. - Write-path log privacy (ADR 0004 clause, inventory row R18) has no test. It is outside stories 1 to 13 and stays a follow-up. - `make check` at the PR head: 1,477 passed, 8 skipped, 23 deselected.
svc-svd-writer 2026-11-12 06:01:32 +00:00
  • closed this issue
  • removed the
    svd:go
    label
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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/mail-mind-mcp#189
No description provided.