Read and index HTML-only mail bodies #230
No reviewers
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!230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/224-readable-html"
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?
Summary
mail_readacceptsbody=auto|plain|html_text. The read budget covers the fenced body and links. Evidence and assessment continue to use the ratified protected source paths.Evidence
Merge Danger
Door Schema v20 adds metadata to the mirror and updates selected text lazily. Restoring the pre-upgrade database restores pre-upgrade search and embeddings.
Blast radius The mail mirror, sync and read surfaces.
Refs #224
§19 security review · STOP
At head
a4a7c2595aaa594bb53f5993a5cb3c2db47aa674, a generated mail with a text anchor and a crafted inline-image alt label produces a forged closing marker inside the fenced link metadata. The alt value ends one bracket short of the closing marker, and the link formatter supplies that bracket after escaping the label. The Standards reviewer identified it, and a local synthetic reproducer confirmed the literal closing marker in the output. This can make the remaining destination appear outside the untrusted-content fence to a consumer that treats the first closing marker as the boundary.No live mailbox, reported itinerary or deployment was accessed. #224 is paused under the operator grant. This head is ineligible for merge. Proposed correction for operator approval is to escape the fully assembled link line before counting and rendering it, and add a synthetic regression for markers formed across the formatter boundary.
STOP on PR #230 at
e2dd2460228f587de9d453e628a7bbe54c5e495dIndependent Standards review failed with one open data-exposure finding. Generated HTML with an anchor spanning a quote cutoff produces a body containing only
Booking, while the returned link label also contains the quote marker and the discardedPrevious messagetext. The converter accumulates the entire label and tests only its starting line against the cutoff insrc/mail_mind_mcp/html_body.py:281–332. This bypasses the existing quote-trimming boundary described inSECURITY.md:20. The observed output stayed inside the read-scoped untrusted-content fence. No path to evidence, assessor fields or an external service was observed in this check.Independent Spec review also confirmed a functional finding on generated HTML. A nested table inside a booking cell can split the itinerary date from the flight, drop-off and status. The inner cell closes the outer cell state in
src/mail_mind_mcp/html_body.py:258–271.The approved fence regression passes for both markers on this exact head. These new findings leave the merge gate blocked under authorization comment 46198. The branch and issue remain open pending an operator ruling through the guide. No live mailbox or deployed mirror was used.
The independent Spec review finished FAIL with three open findings on this exact head. In addition to the nested booking table issue, generated raw MIME can expose a standalone named HTML document as the selected body when the optional Content-Disposition is absent. The pinned IMAP section classifier treats the corresponding part as an attachment. Generated HTML with a valid omitted paragraph end tag inside a hidden div can also suppress the visible itinerary after the div. These findings are recorded in the operator escalation. The independent Standards result was FAIL with one open finding. The review used generated input throughout.
A new security STOP is recorded in #224 comment 47056. A generated named HTML part with no disposition and no other text part reaches the locally constructed full-mode assessor excerpt on this head and on main
518bec4f495267839d05f649dc9b00225b973d01through legacy raw classification. The approved four public MCP regressions reproduce locally. No production fix or external assessor call occurred. Gate status remains STOP pending an operator ruling on the protected path.§19 security review · STOP
Exact head
4d493f233fe265e1de3e6544cf6ba36235a0ef60cannot merge. A generated raw MIME fixture shows the newly recovered attachment filename reaches the local forward-draft body, which the draft worker can save to the account’s Drafts mailbox. The same local formatter on main omits the filename. No draft was created, and no mailbox or assessor was contacted.Standards FAIL, 1 confirmed open finding. Spec FAIL, 3 open findings. The review findings and request for an operator ruling are recorded on #224. The assessor excerpt remains tracked in #231.
§19 security review · additional STOP
On exact head
4d493f233fe265e1de3e6544cf6ba36235a0ef60, the newly recovered standalone HTML attachment's generated filename can forge the marker pair inmail_attachment. The output contains two pairs and a first-pair reader extracts the filename text.mail_readproduces one pair. The same named document is absent from the attachment list on main. The generated probe and operator ruling request are recorded in #224 comment 47266. No production fix or live source access occurred.4d493f233f02a1186c9aExact-head review and §19 security result
Head
02a1186c9ac1b7b78c5c40e31ea43b9953ea1590against518bec4f495267839d05f649dc9b00225b973d01.git diff --checkpassed and the 31 existing generated HTML tests passed.Visibleon both. No external call or live mail was used. The earlier attachment header regressions pass on this head. Escalation and fixture details are on #224 comment 47289. This head is blocked from merge.The exact-head local suite completed with 1,712 passed, 8 skipped, and 30 deselected. Woodpecker pipeline 137 was running at the STOP. The full gate must run again after any authorized repair.
STOP — §19 security gate failed on PR #230 at exact head
f2d96f2fdf4553981e461f3933a1f6096a33c579.The independent Standards review reported FAIL, 1 open finding. The independent Spec review reported PASS, 0 open findings, with 38 focused fixture tests passing. A generated raw IMAP MIME message confirmed the Standards finding via the public MCP tools. The converter folds literal newlines inside a table cell's
<pre>before identifying the quoted reply. With a generated example link around that text, the unique quoted token appeared twice inmail_read(body and link label), andmail_searchreturned the message for that token. The pinned legacy converter stopped at the reply header. The assessor excerpt wasVisible, its legacy value.The affected selected text also feeds local embedding input. This fixture exercised reads and keyword search with generated data. No external service, real mailbox or deployed mirror was used. The protected evidence and assessor paths are unchanged by this commit.
Operator ruling 47294 requires a STOP for findings outside the bounded fixes and prohibits merge. No repair has been started for this finding. Escalating to the guide for operator disposition. PR #230 will remain unmerged and #224 will remain open. The already-started exact-head CI and log audit are independent of this STOP.
Exact head
f2d96f2fdfpassed CI 138. CI and local pytest each reported 1,719 passed, 8 skipped and 30 deselected. CI lint, strict type check and dependency audit passed. The raw-log audit checked clone and check records as raw JSON, JSONL and decoded log lines, plus the local test log. All five required patterns had zero hits. Raw JSONL SHA-256: clone98eb5d50b240824ff12e5740dbabda21360f82e4e294cd75b03e9ab8f6f6774b, check488082c3d46fd20c6ee82385ef878df5d2e8752d16ea40be9c1623e89e1a6b31.The same generated MIME fixture confirmed the quoted token reaches the local embedding input on the PR head. The pinned main baseline omitted it from reads, keyword search and the local embedding input. Both retained the legacy assessor excerpt. The Standards and §19 STOP still disqualifies this head despite green CI. The next bounded operator ruling is recorded in #224 comment 47305. It directs a new repair and keeps this PR unmerged. Checks used generated data. Live mail, deployed backfill and the real embedding model remain unsupported by this run.
PR #230 is now at exact head
91aacd4d4440b5395f0b1efbf6f694cd91f9bda4for the STOP 7 ruling. HTML source line breaks and markup boundaries reach quote detection before folding for presentation. The same surviving lines supply body text and link labels. Styles are inert. Preserving the text's source line breaks also covers whitespace inherited from CSS.The generated raw-MIME regressions cover each of these routes through
mail_readdefault andbody="html_text", link labels, public keyword search and the local embedding worker with a deterministic model substitute:<pre>, including a link in a table cell.white-space: pre,pre-wrapandpre-line, including inherited styles.<textarea>,<br>, block boundaries and<hr>.Ten cases reproduced the cutoff failure on the preceding head. Two were passing controls. All 50 focused fixture tests pass at the new head. The protected assessor and evidence paths are untouched by this commit. Fresh independent reviews, §19 and CI 139 are underway. The operator directed that this PR stay unmerged.
§19 security review PASS, 0 open findings in this diff for PR #230 at
91aacd4d4440b5395f0b1efbf6f694cd91f9bda4against518bec4f495267839d05f649dc9b00225b973d01.The decoder consumes byte-bounded MIME and JMAP content. The HTML parser handles source, entity and structural line boundaries locally, drops hidden content and keeps a common quote cutoff for the visible body, link labels and inline image metadata. The read renderer escapes literal fence markers on complete rendered link lines before applying the response budget, and keeps destinations inert inside the fenced body. Generated fixtures exercised the fence, the read budget, and conversion with socket creation disabled. The generated raw-MIME reproduction that blocked the prior head returned only visible text and a clean link label, and the quote was absent from keyword search and local embedding input. The fixture's protected assessor excerpt matched main.
Link destinations from attributes stay in read metadata. The selected readable body goes to the mirror's keyword index and local embedding input. Evidence, assessor, peer feed and snapshot keep their prior projections. The forward draft uses the legacy read body. The existing named-HTML assessor behavior remains governed by #231 and the operator ruling on #224. This review covered generated fixtures and code paths. Live IMAP, live JMAP, deployed mirror recovery, and the production ONNX model remain unsupported by this run. No merge is authorized under ruling 47305.
Independent reviews for PR #230 at
91aacd4d4440b5395f0b1efbf6f694cd91f9bda4against518bec4f495267839d05f649dc9b00225b973d01.§19 also passed with zero open findings. The operator ruling keeps the PR unmerged.
Exact-head gate complete for PR #230 at
91aacd4d4440b5395f0b1efbf6f694cd91f9bda4.command not found,errors during collection,= not found,ran outside the project environmentand"is_error":true. The local log also showed existing Uvicorn/Python logging errors about a closed capture stream. Pytest exited successfully.a0ea91844951e4967a3638fee45f3931c804ebd08e50546d918459dfd7c8cbf8(clone, step 17261) and930fde04f5aedda1053838c58a4c0c0a954ff28505a83c7d60d9b915b6b4b534(validation, step 17262).The route and fixture record covers the STOP 7 regressions and the independent Spec review verified all six #224 testing decisions. Evidence is fixture-only. Live IMAP, live JMAP, the reported itinerary, deployed mirror backfill and the production ONNX model remain unsupported by this run.
Under operator ruling 47305, PR #230 remains unmerged and #224 stays open.
Measured facts. PR #230 is open and mergeable at
91aacd4d4440b5395f0b1efbf6f694cd91f9bda4on main518bec4f495267839d05f649dc9b00225b973d01. The guide verified class T2. Independent Standards, Spec and §19 reviews each passed with zero findings. Exact-head CI 139 and the raw-log audit passed. The pinned merge preview reports no live-run hold for this repository. Gate recordDecided. Mind-spec ratified the ADR addendum. The operator chose “Merge under grant” and lifted the prior hold. The grant authorizes “Merge the implementing PR(s) to dev/mail-mind-mcp main.” Issue #231 stays under its separate ruling. Grant · Operator ruling · ADR ratification
Verification. Recheck main and the PR head before merging. Verify the resulting merge commit on origin/main before closing #224.
Ruling. Merge PR #230 pinned to the reviewed head. No open decision remains in the merge scope.
codex-svd pinned-merge --pr-url https://git.groupthink.asia/dev/mail-mind-mcp/pulls/230 --head 91aacd4d4440b5395f0b1efbf6f694cd91f9bda4 --repo . --merge-method squash --confirm-merge