Compact rows and mail_read: escaped cells, cleaned snippets, capped address lists #109
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#109
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 (items 3 and 5). Decided at triage 2026-11-02: snippets are cleaned at render; address cap default 5 with a numeric override. Scope cut 2026-11-02: the batch read moved to #133, and the tool annotations shipped with #116.
Agent Brief
Category: enhancement
Summary: Make rows and mail_read cheaper and exact: escaped cells, cleaned and sized snippets, capped address lists
Current behavior:
Search, thread, people and evidence rows are pipe-delimited. No cell escapes
|, so a subject that holds one adds a cell. The subject is cut at 120 characters and the snippet at 160 with no mark. The snippet is the stored source text with URLs, Markdown syntax and JSON-LD blocks left in. mail_read prints every to and cc address, which can run to thousands of characters for a short body.Desired behavior:
|inside a cell with a fixed substitute character, and a cell cut by a length cap ends with…. Search, thread, people, evidence, changes, triage and wake rows all follow this.fields(a closed list of cell names; default the current set) andsnippet_chars(0 to 400, default 160; 0 drops the snippet line). Rendering removes URLs, Markdown link and emphasis syntax and JSON-LD blocks from the snippet; the stored snippet and the FTS index are unchanged.max_addresses(1 to 200, default 5). Each of to and cc shows at most that many addresses, then(+M more). The same cap applies to every tool that prints an address list.Key interfaces:
mail_search,mail_readsignatures and the triage panel's calls into them.mail_evidencekeeps its closed field list (ADR 0008 §2); only cell escaping changes.Acceptance criteria:
a | brenders as one row with the same cell count as every other row.….snippet_chars=0returns rows with no snippet line;snippet_chars=40returns snippets of at most 40 characters ending with…when cut.see https://example.test/x and **bold** [link](u)renders without the URL, the asterisks and the link syntax, and a snippet holding a JSON-LD block renders without it.(+40 more)by default and all 45 withmax_addresses=45.make checkpasses.Out of scope:
server.pyTOOL_HINTS).Blocked by
_row_cellsinserver.py)Filed under: operator word "accept" sha256:c125d0397b60
Scope correction 2026-11-02: tool annotations are owned by #116, filed the same morning with the same values and a wording change. Drop the annotations bullet and its acceptance criterion from this brief; #116 lands them. Everything else here stands. Do not dispatch #109 in the same batch as #116: both edit every tool docstring in server.py.
Compact rows and mail_read: escaped cells, cleaned snippets, capped address lists, batch reads, tool annotationsto Compact rows and mail_read: escaped cells, cleaned snippets, capped address lists⏸ SVD architect gate: dev/mail-mind-mcp#109 compact-rows-and-mail-read-escaped-cells-cleaned-snippets-ca
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:
20261102T115216Z-7eac3f03Held because: CLEAN but 3 open risk(s) (1 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
e55db5373a, runmake checkon the host and record the failure set. After the change, assert the set is unchanged apart from tests/test_compact_rows.py passing. [verification]Change: Replace the bare slices in _row_cells (server.py:146-149) with one
_cell(text, cap)helper:|->¦, and a cut keeps cap-1 chars +…. Add a pure_clean_snippet, applied in order: JSON-LD script/brace blocks (an unclosed block is removed to the end), Markdown links/images -> text, bare and URLs, emphasis markers, then collapse whitespace. Extend_row_linekeyword-only with snippet_chars and fields, keeping thesnippet:keyword for tests/test_assess.py:309-314 and tests/test_copies.py:289. Fields are filtered in fixed ROW_FIELDS order after today's marks/class trim. mail_search getsfields: list[RowField] | None(an empty list is invalid_argument) andsnippet_chars0..400 (default 160), mirroring the max_chars Annotated/Field pattern at :466. Route the mailboxes (:240), changes envelope (:572, escape only, no cap per ADR 0008 §3), wakes (:625), people (:653), evidence subjects (:735) and actions mailbox (:1084,1087) cells through_cell; never the id cell. mail_read gets max_addresses 1..200 (default 5) via_address_entries(split on ', ', a piece without @ joins the next) and_address_line(+M more). README tool rows updated; panel.html untouched.Files:
src/mail_mind_mcp/server.py·README.md·tests/test_compact_rows.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-02-compact-rows-and-mail-read-escaped-cells-cleaned-snippets-ca.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-02-compact-rows-and-mail-read-escaped-cells-cleaned-snippets-ca.mdspec-verify-dispatch Half B for dev/mail-mind-mcp#109 compact-rows-and-mail-read-escaped-cells-cleaned-snippets-ca completed integration verify.
99788e106199788e1: absent99788e1(absent). Local: 888 passed, 8 skipped, ruff and mypy clean. Blocked on one missing spec-named test.de73d95shortened the description, and tests/test_server.py now passes (888 passed, 8 skipped).99788e1: The Forgejo statuses endpoint for99788e1returned an empty list. The repo has no CI files by convention (.woodpecker is added by the architect). No tracking pointer exists. — reported as absent, not blocking (gh#633)spec-verify-dispatch Half B for dev/mail-mind-mcp#109 compact-rows-and-mail-read-escaped-cells-cleaned-snippets-ca completed integration verify.
99788e106199788e1: absent99788e1matches the local HEAD. It is open and its body has Closes #109. No Forgejo commit statuses exist (absent), and there are no CI files in the repo. Local: 888 passed, 8 skipped, 18 deselected. Ruff and mypy --strict are clean.de73d95and99788e1shortened the description to fit the existing limit. The full unit suite now passes.make audit.99788e1: The Forgejo statuses endpoint returned [] for the PR head. The repo has no CI directories (.forgejo, .github, .woodpecker); CI files are added by the architect. — reported as absent, not blocking (gh#633)codex-svd ship --run-id 20261102T120317Z-dd0e8af0 --confirm-merge)