Keep HTML anchor destinations out of evidence signatures and Jev excerpts #225
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp#225
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?
Parent #224. This fix merges before the HTML-body feature. Operator ruling
A generated HTML-only MIME message on
ec11afcshowed that the existing converter appends the href to visible anchor words. The appended destination can enter the full-mode Jev excerpt and can survive in a delimitedsign_offused by both evidence tools. Deployed row counts and use of full mode are unmeasured.Scope
sign_offscan, and the full-mode assessor excerpt. Preserve the existing body-part choice and visible anchor words.sign_offvalues and signatures derived from stored body text. Filter the assessor excerpt when building its payload, including for pre-upgrade messages. Apply the existing signature and excerpt limits to the output.Completion evidence
ACCOMMODATE. Send any ADR amendments for ratification. The PR needs independent Standards and Spec passes with zero open findings, a posted §19 review, green exact-head CI, and the raw-log audit recorded under the parent grant.STOP on historical href filtering
Mind-spec answered
ACCOMMODATEon the output filter and child order. The fresh-ingest boundary can preserve visible anchor words while dropping href attributes. Existing rows lack that distinction. A local fixture produced identical stored text,Alice <profile>, from an anchor labelled “Alice” pointing to the relative destinationprofileand from an anchor whose visible text was “Alice .” The collision survives in both the stored body representation and the stored delimited sign-off. A filter using only those strings must either drop visible text in some rows or retain a destination in others.The grant requires an operator decision for this trade-off. Proposed policy for legacy rows is to suppress ambiguous text at the protected output boundaries, with a fixture demonstrating the resulting loss of visible words. Fresh conversions can preserve visible words using the HTML structure. No mailbox or deployed row was read.
#225 · operator §6 ruling on your STOP (comment 46253) · corr mail224-align
Piers ruled (AskUserQuestion to the guide). This is his word within your grant (comment 46198). Post this ruling verbatim on #225 before you act on it.
Ruling: suppress ambiguous text. For rows written by the legacy converter, evidence signatures, sign_off output and Jev excerpts drop any text that could be a link destination. This fails closed: some real visible words are lost. Add a fixture that shows the loss. The loss lasts until #226 re-derives stored rows under its own grant. Fresh conversions keep visible words by using the HTML structure.
Order:
STOP on #225 and #224. Mind-spec returned
ACCOMMODATEfor the operator's legacy suppression rule in the ruling. Source inspection found a further legacy path. The pinned converter retains line breaks inside the destination it emits.trim_quotedcan cut off the closing marker beforebody_textis stored.delimited_blockcan start and stop inside the destination, leavingsign_offwith neither marker. These values feed the evidence signature paths and the full-mode Jev excerpt. The affected columns carry no source provenance, so a read-time scan for URL syntax or angle brackets cannot guarantee the rule. This finding comes from source inspection.Please confirm whether #225 should pass an empty input to the existing evidence signature and Jev excerpt logic for historical body values without trusted provenance, and omit historical sign-off values without their own trusted provenance, until a separately authorized #226 re-derivation. This can suppress entire excerpts and signatures, including on legacy plain-text mail. Fresh derivations can preserve visible words by separating the HTML text from destination attributes before trimming. This proposal leaves read/search and the stored historical values in place under #225.
Implementation remains stopped pending the operator's decision through the guide. No live mailbox, deployed mirror, or external assessor was used.
#225 · operator §6 ruling on your STOP (comment 46264) · corr mail224-align
Piers ruled (AskUserQuestion to the guide). This is his word within your grant (comment 46198). Post this ruling verbatim on #225 before you act on it. It replaces the suppress-ambiguous ruling of comment 46262.
Ruling: withhold historical values. Accept your proposal in comment 46264.
Order:
The operator ruling accepts that historical mail, including older plain-text mail, can lose its entire signature or full-mode Jev excerpt. An unverified historical sign-off is omitted. This supersedes the earlier policy of suppressing ambiguous spans. Deployed impact is unmeasured.
Proposed additive SQLite migration for #225. Add a nullable
protected_body_textcolumn as the input to the existing evidence signature heuristics and full-mode Jev excerpt. On fresh derivation, this stores text from the legacy-selected body part after the HTML parser separates visible text from destination attributes and before the value is handed off to protected consumers. Apply existing quote trimming at its current stage. SQL NULL means the protected input is unavailable. Read/search continue to use the existing body column. Also add an independentsign_off_verifiedflag, default false, set atomically with a sign-off produced by the new derivation. A body write alone cannot mark an older retained sign-off verified. The migration leaves all historical body and sign-off values in place. Evidence uses an empty body input and omits an unverified sign-off. Full-mode Jev retains its excerpt field and uses an empty string when the protected body is unavailable. The existing excerpt length, evidence and assessor field lists, scopes, and consent rules stay as specified. #226 requires a separate grant to re-derive historical values.Cover older plain-text and converted HTML rows using generated fixtures, including the visible words the withholding removes. Fresh fixtures cover visible anchor words and destination exclusion. Awaiting mind-spec's fit answer before implementation.
STOP on #225 and #224. Source inspection found a separate path for markup attributes to reach the evidence signature, sign-off, and full-mode Jev excerpt. Python's HTMLParser can pass raw malformed start tags to handle_data. The pinned renderer treats that callback as body text. The draft filter intercepts completed anchor tags, so it misses this path. The current and draft JMAP body paths can also receive truncated HTML. The draft still derives a protected excerpt from a part marked truncated. This finding comes from source inspection of generated-fixture code paths. Live exposure is unmeasured.
Please confirm through the guide whether to use a protected conversion that only accepts parsed text nodes, withhold the protected body and sign-off input when parsing cannot establish that boundary, and withhold both for JMAP parts marked truncated. The read and search outputs would keep their current rendering in #225. I would verify the protected field boundary with generated fixtures before resuming #224.
Implementation is paused under the security escalation rule. The #225 draft remains uncommitted. No mailbox, deployed mirror, or external assessor was used.
#225 · operator §6 ruling on your STOP (comment 46273) · corr mail224-align
Piers ruled (AskUserQuestion to the guide). This is his word within your grant (comment 46198). Post this ruling verbatim on #225 before you act on it.
Ruling: accept your proposal in comment 46273.
Order:
Proposed #225 amendments for mind-spec ratification before merge. ADR 0003 §1 names the trusted input for the existing 500-character excerpt. ADR 0008 §2 and §11 specify the verified delimited block and protected fallback. The changes record the operator rulings on historical, ambiguous and truncated values.
STOP on #225 and #224. Mind-spec returned
CLASHon the proposed ADR 0008 §2 wording in #issuecomment-46277 (Rat messagee63c1a21-a127-4de5-93dc-94db11620f3b). The draft says a nonempty stored sign-off bypasses the heuristic, which conflicts with the immediately following requirement for a verified sign-off. Mind-spec confirmed that ADR 0003 §1 and ADR 0008 §11 fit the approved policy.Proposed resolution for Piers’s approval: amend §2 to say that only a verified, nonempty delimited sign-off bypasses the heuristic. Otherwise the heuristic uses protected body text when available and empty input when it is unavailable. Resubmit the revised §2 wording to mind-spec for ratification before merge.
Work is paused at the operator escalation gate. The #225 draft is uncommitted and no PR has opened. The latest complete local run reported 1,665 passed, 8 skipped and 30 deselected. Two subsequently added targeted migration and JMAP fixture checks passed. Live IMAP, live JMAP and deployed backfill coverage are unsupported in this run.
#225 · operator §6 ruling on your STOP (comment 46281) · corr mail224-align
Piers ruled (AskUserQuestion to the guide). This is his word within your grant (comment 46198). Post this ruling verbatim on #225 before you act on it.
Ruling: approve the ADR 0008 §2 fix proposed in comment 46281. Only a verified, nonempty delimited sign-off bypasses the signature heuristic. Otherwise the heuristic uses protected_body_text when it is available, and empty input when it is not.
Order:
Revised ADR 0008 §2 wording for mind-spec ratification under Piers’s ruling. This replaces the final
signaturesub-bullet in the earlier proposal. ADR 0003 §1 and ADR 0008 §11 retain the exact wording mind-spec confirmed.Mind-spec ratified the exact revised ADR wording in #225 comment 46284. Ratatoskr answer
aa6a411a-d76e-4d1c-89d0-88fd2618cd8fonmail224-canonical.