docs(35): re-verify after quick 261114-p5m - all automated checks pass, human verification needed

This commit is contained in:
Jakub Zych
2026-11-14 18:46:33 +01:00
parent 5735e7c7d5
commit 3541c9bda3

View File

@@ -1,8 +1,8 @@
---
phase: 35-mail-templates-and-layouts-editor
verified: 2026-11-14T16:58:10Z
status: gaps_found
score: 21/22 must-haves verified
verified: 2026-11-14T17:43:56Z
status: human_needed
score: 22/22 must-haves verified
covered_files:
- .planning/phases/35-mail-templates-and-layouts-editor/35-01-PLAN.md
- .planning/phases/35-mail-templates-and-layouts-editor/35-01-SUMMARY.md
@@ -22,6 +22,8 @@ covered_files:
- .planning/phases/35-mail-templates-and-layouts-editor/35-08-SUMMARY.md
- .planning/phases/35-mail-templates-and-layouts-editor/35-09-PLAN.md
- .planning/phases/35-mail-templates-and-layouts-editor/35-09-SUMMARY.md
- .planning/quick/261114-p5m-fix-cr-02-residual-quoted-end-tags-in-ra/261114-p5m-PLAN.md
- .planning/quick/261114-p5m-fix-cr-02-residual-quoted-end-tags-in-ra/261114-p5m-SUMMARY.md
- admin/openapi/admin.json
- admin/package-lock.json
- admin/package.json
@@ -205,54 +207,37 @@ covered_files:
- modules/surf/serve.go
- modules/surf/store_lookup_test.go
- scripts/check-phase35.sh
covered_digest: "v2:sha256:f7c3f2115a39b52bac7bbc970599c28a13b09b580c1289a09fb07f222deff9c4"
covered_digest: "v2:sha256:0946027fa67264b1d8b7f9fe4210f2674311daed071f1a2bd629ef1b91566579"
behavior_unverified: 0
overrides_applied: 0
re_verification:
previous_status: gaps_found
previous_score: 18/22
previous_score: 21/22
gaps_closed:
- "CR-01 residual: Branding 'Online=Shop'/'onboarding=team' and mail.from '\"Online=Shop\" <x@example.com>' now send on the default and system layouts (verifier probe: all 8 sends err=<nil>; TestSiteNameSend, TestUnsafeSiteNameDropped PASS); Editor.Validate of a template under Branding 'Online=Shop' is accepted; body text 'Ada, buy one = get one free' sends (WR-02, handler regex removed from templates.go)"
- "CR-02, the payloads it named: javascript:/onerror inside <noscript>, <xmp>, SVG <title>/<textarea>/<style> (direct content) are refused by validateHTML and Editor.Validate; a layout override carrying the noscript payload falls back to the file version with inlining on and off (verifier probe)"
- "WR-01 (advisory): values=\"java&#9;script:...\" and meta refresh url=java&#9;script: are refused (verifier probe)"
- "WR-03 (advisory): UnsafeText('Data:Lab') is false (verifier probe)"
gaps_remaining:
- "CR-02 residual: the raw-text re-check reads only up to where x/net/html's tokenizer ends the element. A raw-text end tag inside a quoted attribute (<svg><style><a title=\"</style>\" href=\"javascript:alert(1)\">) ends the element early for the tokenizer, and the rest of the tag is checked as text. A conforming HTML parser reads it as a live link"
- "CR-02 residual (truth 18): a raw-text end tag or '-->' inside a quoted attribute no longer hides the rest of the tag. unsafeMarkupAt now runs a second, quote-aware tag reading (unsafeTagReading: NextIsNotRawText after raw-text start tags, '<!--' blanked). Verifier's re-run probe: validateHTML refuses all 8 end-tag-in-attribute payloads; Editor.Validate refuses the noscript href, noscript handler and svg/style layouts; a default-layout override carrying them falls back to the file version with inlining on and off (logged 'override failed, sending the file version'). TestURLSchemeCheck *_end_in_attr subtests (refuse, send inline/opt_out, editor, escaped_send with a parser oracle) PASS"
gaps_remaining: []
regressions: []
gaps:
- truth: "The URL-scheme check of rendered HTML is anchored to URL-bearing attributes, style, comments and meta content after decoding, and javascript:/vbscript:/data: URLs are still refused at save and at send whether or not the layout opts out of inlining (35-08 must-have; D-13 as restated in .planning/notes/2026-11-14-mail-url-scheme-check.md; carried-forward CR-02 gap)"
status: partial
reason: "Reproduced by the verifier (overlay probes, no source change). unsafeMarkupAt (safety.go) re-checks the raw source of a raw-text element's content, but that content is what x/net/html's tokenizer reads up to the first '</style', '</noscript', '</title' or '</textarea'. If that end tag sits inside a quoted attribute value, the element ends early in the tokenizer's reading, and the rest of the start tag (' href=\"javascript:alert(1)\">x') is an outer TextToken, which is not checked. A mail client parsing the document reads the attribute quoting, so the tag is a live element. Evidence: validateHTML returns nil for '<svg><style><a title=\"</style>\" href=\"javascript:alert(1)\">x</a></style></svg>', the same with svg title/textarea, '<noscript><a title=\"</noscript>\" href=\"javascript:alert(1)\">' and '<noscript><img title=\"</noscript>\" src=x onerror=alert(1)>'. x/net/html's own parser (ParseWithOptions) reads the svg/style payload as svg:a href=javascript:alert(1) with scripting on and off, and the noscript payloads as a:href=javascript: and img onerror= with scripting off. Editor.Validate accepts a default-layout override with each of the five payloads (save). Send through that override with DisableAutoInlineCSS delivers the svg/style and noscript payloads intact. With inlining on, the inliner's side effects defuse them (premailer drops the svg style element and re-serializes the noscript remainder as escaped text). That is an incidental property of go-premailer, not the check. Template body overrides are not affected: goldmark leaves raw HTML out. The author needs the layouts permission, and whether this can be exploited depends on the client. Still, README:30 and docs/services/mail.md:158 promise that markup inside these elements is checked, the note's residual-risk list names only over-refusal, and the fixer's tests have no such case."
artifacts:
- path: "modules/postcard/safety.go"
issue: "unsafeMarkupAt re-reads only the tokenizer's raw-text token; a raw-text end tag inside a quoted attribute splits the start tag, and its remainder is an outer text token that is never checked"
- path: "modules/postcard/safety_test.go"
issue: "TestURLSchemeCheck has no payload with a raw-text end tag inside an attribute value"
missing:
- "Also read the document as markup in a way that ignores raw-text state: for example a second tokenizer pass calling z.NextIsNotRawText() after every rawTextElements start tag (so attribute quoting decides where a tag ends), or re-check from the raw-text content start to the end of the document rather than to the tokenizer's end tag"
- "Regression cases in TestURLSchemeCheck refuses: '<svg><style><a title=\"</style>\" href=\"javascript:alert(1)\">x</a></style></svg>', the svg title and textarea variants, '<noscript><a title=\"</noscript>\" href=\"javascript:alert(1)\">x</a></noscript>', '<noscript><img title=\"</noscript>\" src=x onerror=alert(1)></noscript>'; plus an Editor.Validate refusal and a send through a layout override with DisableAutoInlineCSS that falls back to the file version"
- "Or, if the developer judges this acceptable (admin-authored, client-dependent), record it in the note's residual-risk section and the docs, and add an override to this file (see the report)"
advisory:
- finding: "Outlook conditional comment with '-->' inside an attribute (<!--[if mso]><a title=\"-->\" href=\"javascript:alert(1)\">x</a><![endif]-->) passes validateHTML"
category: security
reason: "Browsers end the comment at the first '-->', so the remainder is text there; only an MSO-specific reading could differ, and Outlook's Word engine runs no script. Worth one test case if the CR-02 residual is fixed with a markup-only pass"
evidence_status: "verifier probe (validateHTML nil); no client evidence"
- finding: "35-REVIEW-DISPOSITION.md frontmatter still lists CR-01, CR-02, WR-01 as disposition: open (open: 9), while its table marks them fixed"
- finding: "The quote-aware tag reading can over-refuse: an unbalanced quote inside a comment or raw-text element joins later text into one tag, and attribute-shaped text after it (e.g. 'online=yes') is refused"
category: other
reason: "Planning record inconsistency; re-run the disposition gate or edit the frontmatter"
reason: "Documented as residual risk in .planning/notes/2026-11-14-mail-url-scheme-check.md. A refused override falls back to the file version, but a plugin's own file layout that tripped it would not send. Built-in layouts and both consumer plugins' mail tests pass today (--consumers); worth re-running --consumers after the concurrent plugin layout restyle (quick 261114-p5n) lands"
evidence_status: "decision note; no failing case found"
- finding: "35-UAT.md gap records G-35-1 and G-35-8 are marked 'resolved' by 35-07 (5735e7c7), while test rows 1 and 8 still read 'result: issue' and no human re-test is recorded"
category: other
reason: "Record reconciliation, not human evidence; both re-tests stay in human_verification below"
evidence_status: "file inspection"
- finding: "WR-03 partial deviation: 'JavaScript: The Good Parts Club' is still refused as a site name (javascript: followed by whitespace)"
category: other
reason: "Deliberate, per the decision note ('javascript: Acme' is unsafe); a product decision for the user, not a defect. A refused name is dropped, and mail still sends"
reason: "Deliberate, per the decision note; a product decision. A refused name is dropped, and mail still sends"
evidence_status: "35-REVIEW-FIX.md; code inspection"
- finding: "35-UI-SPEC.md:427 and 35-08-PLAN.md:130 still quote the old Branding refusal copy with 'text such as onclick='"
category: other
reason: "Phrasebook en/pl changed in 31de2ff9; update UI-SPEC if it is a living copy contract"
evidence_status: "35-REVIEW-FIX.md; not re-checked"
- finding: "IN-01..IN-03 (35-REVIEW) and WR-04, WR-05, IN-04 (earlier review) remain open in the disposition record"
evidence_status: "not re-checked this round"
- finding: "IN-01..IN-03 (35-REVIEW) and WR-04, WR-05, IN-04 (earlier review) remain open in the disposition record (open: 6)"
category: other
reason: "Info-level or outside the fix round; none stops a send"
evidence_status: "code review; not re-run by verifier"
evidence_status: "35-REVIEW-DISPOSITION.md"
human_verified:
- test: "Reset to file version"
uat_row: 3
@@ -263,10 +248,10 @@ human_verified:
- test: "Confirm judgment-tier prohibition: postcard imports modules/lagoon/attach for AbsolutePublicURL."
uat_row: 10
recorded_at: "2026-11-13T21:09:53.000Z"
human_verification: # pending human items, kept although status is gaps_found so they are not lost; run after the CR-02 residual is closed or overridden
human_verification:
- test: "Template list"
expected: "On the demo app rebuilt on this framework commit: Mail templates shows one row per template with a Customized locales column; opening a template shows the Language switcher under the title; switching to a locale without a file, saving it and switching back works behind the unsaved-changes confirm. Re-run UAT test 1 in full."
why_human: "Placement and readability of the switcher and the Customized locales column in the embedded admin (35-VALIDATION Manual-Only). G-35-1 is marked resolved by 35-05/35-07 in 35-UAT.md but was never re-tested"
why_human: "Placement and readability of the switcher and the Customized locales column in the embedded admin (35-VALIDATION Manual-Only). The G-35-1 gap record is marked resolved by 35-07 in 35-UAT.md, but row 1 still reads 'issue' and was never re-tested"
retest_reason: "UAT row 1 was an issue (G-35-1); the fix (35-05, 35-07) landed after it"
- test: "Preview"
expected: "Scoped re-run: reset the UAT overrides of the user plugin's activate template and its layout; save Branding with a logo and a Site name; preview a template on the default and on the system layout with a body override calling {{ partial \"button\" \"url\" \"https://example.com\" \"body\" \"Go\" }}. Expect the logo header (or the name without a logo), the white card, the styled button and the footer (© year and name, printed literally)."
@@ -275,43 +260,43 @@ human_verification: # pending human items, kept although status is gaps_found so
- test: "Customize and save a template"
expected: "Saving a customized template still works and the saved version is sent"
why_human: "Admin save flow in the embedded SPA"
retest_reason: "the save-time safety check changed after the UAT pass (2026-11-13T21:09:53Z): modules/postcard/safety.go (35-08 tokenizer check, then CR-02 raw-text/comment re-check, WR-01 whitespace stripping) and modules/postcard/templates.go (WR-02 removed the handler regex)"
retest_reason: "the save-time safety check changed after the UAT pass (2026-11-13T21:09:53Z): modules/postcard/safety.go (35-08 tokenizer check, CR-02 raw-text/comment re-check, WR-01 whitespace stripping, then the quote-aware tag reading of quick 261114-p5m, d6ac0aeb) and modules/postcard/templates.go (WR-02 removed the handler regex)"
- test: "Layout editor"
expected: "Editing and saving a layout still works; an unsafe layout is refused with a line under the field"
why_human: "Admin save flow in the embedded SPA"
retest_reason: "layout validation in modules/postcard/safety.go and templates.go changed after the UAT pass (2026-11-13T21:09:53Z), including the new 'nests raw-text elements or comments too deeply' refusal"
retest_reason: "layout validation in modules/postcard/safety.go and templates.go changed after the UAT pass (2026-11-13T21:09:53Z), including the 'nests raw-text elements or comments too deeply' refusal and the second, quote-aware tag reading (d6ac0aeb)"
- test: "Insert image into layout"
expected: "An uploaded image inserted into a layout saves and previews"
why_human: "Image picker flow in the embedded SPA"
retest_reason: "the src/href check that validates the inserted img was rewritten after the UAT pass (2026-11-13T21:09:53Z): tokenizer check in 35-08, stripURLSpace refactor in WR-01"
retest_reason: "the src/href check that validates the inserted img was rewritten after the UAT pass (2026-11-13T21:09:53Z): tokenizer check in 35-08, stripURLSpace refactor in WR-01, shared unsafeAttrs and a second tag reading in d6ac0aeb"
- test: "Branding"
expected: "Change a colour, set a logo and a prose Site name, Save, reload; values persist and the template preview uses them"
why_human: "Settings form and preview in the embedded admin"
retest_reason: "modules/cabana/mail_admin.go BeforeValidate now calls postcard.UnsafeText (35-08), whose rule changed again in CR-01 (printContext) and WR-03 (data-URL shape); modules/cabana/settings.go error localization and modules/postcard/editor.go brand preview changed after the UAT pass (2026-11-13T21:09:53Z)"
retest_reason: "modules/cabana/mail_admin.go BeforeValidate now calls postcard.UnsafeText (35-08), whose rule changed again in CR-01 (printContext), WR-03 (data-URL shape) and d6ac0aeb (validateHTML gained the tag reading); modules/cabana/settings.go error localization and modules/postcard/editor.go brand preview changed after the UAT pass (2026-11-13T21:09:53Z)"
- test: "Branding refusal on the demo instance"
expected: "On the demo app: Site name 'javascript:alert(1)' and 'data:text/html,x' are refused with the translated message under Site name (en and pl, copy without 'text such as onclick='); 'Online=Shop', 'Data:Lab' and 'Big Data: Summit' save and appear in the preview header and footer"
why_human: "Field-error rendering and the new en/pl copy in the embedded admin; never seen by a human"
- test: "Send test to me"
expected: "Send test to me delivers the draft to the signed-in admin only"
why_human: "Real delivery through the configured driver"
retest_reason: "modules/postcard/mailer.go (site name selection), templates.go (send-time validateHTML, handler regex removed) and the default/system layouts and footer partial changed after the UAT pass (2026-11-13T21:09:53Z)"
- test: "Review the CR-01, CR-02 and WR-02 safety-rule changes"
expected: "Accept or reject the rule changes that 35-REVIEW-FIX.md marks 'requires human verification': (CR-01) UnsafeText checks the name where the layouts print it; (CR-02) raw-text element and comment content is re-checked as markup with an 8-level depth limit (see the open CR-02 residual gap); (WR-02) text shaped like an event handler is sent, and only attributes count as handlers. The decision note .planning/notes/2026-11-14-mail-url-scheme-check.md was amended to match"
why_human: "Logic changes to the mail safety contract and a reversal of a documented accepted residual; the fixer asked for human sign-off"
retest_reason: "modules/postcard/mailer.go (site name selection), templates.go and safety.go (send-time validateHTML, handler regex removed, tag reading added) and the default/system layouts and footer partial changed after the UAT pass (2026-11-13T21:09:53Z)"
- test: "Review the CR-01, CR-02 and WR-02 safety-rule changes, including the CR-02 residual fix"
expected: "Accept or reject the rule changes that 35-REVIEW-FIX.md marks 'requires human verification': (CR-01) UnsafeText checks the name where the layouts print it; (CR-02) raw-text element and comment content is re-checked as markup with an 8-level depth limit; (CR-02 residual, quick 261114-p5m) every tag is read a second time with attribute quoting alone deciding where it ends, which can over-refuse after an unbalanced quote in a comment or style element; (WR-02) text shaped like an event handler is sent, and only attributes count as handlers. The decision note .planning/notes/2026-11-14-mail-url-scheme-check.md was amended twice to match"
why_human: "Logic changes to the mail safety contract, a reversal of a documented accepted residual and a new accepted over-refusal risk; the fixer asked for human sign-off"
- test: "Inlined mail in a real inbox"
expected: "Test-send a template in the default layout to a real webmail/Outlook inbox; the button and card keep their colours with the style block stripped"
why_human: "Mail clients differ in what they keep of a style block; cannot be asserted by unit tests"
- test: "Confirm judgment-tier prohibitions of 35-05..35-09 and the review fix round"
expected: "Accept: no sibling repository changed (sm-user-plugin and sm-paymentgateway-plugin clean after the verifier's --consumers run); nothing pushed or tagged (master is 106 commits ahead of origin/master, newest tag v0.6.4 predates the gap closures); framework code, docs and tests name no consuming application (--marker passed)"
- test: "Confirm judgment-tier prohibitions of 35-05..35-09, the review fix round and quick 261114-p5m"
expected: "Accept: no sibling repository changed by this phase (sm-user-plugin and sm-paymentgateway-plugin clean before and after the verifier's --consumers run; the concurrent restyle there is quick 261114-p5n, not this phase); nothing pushed or tagged (master is 113 commits ahead of origin/master, newest tag v0.6.4 predates the gap closures); framework code, docs and tests name no consuming application (--marker passed)"
why_human: "Judgment-tier prohibitions need explicit human resolution; the verifier's LLM judgment is non-authoritative"
---
# Phase 35: Mail templates and layouts editor Verification Report
**Phase Goal:** Administrators edit every mail the application sends from the admin panel, as in WinterCMS's Mail templates screen. System mail and the templates plugins register through `pact.HasMailTemplates` appear in a list. Each template can get a database override of its subject and body, and the override can be reset to the file version. Layouts become admin-editable records assigned to templates, with a few predefined layouts seeded. Images can be uploaded and placed in layouts and templates. postcard renders the override when one exists, otherwise the plugin's file, so mail that already works keeps working.
**Verified:** 2026-11-14T16:58:10Z
**Status:** gaps_found
**Re-verification:** Yes. Third re-verification, after the code-review fix round (2dbee305 CR-01, 1d481bb0 CR-02, baba524c WR-01, 31de2ff9 WR-02, 8deb56ff WR-03, 1d2e7e87 note). The two carried-forward gaps got a full check: the previous probe was re-run unchanged, and three new overlay probes were written by the verifier. The previously passed truths got a regression check (vet, the short suite once, named and Docker tests, gate stages). No repository source was modified.
**Verified:** 2026-11-14T17:43:56Z
**Status:** human_needed
**Re-verification:** Yes. Fourth re-verification, after quick task 261114-p5m (d6ac0aeb fix, e47d4ae6 note, f1f284a0 tests), which targets the only remaining gap (truth 18, CR-02 residual). The carried-forward gap got a full check: the code diff was read, the four verifier overlay probes were re-run unchanged, and the new tests were run by name. The previously passed truths got a regression check (vet, the short suite once, named and Docker tests, gate stages). No repository source was modified. The verifier wrote no new bypass variants this round. The quick task's eight `*_end_in_attr` refuse cases, its accept cases and its parser-oracle `escaped_send` subtests cover the residual's shape.
## Goal Achievement
@@ -322,77 +307,74 @@ ROADMAP gives no Success Criteria for Phase 35 and `Requirements: TBD`, so the m
| # | Truth | Status | Evidence |
| --- | --- | --- | --- |
| 1 | Administrators edit mail from Settings → Mail (templates, layouts, partials, branding, images) | ✓ VERIFIED | Screens unchanged; cabana Postgres tests pass; UAT re-tests owed (Human Verification) |
| 2 | Templates appear one row per template (G-35-1) | ✓ VERIFIED | `TestMailLocaleGroups` PASS; visual re-run of UAT 1 owed |
| 2 | Templates appear one row per template (G-35-1) | ✓ VERIFIED | `TestMailLocaleGroups` PASS (Docker); visual re-run of UAT 1 owed |
| 3 | Locale switcher; per-locale customize, reset, drift | ✓ VERIFIED | `TestMailLocaleGroups` PASS |
| 4 | DB override of subject/body; Reset restores the file | ✓ VERIFIED | `TestOverride`, `TestFallback` PASS; UAT row 3 stands (reset code untouched) |
| 5 | Layouts are editable records; default/system/minimal seeded | ✓ VERIFIED | unchanged since previous report |
| 6 | Built-in layouts finished (header, card, footer, button) | ✓ VERIFIED | `TestBuiltinLayoutsLogo`, `TestHeaderFooterPartials`, `TestButtonPartial` PASS |
| 5 | Layouts are editable records; default/system/minimal seeded | ✓ VERIFIED | unchanged; `TestMailOverrideSmoke/layouts_and_partials` PASS |
| 6 | Built-in layouts finished (header, card, footer, button) | ✓ VERIFIED | `TestBuiltinLayoutsLogo`, `TestHeaderFooterPartials`, `TestButtonPartial` PASS; they also pass the new tag reading |
| 7 | Branding Site name, else mail.from display name | ✓ VERIFIED | `TestSiteName`, `TestMailBrandSiteName` PASS |
| 8 | CSS inlined with per-layout opt-out; inliner failure never stops mail | ✓ VERIFIED | `TestInlineCSS`, `TestInlineFailure`, `TestMailLayoutInlineOptOut` PASS |
| 9 | Images uploaded and placed in layouts and templates | ✓ VERIFIED | routes and picker unchanged; UAT 6 re-test owed |
| 10 | Override when present, else file; `<template>-<locale>` fallback | ✓ VERIFIED | `TestSendLocaleFallback`, `TestTemplateFor`, `TestMailOverrideSmoke/locale_fallback` PASS |
| 11 | **Mail that already works keeps working**: no config that sends today and no admin-saved Branding value stops mail on the built-in layouts | ✓ VERIFIED | **Gap closed.** Re-run probe: Branding and mail.from `Online=Shop`/`onboarding=team` send on default and system (8 × `err=<nil>`); `Name: "Ada, buy one = get one free"` sends on both. The handler regex is gone from `templates.go` (`grep eventHandler` finds nothing). `TestSiteNameSend` (incl. `handler_shaped_variable`) PASS |
| 11 | Mail that already works keeps working: no config that sends today and no admin-saved Branding value stops mail on the built-in layouts | ✓ VERIFIED | Re-run probe 1: Branding and mail.from `Online=Shop`/`onboarding=team` and the prose variable send on default and system (10 × `err=<nil>`); `TestSiteNameSend` PASS; consumer plugins' mail tests pass (`--consumers`) |
| 12 | `check-phase35.sh` gate: read-only consumers, new names required | ✓ VERIFIED | Verifier ran `--self-test`, `--docs`, `--marker`, `--additive` (8 packages vs v0.6.3), `--consumers`: all exit 0 |
| 13 | Decision notes recorded | ✓ VERIFIED | `.planning/notes/2026-11-14-mail-url-scheme-check.md` amended (1d2e7e87) with an Amendment section |
| 13 | Decision notes recorded | ✓ VERIFIED | `.planning/notes/2026-11-14-mail-url-scheme-check.md` amended again (e47d4ae6): status line, decision bullet, over-refusal residual risk, two rejected alternatives, amendment bullet |
| 14 | Permission split, own-address test send, sandboxed preview | ✓ VERIFIED | no regression; `TestMailLocaleGroups` PASS |
| 15 | Sends with mail.from `"Metadata: Weekly"` / Branding `Big Data: Summit` on every path; name in header and footer | ✓ VERIFIED | `TestSiteNameSend` PASS; probe `UnsafeText` false for both |
| 16 | An unsafe site name is left out at render with one rate-limited warning; send succeeds on every path and in the editor | ✓ VERIFIED | **Gap closed.** `TestUnsafeSiteNameDropped` PASS; `Online=Shop` is no longer unsafe (probe `UnsafeText` false) and is printed, so no class of name breaks a render |
| 17 | Branding save of an unsafe name is a 422 on site_name (en/pl); template/layout saves under a stored name are not refused | ✓ VERIFIED | **Gap closed.** `TestMailSiteNameSafety` PASS against Docker Postgres, 7 subtests incl. `handler_shaped_name_sends`; probe `Editor.Validate` of both fixture templates under Branding `Online=Shop` = `<nil>` |
| 18 | URL-scheme check anchored to URL-bearing attributes, decoded; prose passes; `javascript:` URLs refused at save and send, inlining on or off | ✗ FAILED (partial) | The six CR-02 payloads and the WR-01 encodings are now refused, and the noscript layout override falls back with inlining on and off. **CR-02 residual, reproduced by the verifier:** if a raw-text end tag sits inside a quoted attribute (`<svg><style><a title="</style>" href="javascript:alert(1)">`, the same for svg title/textarea and noscript), the check passes. x/net/html's parser reads it as a live `svg:a href=javascript:`. `Editor.Validate` accepts it, and a layout that opts out of inlining sends it intact. See Gaps |
| 15 | Sends with mail.from `"Metadata: Weekly"` / Branding `Big Data: Summit` on every path; name in header and footer | ✓ VERIFIED | `TestSiteNameSend` PASS |
| 16 | An unsafe site name is left out at render with one rate-limited warning; send succeeds on every path and in the editor | ✓ VERIFIED | `TestUnsafeSiteNameDropped` PASS |
| 17 | Branding save of an unsafe name is a 422 on site_name (en/pl); template/layout saves under a stored name are not refused | ✓ VERIFIED | `TestMailSiteNameSafety` PASS (Docker); probe `Editor.Validate` under `Online=Shop` accepts both fixture templates |
| 18 | URL-scheme check anchored to URL-bearing attributes, decoded; prose passes; `javascript:` URLs refused at save and send, inlining on or off | ✓ VERIFIED | **Gap closed.** Behavior-dependent truth with behavioral evidence: `TestURLSchemeCheck` PASS with 23 new subtests matched (refuse ×8, send inline/opt_out ×6, escaped_send ×4, accept, editor), 0 FAIL. Re-run probe 2: `validateHTML` refuses all 8 payloads that passed last round, including the conditional-comment advisory case. The noscript href, noscript handler and svg/style layout overrides fall back to the file version with inlining on and off. svg title/textarea are sent as html/template-escaped text, and the repository's parser oracle (scripting on and off) finds no live element. Probe 3 still shows x/net/html would build `svg:a href=javascript:` from the svg/style payload, so refusing it is the correct outcome |
| 19 | An inlined result that fails the check is sent as its style-block version with a warning | ✓ VERIFIED | `TestInlineUnsafeOutput` PASS |
| 20 | Footer prints the site name literally | ✓ VERIFIED | `TestFooterSiteNameLiteral` PASS |
| 21 | sm-user-plugin and sm-paymentgateway-plugin mail tests pass read-only | ✓ VERIFIED | `--consumers` passed, both trees clean after |
| 21 | sm-user-plugin and sm-paymentgateway-plugin mail tests pass read-only | ✓ VERIFIED | `--consumers` passed (2 + 3 top-level tests); both trees clean before and after (empty `git status`) |
| 22 | 35-07 pin subtest gone; gate requires new names; IN-03 self-test uses `cmp` | ✓ VERIFIED | `--self-test` passed |
**Score:** 21/22 truths verified (0 present, behavior-unverified). The CR-01 residual root cause is gone. One root cause remains: the CR-02 raw-text re-check is bounded by the tokenizer's reading of where the element ends.
**Score:** 22/22 truths verified (0 present, behavior-unverified).
### Deferred Items
| # | Item | Addressed In | Evidence |
|---|------|-------------|----------|
| 1 | G-35-8 plugin part: user and paymentgateway plugin CTAs through the button partial, finished plugin layouts, framework bump | Plugin follow-up after the framework tag (user decision 2026-11-13; no roadmap phase) | 35-06-PLAN "Follow-ups", 35-UAT G-35-8. Informational |
No later roadmap phase covers the remaining gap: Phase 35 is the last numbered phase, and backlog 999.1/999.2 are newsletter and SEO work.
| 1 | G-35-8 plugin part: user and paymentgateway plugin CTAs through the button partial, finished plugin layouts, framework bump | Plugin follow-up after the framework tag (user decision 2026-11-13; quick 261114-p5n in flight in the sibling repos) | 35-06-PLAN "Follow-ups", 35-UAT G-35-8. Informational |
### Advisory (New Scope, Unevidenced)
| # | Finding | Category | Why Advisory |
|---|---------|----------|--------------|
| 1 | Conditional comment with `-->` inside an attribute passes `validateHTML` | security | Browsers end the comment at the first `-->`; no client evidence of a different reading |
| 2 | 35-REVIEW-DISPOSITION.md frontmatter says CR-01/CR-02/WR-01 `open`, while its table says `fixed` | other | Planning-record inconsistency |
| 3 | WR-03 deviation: `JavaScript: The Good Parts Club` still refused | other | Deliberate per the note; product decision; the name is dropped, mail sends |
| 1 | Tag reading can over-refuse after an unbalanced quote in a comment or style element | other | Documented residual risk; no failing case. Re-run `--consumers` after 261114-p5n lands |
| 2 | 35-UAT gap records marked resolved, but rows 1 and 8 still read `issue` | other | Record reconciliation, not human evidence; the re-tests stay owed |
| 3 | WR-03 deviation: `JavaScript: The Good Parts Club` still refused | other | Deliberate per the note; product decision |
| 4 | 35-UI-SPEC.md:427, 35-08-PLAN.md:130 quote the old copy | other | Copy contract drift |
| 5 | IN-01..IN-03, WR-04, WR-05, IN-04 open | other | Info-level or outside the fix round |
Closed since the previous report: the conditional-comment advisory (`-->` inside an attribute) is now refused (`refuse/conditional_comment_end_in_attr`), and 35-REVIEW-DISPOSITION.md frontmatter now marks CR-01/CR-02/WR-01 `fixed` (d8137c17).
### Required Artifacts
| Artifact | Expected | Status | Details |
| -------- | -------- | ------ | ------- |
| `modules/postcard/safety.go` | tokenizer check, raw-text/comment re-check, `stripURLSpace`, `printContext`, `UnsafeText` | ⚠️ substantive with one defect | wired from `validateHTML` (templates.go), `siteNameFrom` (mailer.go) and cabana `BeforeValidate`; carries the CR-02 residual |
| `modules/postcard/templates.go` | `validateHTML` without the whole-document handler regex | ✓ VERIFIED | `rawUnsafeTag` then `unsafeMarkup`; no `eventHandler` |
| `modules/postcard/safety_test.go` | `TestURLSchemeCheck` with CR-02/WR-01 cases | ✓ VERIFIED (incomplete coverage) | PASS; no end-tag-inside-attribute case |
| `modules/postcard/sitename_test.go` | `TestSiteNameSend` with `Online=Shop`, handler-shaped variable | ✓ VERIFIED | PASS |
| `modules/cabana/mail_site_name_postgres_test.go` | `handler_shaped_name_sends` | ✓ VERIFIED | 7 subtests PASS (Docker) |
| `modules/postcard/override_smoke_test.go` | fallback via Markdown `data:` image | ✓ VERIFIED | `TestMailOverrideSmoke/fallback` PASS (Docker) |
| phrasebook en/pl, README, docs/services/mail.md | copy and contract updated | ✓ VERIFIED | `--docs` passed; docs promise raw-text content is checked (see gap) |
| Earlier artifacts | | ✓ VERIFIED | admin/, boardwalk/dist, pact, go.mod/go.sum unchanged since 980ba487 |
| `modules/postcard/safety.go` | `unsafeMarkupAt` = depth guard, `unsafeHTMLReading` (old loop), `unsafeTagReading` (quote-aware); shared `unsafeAttrs` | ✓ VERIFIED | Read in full diff. The tag reading tokenizes a same-length copy with `<!--` → ` !--` and calls `NextIsNotRawText()` after each `rawTextElements` start tag; it runs at every recursion depth. No exported API change (`--additive` passes) |
| `modules/postcard/safety_test.go` | end-tag-in-attribute refuse, send, editor, accept and parser-oracle cases | ✓ VERIFIED | PASS; `liveUnsafeElements` parses the sent HTML with `xhtml.ParseWithOptions`, scripting on and off |
| `modules/postcard/README.md`, `docs/services/mail.md` | one sentence on the quote-aware reading | ✓ VERIFIED | Present in both; `--docs` passed |
| `.planning/notes/2026-11-14-mail-url-scheme-check.md` | amended | ✓ VERIFIED | e47d4ae6 |
| Earlier artifacts | | ✓ VERIFIED | admin/, boardwalk/dist, go.mod/go.sum unchanged since c1e8e57e |
### Key Link Verification
| From | To | Via | Status | Details |
| ---- | --- | --- | ------ | ------- |
| `postcard/templates.go` | `postcard/safety.go` | `validateHTML` → `unsafeMarkup` → `unsafeMarkupAt` (recursive) | ✓ WIRED | only `rawUnsafeTag` runs first now |
| `postcard/safety.go` | `printContext` | `UnsafeText` → `validateHTML(printContext(esc))` | ✓ WIRED | |
| `postcard/mailer.go` | `postcard/safety.go` | `layoutSiteName` → `siteNameFrom` → `UnsafeText` | ✓ WIRED | |
| `cabana/mail_admin.go` | `postcard/safety.go` | `BeforeValidate` → `postcard.UnsafeText` | ✓ WIRED | |
| Earlier links (35-01..35-09) | | | ✓ WIRED | regression tests pass |
| `postcard/templates.go` | `postcard/safety.go` | `validateHTML` → `unsafeMarkup` → `unsafeMarkupAt` → `unsafeHTMLReading` + `unsafeTagReading` | ✓ WIRED | Both readings run on every call and at every depth |
| `unsafeHTMLReading`, `unsafeTagReading` | `unsafeAttrs` | direct call per start tag | ✓ WIRED | same handler/URL rules in both readings |
| `postcard/editor.go` | `validateHTML` | `Editor.Validate` | ✓ WIRED | probe 2 and `editor/*` subtests refuse the layouts |
| `postcard/mailer.go` | `validateHTML` | send-time check → file-version fallback | ✓ WIRED | probe 2 and probe 4 log "override failed, sending the file version" |
| `cabana/mail_admin.go` | `postcard.UnsafeText` | `BeforeValidate` | ✓ WIRED | `TestMailSiteNameSafety` PASS |
### Data-Flow Trace (Level 4)
| Artifact | Data Variable | Source | Produces Real Data | Status |
| -------- | ------------- | ------ | ------------------ | ------ |
| Layout header/footer | `siteName` | Branding row / mail.from via `siteNameFrom` | Yes | ✓ FLOWING (handler-shaped names now render) |
| Branding refusal | `site_name` | form → `BeforeValidate` → `UnsafeText` | Yes | ✓ FLOWING |
| Layout header/footer | `siteName` | Branding row / mail.from via `siteNameFrom` | Yes | ✓ FLOWING |
| Layout override HTML | rendered layout | `Overrides.Layouts` → render → `validateHTML` → driver | Yes | ✓ FLOWING (unsafe → file version) |
| Earlier flows | | | Yes | ✓ FLOWING |
### Behavioral Spot-Checks
@@ -400,18 +382,19 @@ No later roadmap phase covers the remaining gap: Phase 35 is the last numbered p
| Behavior | Command | Result | Status |
| -------- | ------- | ------ | ------ |
| vet | `go vet ./...` | clean | ✓ PASS |
| Full short suite (once) | `go test -short ./...` | all ok | ✓ PASS |
| postcard named tests | `go test -short ./modules/postcard -run '^(TestSiteNameSend\|TestUnsafeSiteNameDropped\|TestUnsafeText\|TestFooterSiteNameLiteral\|TestURLSchemeCheck\|TestInlineUnsafeOutput\|TestMailSafetySmoke\|TestInlineCSS\|TestInlineFailure\|TestOverride\|TestFallback\|TestTemplateFor\|TestSendLocaleFallback\|TestBuiltinLayoutsLogo\|TestHeaderFooterPartials\|TestButtonPartial\|TestSiteName)$'` | 17 PASS | ✓ PASS |
| cabana Postgres (Docker) | `go test ./modules/cabana -run '^(TestMailSiteNameSafety\|TestMailBrandSiteName\|TestMailLocaleGroups\|TestMailLayoutInlineOptOut)$' -v` | PASS; TestMailSiteNameSafety ran 7 subtests | ✓ PASS |
| postcard Docker smoke | `go test ./modules/postcard -run '^TestMailOverrideSmoke$' -v` | `fallback`, `locale_fallback` PASS | ✓ PASS |
| Full short suite (once) | `go test -short -count=1 ./...` | exit 0, 47 packages ok | ✓ PASS |
| postcard named tests | `go test -short ./modules/postcard -run '^(TestURLSchemeCheck\|TestSiteNameSend\|TestUnsafeSiteNameDropped\|TestUnsafeText\|TestFooterSiteNameLiteral\|TestInlineUnsafeOutput\|TestMailSafetySmoke\|TestInlineCSS\|TestInlineFailure\|TestOverride\|TestFallback\|TestTemplateFor\|TestSendLocaleFallback\|TestBuiltinLayoutsLogo\|TestHeaderFooterPartials\|TestButtonPartial\|TestSiteName)$' -v` | 17 PASS | ✓ PASS |
| New CR-02 residual subtests | `go test -short ./modules/postcard -run '^TestURLSchemeCheck$' -v` | 23 matching subtests PASS, 0 FAIL in the whole test | ✓ PASS |
| postcard Docker smoke | `go test -count=1 ./modules/postcard -run '^TestMailOverrideSmoke$' -v` | 11 subtests PASS incl. `fallback`, `locale_fallback` | ✓ PASS |
| cabana Postgres (Docker) | `go test -count=1 ./modules/cabana -run '^(TestMailSiteNameSafety\|TestMailBrandSiteName\|TestMailLocaleGroups\|TestMailLayoutInlineOptOut)$' -v` | 4 PASS | ✓ PASS |
| Gate stages | `check-phase35.sh --self-test`, `--docs`, `--marker`, `--additive`, `--consumers` | all exit 0 | ✓ PASS |
| Previous probe (re-run) | `go test -short -overlay .../scratchpad/probe/overlay.json ./modules/postcard -run TestZZVerifier -v` | CR-01: 8 sends + 2 prose sends `err=<nil>`; CR-02: all 9 payloads refused; noscript layout falls back (inline on/off); `Editor.Validate` refuses noscript layout; accepts templates under `Online=Shop` | ✓ PASS (gaps closed) |
| svg/title "containsJS" claim | probe2 `TestZZV2BodySend` | sent HTML holds `&lt;a href=&#34;javascript:...` (escaped text, raw HTML omitted by goldmark). Fixer's explanation confirmed | ✓ PASS |
| CR-02 residual (new) | probe2 `TestZZV2Validate`/`TestZZV2LayoutSend` (overlay2.json) | `validateHTML` nil for 8 end-tag-in-attribute payloads; `Editor.Validate` accepts 5 of 5 in a layout; with `DisableAutoInlineCSS` the noscript and svg/style payloads are sent with `href="javascript:alert(1)"` intact | ✗ FAIL (gap) |
| Parser reading of the residual | probe3 `TestZZV3Parse` (overlay3.json), `xhtml.ParseWithOptions` | svg/style → `svg:a href=javascript:alert(1)` with scripting on and off; noscript → `a href=javascript:` and `img onerror=` with scripting off | confirms live markup |
| Inlining on | probe4 `TestZZV4InlineOn` (overlay4.json) | premailer removes the svg style element; noscript remainder re-serialized as escaped text; no live href sent | incidental mitigation |
| Probe 1 (re-run) | `go test -short -overlay .../probe/overlay.json ./modules/postcard -run TestZZ -v` | CR-01 sends `err=<nil>`; CR-02 payloads refused; noscript layout falls back | ✓ PASS |
| Probe 2 (re-run, the open gap) | `-overlay .../probe/overlay2.json -run 'TestZZV2'` | `validateHTML` refuses 8/8 (was 0/8); noscript ×2 and svg/style layouts `fallback=true` with inlining on and off; svg title/textarea sent as escaped text. Body overrides carry no raw HTML (goldmark) | ✓ PASS (gap closed) |
| Probe 2 `liveJS=true` lines (svg title/textarea, opt-out) | sent HTML `<svg><title>&lt;a title="</title>" href="javascript:alert(1)">x</a></title>` | The probe's regex matches a substring. The text after `</title>` is a text node, and no `<a` start tag remains. `escaped_send/*` subtests parse the sent HTML (scripting on and off) and find no live unsafe attribute | ✓ PASS (probe false positive) |
| Probe 3 (re-run) | `-overlay .../probe/overlay3.json -run TestZZV3Parse` | the parser still builds live links from the raw payloads; `validateHTML` now refuses all three | ✓ PASS (refusal is correct) |
| Probe 4 (re-run) | `-overlay .../probe/overlay4.json -run TestZZV4` | with inlining on, both payloads now fall back by the check, not by premailer's side effects | ✓ PASS |
Probe files (scratchpad, not in the repo): `/tmp/claude-1000/-media-nvme-dev-golem15-summercms-io-summercms-summercms-go/0c86abd1-8e0c-485b-8ad1-fd321a8a0fda/scratchpad/probe/zz_verifier_probe_test.go`, `zz_verifier_probe2_test.go`, `zz_verifier_probe3_test.go`, `zz_verifier_probe4_test.go` in the same directory, with `overlay.json` .. `overlay4.json`.
Probe files (scratchpad, not in the repo): `/tmp/claude-1000/-media-nvme-dev-golem15-summercms-io-summercms-summercms-go/0c86abd1-8e0c-485b-8ad1-fd321a8a0fda/scratchpad/probe/zz_verifier_probe_test.go`, `zz_verifier_probe2_test.go`, `zz_verifier_probe3_test.go` and `zz_verifier_probe4_test.go` in the same directory, applied through `overlay.json`, `overlay2.json`, `overlay3.json` and `overlay4.json`.
### Probe Execution
@@ -419,74 +402,65 @@ No `scripts/*/tests/probe-*.sh` is declared or present for this phase, so this s
### Requirements Coverage
REQUIREMENTS.md has no row naming Phase 35 (`grep -c "Phase 35"` = 0). Plan `requirements:` values are review and decision IDs:
REQUIREMENTS.md has no row naming Phase 35. Plan `requirements:` values are review and decision IDs:
| Requirement | Source Plan | Description | Status | Evidence |
| ----------- | ---------- | ----------- | ------ | -------- |
| CR-01 | 35-08, 35-09, fix 2dbee305/31de2ff9 | site name never stops mail | ✓ SATISFIED | rows 11, 16, 17 |
| WR-01 (2026-11-13) | 35-08, 35-09 | literal footer | ✓ SATISFIED | row 20 |
| WR-05 | 35-08, 35-09 | decoded scheme check; inliner never stops mail | ✗ BLOCKED (partly) | encoding and inliner parts satisfied; opt-out layouts can ship the CR-02 residual payload |
| D-13 | 35-08 | unsafe URLs refused at save and send | ✗ BLOCKED (partly) | CR-02 residual (row 18) |
| WR-05 | 35-08, 35-09 | decoded scheme check; inliner never stops mail | ✓ SATISFIED | rows 8, 18, 19 |
| D-13 | 35-08 | unsafe URLs refused at save and send | ✓ SATISFIED | row 18 (CR-02 residual closed) |
| D-10, D-14 | 35-08 | Branding rules; a failing override never stops mail | ✓ SATISFIED | rows 11, 17 |
| D-21 | 35-09 | tests last, gate | ✓ SATISFIED | gate stages pass |
| Earlier D-01..D-25, G-35-1, G-35-8 | 35-01..07 | | ✓ SATISFIED | unchanged; G-35-1/G-35-8 still need the UAT re-test |
| Earlier D-01..D-25, G-35-1, G-35-8 | 35-01..07 | | ✓ SATISFIED | G-35-1/G-35-8 still need the UAT re-test |
| Orphaned | — | — | none | no REQUIREMENTS.md row maps to Phase 35 |
### Anti-Patterns Found
| File | Line | Pattern | Severity | Impact |
| ---- | ---- | ------- | -------- | ------ |
| 11 non-planning files changed in 980ba487..HEAD | — | TBD/FIXME/XXX/TODO/HACK in added lines | none found | — |
| `modules/postcard/safety.go` | `unsafeMarkupAt`, TextToken branch | re-check bounded by the tokenizer's raw-text end; text after a split start tag unchecked | 🛑 Blocker | row 18. This is the carried-forward CR-02 gap, the file was modified after the previous `verified:` timestamp, and the verifier's probes are deterministic evidence, so the re-verification evidence gate keeps it blocking |
| modules/, docs/, scripts/ lines added in c1e8e57e..HEAD | — | TBD/FIXME/XXX/TODO/HACK | none found | — |
No blockers. The previous blocker (`unsafeMarkupAt` bounded by the tokenizer's raw-text end) is resolved.
### Prohibitions
| Statement (plan) | Tier | Verdict | Flag |
| --------- | ---- | ------- | ---- |
| pact/postcard/cabana API changes additive only | automated | Holds: `--additive` passes against v0.6.3 | none |
| No new dependency, go.mod/go.sum unchanged | automated | Holds: empty diff since 980ba487 | none |
| admin/ and boardwalk/dist unchanged (35-08) | automated | Holds: empty diff since 980ba487 | none |
| Tests and gate never write a sibling repository | automated | Holds: both trees clean after `--consumers` | none |
| No sibling repository changed | judgment | Holds (LLM, non-authoritative) | unverified-prohibition, human review recommended |
| Nothing pushed or tagged | judgment | Holds: 106 ahead of origin/master, newest tag v0.6.4 | unverified-prohibition, human review recommended |
| Framework code, docs, tests name no consuming application | judgment | Holds: `--marker` passed; no consumer names in the changed files | unverified-prohibition, human review recommended |
| No new dependency, go.mod/go.sum unchanged | automated | Holds: empty diff since c1e8e57e | none |
| admin/ and boardwalk/dist unchanged (35-08) | automated | Holds: empty diff since c1e8e57e | none |
| Tests and gate never write a sibling repository | automated | Holds: both trees clean before and after `--consumers` | none |
| No sibling repository changed | judgment | Holds for this phase (LLM, non-authoritative); concurrent changes there belong to quick 261114-p5n | unverified-prohibition, human review recommended |
| Nothing pushed or tagged | judgment | Holds: 113 ahead of origin/master, newest tag v0.6.4 | unverified-prohibition, human review recommended |
| Framework code, docs, tests name no consuming application | judgment | Holds: `--marker` passed | unverified-prohibition, human review recommended |
| postcard does not import lagoon (35-01) | judgment | Deviates (`lagoon/attach`) | resolved: accepted in UAT row 10 |
### Human Verification Required
UAT rows 3, 4 and 10 stand as human evidence: the reset, drift and import code they exercised did not change. Rows 1 and 8 were issues whose fixes (35-05..35-07) were never re-tested. Rows 2, 5, 6, 7 and 9 passed before the safety check, the Branding save path, the mailer and the layouts changed, so each has a `retest_reason`. Run them after the gap below is closed or overridden:
UAT rows 3, 4 and 10 stand as human evidence, because the reset, drift and import code they exercised did not change. Rows 1 and 8 were issues whose fixes (35-05..35-07) were never re-tested, even though the gap records were since marked resolved. Rows 2, 5, 6, 7 and 9 passed before the safety check, the Branding save path, the mailer and the layouts changed, so each has a `retest_reason`. For rows 2, 5, 6, 7 and 9 the reason now also covers d6ac0aeb.
1. **Template list** (UAT 1 re-run, G-35-1).
2. **Preview** (UAT 8 scoped re-run, G-35-8): logo or name header, card, button, literal © footer on default and system.
3. **Customize and save a template**: re-test (save-time check changed).
3. **Customize and save a template**: re-test (save-time check changed, including the tag reading).
4. **Layout editor**: re-test (layout validation changed).
5. **Insert image into layout**: re-test (src check rewritten).
5. **Insert image into layout**: re-test (src check rewritten, now read twice).
6. **Branding**: re-test of UAT 7.
7. **Branding refusal on the demo instance**: script/data names refused with the new en/pl copy; `Online=Shop`, `Data:Lab`, `Big Data: Summit` saved and shown.
8. **Send test to me**: re-test (mailer, validateHTML and layouts changed).
9. **CR-01, CR-02, WR-02 safety-rule changes**: accept or reject, as 35-REVIEW-FIX.md requests.
9. **CR-01, CR-02 (with its residual fix) and WR-02 safety-rule changes**: accept or reject, including the over-refusal risk the tag reading accepts.
10. **Inlined mail in a real inbox**: colours survive when the style block is stripped.
11. **Judgment-tier prohibitions**: accept or reject.
### Gaps Summary
The fix round closed the CR-01 residual at its cause. The whole-document handler regex is gone, so text, including a site name such as `Online=Shop` printed after `© <year> ` and a variable such as `buy one = get one free`, can no longer stop a send. The re-run probe and the new tests confirm this on the default and system layouts, from Branding and from `mail.from`, and through the editor. The goal clause "mail that already works keeps working" now holds. WR-01 and WR-03 are fixed as well.
No gaps remain. Quick 261114-p5m closed the CR-02 residual at its cause. `unsafeMarkupAt` no longer trusts only the tokenizer's view of where a raw-text element or comment ends. After the existing HTML reading, it reads every tag again with attribute quoting alone deciding where the tag ends. That reading treats raw-text content as tags and recognises no comments, and it applies the same `unsafeAttrs` rules. Each reading is linear, and the existing depth limit bounds the recursion. All eight payloads the previous round reproduced are now refused by `validateHTML`. The layout payloads that would reach a client as live markup are refused by `Editor.Validate` and fall back to the file version at send with inlining on and off. The quick task pinned this with refuse, send, editor and parser-oracle tests. Every regression gate passes.
One gap remains: the **CR-02 residual** (row 18, partial). The fix re-checks a raw-text element's content as markup, but only the content up to where x/net/html's tokenizer ends that element. When the matching end tag appears inside a quoted attribute value, as in `<svg><style><a title="</style>" href="javascript:alert(1)">x</a></style></svg>`, the tokenizer ends the element early. The remainder of the tag, `href="javascript:alert(1)">`, then reaches the outer loop as plain text and is never checked. A conforming parser keeps the attribute together and builds a live `svg:a` link (and, with scripting off, live noscript links and handlers). `Editor.Validate` accepts such a layout. A layout that opts out of inlining sends it intact. With inlining on, go-premailer's re-serialization happens to defuse it, and template bodies are safe because Markdown leaves raw HTML out. This is the same threat class and the same exposure as CR-02: the author needs the layouts permission, and impact depends on the client. The README and docs/services/mail.md say this markup is checked, and the residual-risk notes do not mention it.
The cost of the fix is a documented over-refusal risk: an unbalanced quote in a comment or style element can make later attribute-shaped text count as an attribute. No shipped layout or consumer plugin trips it today. It is part of human item 9.
The fix is local to `unsafeMarkupAt`: add a markup reading that does not honour raw-text state (`z.NextIsNotRawText()` after each raw-text start tag, as a second pass), plus the five payloads as regression cases, an `Editor.Validate` refusal and an opt-out-layout send that falls back. That is one small fix plan plus a tests plan (the project rule puts tests last). If the developer accepts the residual instead, record it in the note's residual-risk section and the docs, then add an override:
```yaml
overrides:
- must_have: "The URL-scheme check of rendered HTML is anchored to URL-bearing attributes, style, comments and meta content after decoding, and javascript:/vbscript:/data: URLs are still refused at save and at send whether or not the layout opts out of inlining"
reason: "Raw-text end tag inside an attribute (svg style/title/textarea, noscript) accepted as residual risk: admin-authored layouts only, client-dependent; documented in .planning/notes/2026-11-14-mail-url-scheme-check.md"
accepted_by: "{name}"
accepted_at: "{ISO timestamp}"
```
With the gap closed or overridden, every automated check passes, and the status would be `human_needed` for the 11 items above.
All automated checks pass. Status is `human_needed` for the 11 items above.
---
_Verified: 2026-11-14T16:58:10Z_
_Verified: 2026-11-14T17:43:56Z_
_Verifier: Claude (msd-verifier)_