mail_search: case-insensitive mailbox names, a role filter, and a warning for an unknown mailbox #112
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#112
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 #106 (item 7). Decided at triage 2026-11-02: an unknown mailbox name gives a warning line, not an error.
Agent Brief
Category: bug
Summary: mail_search matches mailbox names without regard to case, exposes role, and says when a name matches no mirrored mailbox
Current behavior:
The mailbox filter matches the stored name exactly, including the JMAP mailboxes list. The parameter description gives
INBOXas its example. On a JMAP account the inbox is namedInbox, so the example returns no rows and no warning. The store already has arolefilter that mail_triage uses, but mail_search does not expose it.Desired behavior:
role(the closed list of mailbox roles the store knows: inbox, sent, drafts, archive, trash, junk, other, or whatever the store's set is).roleandmailboxmay be combined.mailboxmatches case-insensitively against stored names, with Unicode case folding.mailboxmatches no mirrored mailbox in the accounts searched, the result starts with one linewarning: no mailbox named <name>; mailboxes: <up to 10 names>, then the usual empty footer. The result is not an error.Key interfaces:
mail_searchsignature; the mailbox name lookup used for the warning reads the mailboxes table, never a mail server.Acceptance criteria:
mailbox="inbox"finds rows in a mailbox stored asInboxand in one stored asINBOX.role="inbox"finds inbox rows on an IMAP and a JMAP test account with no mailbox name given.mailbox="Nope"returns the warning line, lists existing mailbox names, and the normal footer withtotal=0.INBOXas the example.make checkpasses.Out of scope:
Filed under: operator word "accept" sha256:c125d0397b60
⏸ SVD architect gate: dev/mail-mind-mcp#112 mail-search-case-insensitive-mailbox-names-a-role-filter-and
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:
20261102T063839Z-4dc522acHeld because: CLEAN but 3 open risk(s) (2 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
Change: store.py:
_casefold(value)(str.casefold) and register it in_connect(store.py:2295-2302) withconn.create_function("casefold", 1, _casefold, deterministic=True).Store._filters(store.py:1517-1522):casefold(m.mailbox) = ? OR EXISTS(json_each ... casefold(j.value) = ?), with the argparams.mailbox.casefold(). Leave the role clause (1523-1530) unchanged.Store.mailbox_names(account), copying the WHERE and ORDER BY oflist_mailboxes(store.py:625-640) without the counts.server.py:
MailboxRole = Literal[inbox, archive, sent, drafts, trash, junk, all, flagged, important]next toFlagColor(server.py:68).roleparam tomail_searchand pass it into SearchParams (server.py:272)._parse_cursor, when the folded mailbox matches nomailbox_names(account), returnwarning: no mailbox named <sanitize_line(name)>; mailboxes: <first 10 distinct>plus_footer(offset, limit, 0).README.md: update the mail_search row at line 47.
tests: new tests/test_mailbox_search.py, mirroring the mirror fixture in tests/test_copies.py:63-83.
Files:
src/mail_mind_mcp/store.py·src/mail_mind_mcp/server.py·tests/test_mailbox_search.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-02-mail-search-case-insensitive-mailbox-names-a-role-filter-and.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-mail-search-case-insensitive-mailbox-names-a-role-filter-and.mdspec-verify-dispatch Half B for dev/mail-mind-mcp#112 mail-search-case-insensitive-mailbox-names-a-role-filter-and completed integration verify.
d1d42312f7d1d4231: no commit statuses (no CI in repo), so no required remote check exists. Local: 820 passed, 8 skipped; ruff and mypy clean.d1d4231; repo has no CI (CLAUDE.md: architect adds CI files), no tracking pointer. — reported as absent, not blocking (gh#633)codex-svd ship --run-id 20261102T070604Z-8341a28e --confirm-merge)