docs(35): re-verify after gap closure 35-08/35-09 - CR-01 residual and CR-02 open
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
---
|
||||
phase: 35-mail-templates-and-layouts-editor
|
||||
verified: 2026-11-13T21:30:50Z
|
||||
verified: 2026-11-14T15:23:23Z
|
||||
status: gaps_found
|
||||
score: 13/14 must-haves verified
|
||||
score: 18/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
|
||||
@@ -18,6 +18,10 @@ covered_files:
|
||||
- .planning/phases/35-mail-templates-and-layouts-editor/35-06-SUMMARY.md
|
||||
- .planning/phases/35-mail-templates-and-layouts-editor/35-07-PLAN.md
|
||||
- .planning/phases/35-mail-templates-and-layouts-editor/35-07-SUMMARY.md
|
||||
- .planning/phases/35-mail-templates-and-layouts-editor/35-08-PLAN.md
|
||||
- .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
|
||||
- admin/openapi/admin.json
|
||||
- admin/package-lock.json
|
||||
- admin/package.json
|
||||
@@ -137,6 +141,7 @@ covered_files:
|
||||
- modules/cabana/mail_permissions_postgres_test.go
|
||||
- modules/cabana/mail_routes.go
|
||||
- modules/cabana/mail_screens_smoke_test.go
|
||||
- modules/cabana/mail_site_name_postgres_test.go
|
||||
- modules/cabana/mail_test_send_postgres_test.go
|
||||
- modules/cabana/mail_unit_test.go
|
||||
- modules/cabana/messages.go
|
||||
@@ -187,8 +192,12 @@ covered_files:
|
||||
- modules/postcard/partials.go
|
||||
- modules/postcard/partials_smoke_test.go
|
||||
- modules/postcard/partials_test.go
|
||||
- modules/postcard/safety.go
|
||||
- modules/postcard/safety_smoke_test.go
|
||||
- modules/postcard/safety_test.go
|
||||
- modules/postcard/samples.go
|
||||
- modules/postcard/samples_test.go
|
||||
- modules/postcard/sitename_test.go
|
||||
- modules/postcard/store.go
|
||||
- modules/postcard/store_postgres_test.go
|
||||
- modules/postcard/templates.go
|
||||
@@ -196,284 +205,284 @@ covered_files:
|
||||
- modules/surf/serve.go
|
||||
- modules/surf/store_lookup_test.go
|
||||
- scripts/check-phase35.sh
|
||||
covered_digest: "v2:sha256:f4b2434769c05675324d4203048de747593a6027ea0f5084450f9ea23790f146"
|
||||
covered_digest: "v2:sha256:621fe9f6410fdd232b5b21c9b7b8b25050f32f17f113fa8f2ef654e1b2707c49"
|
||||
behavior_unverified: 0
|
||||
overrides_applied: 0
|
||||
re_verification:
|
||||
previous_status: human_needed
|
||||
previous_score: 12/12
|
||||
previous_status: gaps_found
|
||||
previous_score: 13/14
|
||||
gaps_closed:
|
||||
- "G-35-1: locale variants of one mail template are one admin record with a locale switcher (35-05, tests in 35-07); automated evidence green, visual re-run of UAT test 1 still owed"
|
||||
- "G-35-8 (framework part): built-in default/system/minimal layouts with logo-or-name header, card, footer, Branding site name, button partial, CSS inlining with opt-out (35-06, tests in 35-07); scoped visual re-run of UAT test 8 still owed"
|
||||
gaps_remaining: []
|
||||
- "CR-01 colon class: a site name with ordinary colon prose ('Metadata: Weekly' from mail.from, 'Big Data: Summit' from Branding) now renders in header and footer and sends on the default and system layouts on every render path (TestSiteNameSend PASS; verifier probe UnsafeText false for both)"
|
||||
- "CR-01 script-URL class: a site name holding javascript:/vbscript:/data: is dropped at render with a rate-limited warning, refused on the Branding form (422 on site_name, en/pl), and stored ones do not block saves or sends (TestUnsafeSiteNameDropped, TestMailSiteNameSafety PASS)"
|
||||
- "WR-01 (prior advisory): footer prints the site name literally (TestFooterSiteNameLiteral PASS)"
|
||||
- "WR-05 (prior advisory), contradiction part: an inlined result that fails the check is sent as its style-block version (TestInlineUnsafeOutput PASS); encoded href=\"javascript:...\" is refused with inlining on and off (TestURLSchemeCheck PASS)"
|
||||
gaps_remaining:
|
||||
- "Mail that already works keeps working / no Branding value stops mail on the built-in layouts: still FAILED for site names that begin with on<letters>= (CR-01 residual, reproduced by the verifier)"
|
||||
regressions:
|
||||
- "CR-01 (new in 35-06): a site name containing javascript:/vbscript:/data: (Branding Site name, or the display name of mail.from with no admin action) makes every send on the default and system layouts fail, including the file-version fallback; reproduced by the verifier"
|
||||
- "CR-02 (new in 35-08): replacing the whole-document scheme regex with a tokenizer-only walk lets javascript: URLs inside <noscript>, <xmp> and SVG <title>/<textarea>/<style> pass Editor.Validate and be sent; the pre-35-08 check (75669b34) refused them"
|
||||
gaps:
|
||||
- truth: "Mail that already works keeps working: an application that sends mail today keeps sending it after upgrading, and no admin-saved Branding value can stop mail on the built-in layouts (roadmap goal clause; 35-06 must-have 'Mail that works today keeps working'; 35-01 D-14 'a failing override never stops mail')"
|
||||
- truth: "Mail that already works keeps working: an application that sends mail today keeps sending it after upgrading, and no admin-saved Branding value can stop mail on the built-in layouts (roadmap goal clause; carried-forward CR-01 gap; 35-08/35-09 must-have)"
|
||||
status: failed
|
||||
reason: "35-06 began printing siteName (Branding Site name, falling back to the display name of mail.from) in the header and footer of the default and system layouts. Rendered HTML then goes through validateHTML, whose dangerousScheme regex `(?i)(?:javascript|vbscript|data):` matches any substring with no word boundary or attribute context. A sender such as `\"Metadata: Weekly\" <x@example.com>` or a Branding name such as `Big Data: Summit` makes Send return `postcard: rendered HTML contains a dangerous URL scheme` for every template on the default or system layout. The file version is no fallback: mailer.options carries the same siteName into it. At v0.6.3 the same mail.from sent fine, because default.htm printed no name. The Branding form accepts such a name (rules: nullable|max:255, BeforeValidate only trims), and Editor.Validate then refuses every template/layout save on those layouts. Verifier probe (go test -overlay, no source change): from_metadata, brand_big_data, layout default and layout system all return that error; minimal and plain names send. 35-07 pinned the unsafe-name behaviour as current (TestMailBrandSiteName/unsafe_name_current_behaviour) and left it open; no test covers the send path."
|
||||
reason: "CR-01 residual, reproduced by the verifier (overlay probe, no source change). UnsafeText(s) runs validateHTML(html.EscapeString(s)) on the name alone. The only check that can fire on escaped text is the whole-document eventHandler regex (?i)\\son[a-z]+\\s*= (templates.go:49, run at templates.go:830), which needs whitespace before 'on'. A trimmed name that starts with on<letters>= has none, so UnsafeText('Online=Shop') and UnsafeText('onboarding=team') are false: the Branding save accepts them (mail_admin.go:1810) and layoutSiteName keeps them. default.htm:5,34 and system.htm:9,39 print '© <year> <name>', which supplies the space; the rendered '<p>© 2026 Online=Shop</p>' matches the regex. Probe results: Send of acme.site::mail.hello (default) and acme.site::mail.notice (system) fails with 'error calling partial: postcard: rendered HTML contains event handlers' for Branding SiteName 'Online=Shop' and 'onboarding=team', and for mail.from '\"Online=Shop\" <x@example.com>' with no Branding (configuration alone, no admin action). Nothing is sent; the file version carries the same name, so there is no fallback. Editor.Validate of a template on the default layout under Branding 'Online=Shop' is refused ('draft layout: unsafe: ... © 2026 Online=Shop'). At v0.6.3 the same mail.from sent fine (default.htm printed no name). The trigger class is narrow, but it is the same failure mode the previous gap recorded, the docs promise a site name 'never stops a send' (postcard README:292, docs/services/mail.md:88), and no test covers a name whose risk depends on where it is printed (TestUnsafeText only checks names that already contain the space)."
|
||||
artifacts:
|
||||
- path: "modules/postcard/mailer.go"
|
||||
issue: "siteName()/options() pass any Branding or mail.from display name into every built-in layout render, file version included, so it can fail the safety check"
|
||||
- path: "modules/postcard/safety.go"
|
||||
issue: "UnsafeText checks the name out of context (line 25-27); the footer context '© <year> <name>' and the header span/alt contexts are not checked"
|
||||
- path: "modules/postcard/templates.go"
|
||||
issue: "dangerousScheme (line 45) is unanchored and runs over the whole rendered document, so plain text such as 'Big Data: Summit' counts as a URL scheme"
|
||||
- path: "modules/postcard/assets/default.htm"
|
||||
issue: "header partial and footer copyright print .siteName (system.htm does the same)"
|
||||
issue: "eventHandler regex (line 49) still runs over the whole rendered document, text included (line 830); it is what turns a site name into a send failure (WR-02 is the same root cause for body text)"
|
||||
- path: "modules/postcard/mailer.go"
|
||||
issue: "siteNameFrom/layoutSiteName rely on UnsafeText, so they pass an on<letters>= name into every built-in layout render, file version included"
|
||||
- path: "modules/cabana/mail_admin.go"
|
||||
issue: "MailBrandSetting site_name has no save-time check (Rules nullable|max:255, BeforeValidate trims only), so the Branding form stores a name that breaks sends and saves"
|
||||
issue: "MailBrandSetting.BeforeValidate (line 1810) accepts 'Online=Shop' because it reuses UnsafeText"
|
||||
missing:
|
||||
- "At render time, a site name never fails a send: drop (or neutralise) a name that would fail the safety check and log a rate-limited warning, on the override path and the file-version path"
|
||||
- "Save-time refusal on the Branding site_name field with a translated en/pl message (reuse the postcard check, e.g. an exported helper)"
|
||||
- "Regression tests: Send on default and system layouts with mail.from '\"Metadata: Weekly\" <x@example.com>' and with Branding SiteName 'Big Data: Summit' succeeds; Branding save of an unsafe name is a 422 on site_name; a template save under a previously stored unsafe name is not refused; replace TestMailBrandSiteName/unsafe_name_current_behaviour"
|
||||
- "Optional, same plan: anchor dangerousScheme to URL-bearing attribute values instead of the whole document (it also rejects body text like 'metadata:'); bundle WR-01 (site name parsed as Markdown in the footer) since it touches the same copyright line"
|
||||
- "Check the site name in the context the layouts print it (for example validateHTML of '<p>x '+esc+'</p><img alt=\"'+esc+'\">'), or better remove the cause: drop the whole-document eventHandler regex once the tokenizer walk covers raw-text elements (it already refuses every on* attribute), so text can never match"
|
||||
- "Regression tests: 'Online=Shop' and 'onboarding=team' through a Branding name and a mail.from display name on the default and system layouts, file-version, override and override-failure paths (TestSiteNameSend or TestUnsafeSiteNameDropped), plus TestUnsafeText and the cabana Branding save; if the regex is removed, a test that body text such as 'buy one = get one free' sends"
|
||||
- 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; WR-05)"
|
||||
status: failed
|
||||
reason: "CR-02, reproduced by the verifier (overlay probe, no source change), and a regression introduced by 35-08. unsafeMarkup (safety.go:98-145) uses xhtml.NewTokenizer without the parser, so after a noscript, title, textarea, xmp, noembed, noframes, plaintext or style start tag the rest of the element is one TextToken; only style text is inspected, and without entity decoding. Mail clients render with scripting off (noscript content is markup) and SVG/MathML title/textarea/style are foreign elements whose children are markup. Probe: validateHTML returns nil for '<noscript><a href=\"javascript:alert(1)\">', '<noscript><img src=\"x\"/onerror=alert(1)>', '<svg><title><a href=\"javascript:alert(1)\">', '<svg><textarea><a href=\"javascript:alert(1)\">', '<svg><style><a href=\"javascript:alert(1)\">' and '<xmp><a href=\"javascript:alert(1)\">'. Editor.Validate accepts a default-layout override with the noscript payload (the same payload outside noscript is refused), and Send delivers it with 'javascript:alert' intact, with inlining on and with DisableAutoInlineCSS. A template body override with the svg/title payload is sent with the URL intact too. The pre-35-08 validateHTML (75669b34) ran dangerousScheme over the whole document and refused every one of these unencoded payloads, so the gap closure weakened the D-13 guarantee. The author must hold the layouts or templates permission, and real exploitability depends on the mail client, but the phase's documented safety contract (postcard README:30, docs/services/mail.md:158) is false and the fix is local."
|
||||
artifacts:
|
||||
- path: "modules/postcard/safety.go"
|
||||
issue: "tokenizer-only walk: raw-text/RCDATA element contents are never re-tokenized; only inStyle text is checked, undecoded"
|
||||
missing:
|
||||
- "In unsafeMarkup, call z.NextIsNotRawText() after noscript, title, textarea, xmp, noembed, noframes, plaintext (and style, then check its CSS as text), or re-run unsafeMarkup on raw text of those elements; alternatively refuse noscript/plaintext/xmp outright in rawUnsafeTag"
|
||||
- "Add the six payloads above to TestURLSchemeCheck's refuses list, and a send through a layout override with inlining on and off"
|
||||
advisory:
|
||||
- finding: "WR-01: site name is rendered as Markdown in the footer partial (`*Acme*` becomes <em>, `Acme <Studio>` loses text, `[x](url)` becomes a link) while the header prints it literally"
|
||||
category: other
|
||||
reason: "35-REVIEW.md WR-01; admin-controlled input, cosmetic or consistency issue; fix alongside CR-01"
|
||||
evidence_status: "reported by code review probe; not re-run by verifier"
|
||||
- finding: "WR-02: EnsureLocaleRows takes the global advisory lock and upserts sibling rows inside ShowRecord/save transactions, which can deadlock with SyncIndex and makes a GET write"
|
||||
category: architectural
|
||||
reason: "35-REVIEW.md WR-02; self-heals (one side's savepoint absorbs the deadlock) but adds ~1s stalls; not goal-blocking"
|
||||
evidence_status: "code inspection by review; no reproducing test"
|
||||
- finding: "WR-03: mailLocales swallows TranslationWriter errors while running on the request transaction, so a failed optional-plugin query aborts the transaction and the template show returns 500"
|
||||
category: other
|
||||
reason: "35-REVIEW.md WR-03; conditional on a failing optional translation plugin"
|
||||
evidence_status: "code inspection by review; no reproducing test"
|
||||
- finding: "WR-04: two-letter fallback-locale rule resolves typos such as order-ok to the base template and rejects 3-letter or multi-subtag locales"
|
||||
category: other
|
||||
reason: "35-REVIEW.md WR-04; does not affect names that have files, so working mail is unaffected"
|
||||
evidence_status: "reported by code review probe"
|
||||
- finding: "WR-05: scheme check runs before entity decoding; with disable_auto_inline_css on, an admin-written layout with href=\"javascript:...\" passes; with inlining on, a post-inline failure stops the message, contradicting docs"
|
||||
- finding: "WR-01 (35-REVIEW 2026-11-14): list-valued (values, srcset), meta content, style and comment checks use dangerousScheme on the unstripped decoded value, so values=\"java	script:...\" and meta content=\"0;url=java	script:...\" pass (verifier probe confirms)"
|
||||
category: security
|
||||
reason: "35-REVIEW.md WR-05; requires an administrator with system.manage_mail_layouts to write the payload"
|
||||
evidence_status: "reported by code review probe"
|
||||
reason: "not a regression (the pre-35-08 whole-document regex did not match these encoded forms either); admin-authored payload; fold into the CR-02 fix by factoring stripURLSpace"
|
||||
evidence_status: "reproduced by verifier probe"
|
||||
- finding: "WR-02 (35-REVIEW): the whole-document eventHandler regex refuses ordinary text: Send with Name 'Ada, buy one = get one free' fails on default and system layouts"
|
||||
category: other
|
||||
reason: "pre-existing since v0.6.3 and recorded as accepted residual risk in the 2026-11-14 note; it is also the root cause of the CR-01 residual gap, so removing it there closes both"
|
||||
evidence_status: "reproduced by verifier probe"
|
||||
- finding: "WR-03 (35-REVIEW): UnsafeText refuses names such as 'Data:Lab' (verifier probe: true), which the docs' 'ordinary text with a colon' sentence implies are accepted"
|
||||
category: other
|
||||
reason: "a refused name is dropped, not a send failure; cosmetic and documentation accuracy"
|
||||
evidence_status: "reproduced by verifier probe"
|
||||
- finding: "IN-01..IN-03 (35-REVIEW): footer Markdown body branch not exercised by the partial editor; settings.go localizes every settings model's BeforeValidate error without a README line; CSS escapes bypass CSS scheme checks (accepted residual, docs unqualified)"
|
||||
category: other
|
||||
reason: "info-level; none affects whether mail sends"
|
||||
evidence_status: "code review; not re-run by verifier"
|
||||
- finding: "Earlier WR-02/WR-03/WR-04 of the 2026-11-13 review (advisory lock in request tx, swallowed TranslationWriter error, two-letter fallback rule) remain open"
|
||||
category: architectural
|
||||
reason: "outside the gap-closure diff; carried from the previous report's advisory list"
|
||||
evidence_status: "code inspection by review; no reproducing test"
|
||||
human_verified:
|
||||
- test: "Customize and save a template"
|
||||
uat_row: 2
|
||||
recorded_at: "2026-11-13T21:09:53.000Z"
|
||||
- test: "Reset to file version"
|
||||
uat_row: 3
|
||||
recorded_at: "2026-11-13T21:09:53.000Z"
|
||||
- test: "Drift notice"
|
||||
uat_row: 4
|
||||
recorded_at: "2026-11-13T21:09:53.000Z"
|
||||
- test: "Layout editor"
|
||||
uat_row: 5
|
||||
recorded_at: "2026-11-13T21:09:53.000Z"
|
||||
- test: "Insert image into layout"
|
||||
uat_row: 6
|
||||
recorded_at: "2026-11-13T21:09:53.000Z"
|
||||
- test: "Branding"
|
||||
uat_row: 7
|
||||
recorded_at: "2026-11-13T21:09:53.000Z"
|
||||
- test: "Send test to me"
|
||||
uat_row: 9
|
||||
recorded_at: "2026-11-13T21:09:53.000Z"
|
||||
- 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-01 gap closure
|
||||
human_verification: # pending human items, kept although status is gaps_found so they are not lost; run after the CR-01 residual / CR-02 gap closure
|
||||
- test: "Template list"
|
||||
expected: "On sm-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."
|
||||
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)"
|
||||
- test: "Preview"
|
||||
expected: "Scoped re-run: first reset the UAT overrides of golem15.user::mail.activate and golem15.user::mail.layouts.user; save Branding with a logo and a Site name; preview a template switched to the default layout and then 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)."
|
||||
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)."
|
||||
why_human: "Visual rendering of the built-in layouts in the admin preview (35-VALIDATION Manual-Only, G-35-8 framework part)"
|
||||
- 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: "modules/postcard/templates.go and modules/postcard/safety.go (save-time safety check) and modules/postcard/assets/default.htm changed after the UAT pass (2026-11-13T21:09:53Z)"
|
||||
- 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: "modules/postcard/editor.go, templates.go and safety.go (layout validation) changed after the UAT pass (2026-11-13T21:09:53Z)"
|
||||
- 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: "modules/postcard/safety.go replaced the src/href check that validates the inserted img after the UAT pass (2026-11-13T21:09:53Z)"
|
||||
- test: "Branding"
|
||||
expected: "Branding saves with a prose Site name; an unsafe Site name is refused with the translated message under the field (en and pl)"
|
||||
why_human: "Field-error rendering and copy in the embedded admin"
|
||||
retest_reason: "modules/cabana/mail_admin.go (BeforeValidate), modules/cabana/settings.go (error localization), phrasebook en/pl and modules/postcard/editor.go (brand preview) changed after the UAT pass (2026-11-13T21:09:53Z)"
|
||||
- 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, templates.go and the default/system layouts and footer partial changed after the UAT pass (2026-11-13T21:09:53Z)"
|
||||
- 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-07"
|
||||
expected: "Accept: no sibling repository changed (sm-user-plugin and sm-paymentgateway-plugin trees clean before and after the verifier's consumers run); nothing pushed or tagged (master is 75 commits ahead of origin, newest tag v0.6.4 predates the gap closure); 35-07 changed only tests, the gate script and planning docs"
|
||||
- test: "Confirm judgment-tier prohibitions of 35-05..35-09"
|
||||
expected: "Accept: no sibling repository changed (sm-user-plugin and sm-paymentgateway-plugin trees clean before and after the verifier's consumers run); nothing pushed or tagged (master is 95 commits ahead of origin, newest tag v0.6.4 predates the gap closures); 35-09 changed only tests, the gate script and planning docs; framework code, docs and tests name no consuming application"
|
||||
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-13T21:30:50Z
|
||||
**Verified:** 2026-11-14T15:23:23Z
|
||||
**Status:** gaps_found
|
||||
**Re-verification:** Yes. This report regenerates the stale 2026-11-13T13:43Z report after gap-closure plans 35-05 (G-35-1), 35-06 (G-35-8) and 35-07 (tests and gate). The previous report had no `gaps:` block, so every must-have was re-derived and re-checked.
|
||||
**Re-verification:** Yes. Second re-verification, after gap-closure plans 35-08 (fix) and 35-09 (tests) for the CR-01 gap of the 2026-11-13 report. The carried-forward gap got a full 3-level check; the previously passed truths got a regression check (named tests re-run). The 2026-11-14 code re-review (35-REVIEW.md, f1d22353) was checked independently against the code.
|
||||
|
||||
## Goal Achievement
|
||||
|
||||
ROADMAP has no Success Criteria block and `Requirements: TBD` for Phase 35. Must-haves are derived from the goal's clauses (Option C) and merged with the PLAN frontmatter truths of 35-01..35-07. Rows 1-10 and 14 group the 35-01..04 truths that the previous report verified; the verifier re-checked them for regressions. Rows 2, 3, 6-8, 11 and 12 carry the gap-closure truths.
|
||||
ROADMAP gives no Success Criteria for Phase 35 and `Requirements: TBD`, so must-haves are the goal's clauses (Option C) merged with the PLAN truths of 35-01..35-09. Rows 1-14 are the previous report's truths; rows 15-22 are the 35-08/35-09 truths.
|
||||
|
||||
### Observable Truths
|
||||
|
||||
| # | Truth | Status | Evidence |
|
||||
| --- | --- | --- | --- |
|
||||
| 1 | Administrators edit mail from Settings → Mail (templates, layouts, partials, branding, images) | ✓ VERIFIED | `mail_admin.go`/`backend_screens.go` unchanged in shape. UAT rows 2, 5, 7 and 9 passed. The cabana Postgres tests pass (below). |
|
||||
| 2 | Templates registered through `pact.HasMailTemplates` appear in the list, **one row per template** however many locales (G-35-1, supersedes D-05) | ✓ VERIFIED | `ListExtendQuery` keeps one representative row per `base_code`; `columns.yaml` has `customized_locales`; the locale filter is gone. `TestMailLocaleGroups/one_row_per_template` PASS (run by the verifier). The visual re-run of UAT test 1 is still owed (human item). |
|
||||
| 3 | The template form has a locale switcher. A locale without a file shows the default version and can be customized, reset and drift-tracked per locale. | ✓ VERIFIED | `LocaleVariantSwitcher.vue` (`data-locale-variant`) is rendered by `FormView.vue:714` from `meta.localeVariants` when there are 2 or more variants. `postcard.EnsureLocaleRows` is called from sync (`mail_admin.go:220`) and from the show hook (`:1971`). `TestMailLocaleGroups/{variants,fallback_shows_default_version,save_then_send,reset,drift_through_the_base_file,ids_outside_the_group,permissions_on_fallback_rows,locale_enabled_at_run_time}` PASS. The SPA switcher and FormViewMail tests pass (14/14). |
|
||||
| 4 | Each template can get a DB override of its subject and body; Reset restores the file version | ✓ VERIFIED | `TestOverride` and `TestFallback` PASS. `ResetOverride` accepts fallback codes (`TestEnsureLocaleRows` PASS). UAT rows 2 and 3 passed. |
|
||||
| 5 | Layouts are admin-editable records assigned to templates; predefined layouts default, system and minimal are seeded | ✓ VERIFIED | assets `default.htm`/`system.htm`/`minimal.htm`; layout form; UAT row 5 passed. `SyncIndex` mirrors the file layouts. |
|
||||
| 6 | Built-in layouts look finished: default and system have a logo-or-name header, the white card and the © footer; minimal shows the logo; the button partial is styled in all three (G-35-8 framework part) | ✓ VERIFIED | `default.htm` (`layout-default`, `partial "header"`, `inner-body`, footer). `system.htm` calls header and footer; the `.layout-system .content-cell` override is gone. `minimal.htm:12` prints the logo img. `TestBuiltinLayoutsLogo`, `TestHeaderFooterPartials` and `TestButtonPartial` PASS. The scoped visual re-run of UAT test 8 is still owed. |
|
||||
| 7 | Branding has a Site name; when it is empty, the display name of mail.from is used | ✓ VERIFIED | `Brand.SiteName`, migration `202611130002_mail_brand_site_name`, `siteName()` in `mailer.go:176`, and the `site_name` field in `mailbrandsetting/fields.yaml`. `TestSiteName` and `TestMailBrandSiteName/{saved_trimmed,max_length,preview,send}` PASS. |
|
||||
| 8 | CSS is inlined at render with a per-layout opt-out (file key, column, switch); an inliner failure never stops mail | ✓ VERIFIED | `inline.go` (go-premailer, panic recovery). `templates.go:705` `inlineHTML` runs unless `disableInline` is set. Migration `202611130003`. `TestInlineCSS`, `TestInlineCSSOptOut`, `TestInlineFailure` and `TestMailLayoutInlineOptOut/*` PASS. |
|
||||
| 9 | Images can be uploaded and placed in layouts and templates | ✓ VERIFIED | `GET/POST /mail/images`, `MailImagePicker.vue`, `insertImage.ts` (35-02/03, unchanged by the gap closure). UAT row 6 passed. |
|
||||
| 10 | postcard renders the override when one exists, otherwise the file; `<template>-<locale>` without a file resolves to own customization, then base customization, then base file | ✓ VERIFIED | `mailer.render` → `resolveTemplate` → `overrides(msg.Template)`, then the base. `TestSendLocaleFallback` and `TestTemplateFor` PASS. Names that have files are unchanged: the consumers stage passes. |
|
||||
| 11 | **Mail that already works keeps working**: no configuration that sends today, and no admin-saved Branding value, stops mail on the built-in layouts | ✗ FAILED | **CR-01, reproduced.** A site name containing `data:`/`javascript:`/`vbscript:` (for example mail.from `"Metadata: Weekly" <x@example.com>`, with no admin action, or Branding `Big Data: Summit`) makes `Send` fail on the default and system layouts, file version included. At v0.6.3 the same config sent fine. See Gaps. |
|
||||
| 12 | `check-phase35.sh` runs the consumers read-only through scratch `-modfile`, refuses dirty siblings, requires every new test by name; `--all` passes | ✓ VERIFIED | The verifier ran `--consumers` (user 2/2, paymentgateway 3/3 tests, both trees clean before and after), `--additive` (8 packages vs v0.6.3) and `--self-test`: all pass. `--all` PASS is reported by 35-07 and the orchestrator; the verifier did not re-run it. |
|
||||
| 13 | D-05 and D-10's inlining claim are superseded on record; the UI-SPEC carries C16 and the inlining/site-name copy; go-premailer is recorded before go.mod changed | ✓ VERIFIED | `.planning/notes/2026-11-13-mail-template-locale-groups.md` and `...-mail-layouts-css-inlining.md` exist. STACK.md row. The note commit `dcd0ae53` is an ancestor of the go.mod commit `d3207335`. `go.mod:43` pins v1.38.0. |
|
||||
| 14 | Permission split, test send to the signed-in admin only, sandboxed server-rendered preview (35-02/03) | ✓ VERIFIED | No regression: `TestMailLocaleGroups/permissions_on_fallback_rows` PASS, UAT row 9 passed, `mailTemplateDraft` only widened to codes `TemplateFor` resolves. |
|
||||
| 1 | Administrators edit mail from Settings → Mail (templates, layouts, partials, branding, images) | ✓ VERIFIED | Screens unchanged in shape; cabana Postgres tests pass; UAT rows 2, 5, 7, 9 passed earlier (re-test owed after 35-08 changes, see Human Verification) |
|
||||
| 2 | Templates appear one row per template (G-35-1) | ✓ VERIFIED | `TestMailLocaleGroups` PASS (re-run); visual re-run of UAT 1 owed |
|
||||
| 3 | Locale switcher; per-locale customize, reset, drift | ✓ VERIFIED | `TestMailLocaleGroups` subtests PASS (re-run) |
|
||||
| 4 | DB override of subject/body; Reset restores the file | ✓ VERIFIED | `TestOverride`, `TestFallback` PASS; UAT row 3 still valid (reset code unchanged) |
|
||||
| 5 | Layouts are editable records; default/system/minimal seeded | ✓ VERIFIED | assets present; `SyncIndex` unchanged |
|
||||
| 6 | Built-in layouts finished (header, card, footer, button) | ✓ VERIFIED | `TestBuiltinLayoutsLogo`, `TestHeaderFooterPartials`, `TestButtonPartial` PASS |
|
||||
| 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 since 35-03; re-test of UAT row 6 owed (src check rewritten) |
|
||||
| 10 | Override when present, else file; `<template>-<locale>` fallback | ✓ VERIFIED | `TestSendLocaleFallback`, `TestTemplateFor` 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 | ✗ FAILED | **CR-01 residual, reproduced.** Colon names now send, but Branding `Online=Shop`/`onboarding=team`, or mail.from `"Online=Shop" <x@example.com>` with no admin action, makes every default/system send fail: `error calling partial: postcard: rendered HTML contains event handlers`. `UnsafeText` checks the name alone; the footer's `© <year> ` adds the space the regex needs. See Gaps. |
|
||||
| 12 | `check-phase35.sh` gate: read-only consumers, new names required | ✓ VERIFIED | Verifier ran `--self-test`, `--additive` (8 packages vs v0.6.3) and `--consumers` (sibling trees clean after): all pass. `--all` not re-run by the verifier |
|
||||
| 13 | Decision notes recorded (D-05, D-10 superseded; 2026-11-14 scheme-check note) | ✓ VERIFIED | `.planning/notes/2026-11-14-mail-url-scheme-check.md` present, contains WR-05 and the residual-risk section |
|
||||
| 14 | Permission split, own-address test send, sandboxed preview | ✓ VERIFIED | no regression; `TestMailLocaleGroups/permissions_on_fallback_rows` PASS |
|
||||
| 15 | Sends on default and system succeed with mail.from `"Metadata: Weekly"` and Branding `Big Data: Summit` on file, override and override-failure paths; the name shows in header and footer | ✓ VERIFIED | `TestSiteNameSend` PASS; verifier probe `UnsafeText` false for both names |
|
||||
| 16 | A site name that would fail the safety check is left out at render with one rate-limited warning; send succeeds on every path and in the editor | ✗ FAILED | Holds for names `UnsafeText` catches (`TestUnsafeSiteNameDropped` PASS), but not for `Online=Shop`: it fails the check where it is printed, is not left out, and the send fails. Same root cause as row 11 |
|
||||
| 17 | Branding save of an unsafe name is a 422 on site_name (en/pl); template/layout saves under a stored unsafe name are not refused | ✗ FAILED | `TestMailSiteNameSafety` PASS (6 subtests, ran against Docker Postgres) for script-URL names, but `Online=Shop` saves, and then `Editor.Validate` of a template on the default layout is refused (`draft layout: unsafe: ... © 2026 Online=Shop`). Same root cause as row 11 |
|
||||
| 18 | URL-scheme check anchored to URL-bearing attributes, decoded; prose passes; `javascript:` URLs refused at save and send, inlining on or off | ✗ FAILED | Prose and encoded `href` forms correct (`TestURLSchemeCheck` PASS). **CR-02, reproduced:** `javascript:` inside `<noscript>`, `<xmp>`, SVG `<title>`/`<textarea>`/`<style>` passes `validateHTML` and `Editor.Validate`, and `Send` delivers it intact with inlining on and off. The pre-35-08 check refused these, so this is a regression. See Gaps |
|
||||
| 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 (WR-01) | ✓ VERIFIED | `TestFooterSiteNameLiteral` PASS; `footer.htm` `{{ if .text }}<p>{{ .text }}</p>` and layouts pass `"text" $copy` |
|
||||
| 21 | sm-user-plugin and sm-paymentgateway-plugin mail tests pass read-only | ✓ VERIFIED | `--consumers` passed, both trees clean |
|
||||
| 22 | 35-07 pin subtest gone; gate requires new names; IN-03 self-test uses `cmp` | ✓ VERIFIED | `unsafe_name_current_behaviour` not found in modules/; 8 new names in `check-phase35.sh`; `cmp -s` at line 621; `--self-test` passed |
|
||||
|
||||
**Score:** 13/14 truths verified (0 present but behavior-unverified)
|
||||
**Score:** 18/22 truths verified (0 present, behavior-unverified). The four failures share two root causes: rows 11, 16 and 17 come from the site-name context gap, and row 18 from the raw-text bypass.
|
||||
|
||||
### Deferred Items
|
||||
|
||||
| # | Item | Addressed In | Evidence |
|
||||
|---|------|-------------|----------|
|
||||
| 1 | G-35-8 plugin part: sm-user-plugin and sm-paymentgateway-plugin CTAs through the button partial, finished `user`/`paymentgateway` layouts, framework bump with `go mod tidy` | Plugin follow-up after the framework tag (user decision 2026-11-13; no roadmap phase) | 35-06-PLAN "Follow-ups", 35-VALIDATION "Deferred follow-up check", 35-UAT G-35-8 `closure_note`. The phase goal names "a few predefined layouts seeded", which are the framework's built-in layouts; plugin layouts live in sibling repos this phase must not change. This is informational, not counted as a gap. |
|
||||
| 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 `closure_note`. Informational, not a gap |
|
||||
|
||||
No later roadmap phase covers the two gaps. Phase 35 is the last numbered phase; only backlog phases 999.x follow, and none is about mail safety.
|
||||
|
||||
### Advisory (New Scope, Unevidenced)
|
||||
|
||||
| # | Finding | Category | Why Advisory |
|
||||
|---|---------|----------|--------------|
|
||||
| 1 | WR-01 site name parsed as Markdown in the footer | other | admin-controlled and cosmetic; bundle with the CR-01 fix |
|
||||
| 2 | WR-02 advisory lock and upserts inside show/save transactions (deadlock risk, writes on GET) | architectural | self-heals; no reproducing test |
|
||||
| 3 | WR-03 swallowed TranslationWriter error aborts the request transaction | other | conditional on a failing optional plugin |
|
||||
| 4 | WR-04 two-letter fallback rule (typos resolve, 3-letter locales skipped) | other | names that have files are unaffected |
|
||||
| 5 | WR-05 scheme check before entity decoding; opt-out path bypass | security | needs a layouts-permission admin to author the payload |
|
||||
| 1 | WR-01 (new review): `values`/`meta content`/style/comment checks skip whitespace stripping (`java	script:` passes) | security | Reproduced, but not a regression (the old regex missed it too); fold into the CR-02 fix |
|
||||
| 2 | WR-02 (new review): whole-document handler regex refuses body text such as `buy one = get one free` | other | Reproduced; pre-existing since v0.6.3 and accepted in the 2026-11-14 note. It is also the root cause of the row 11 gap |
|
||||
| 3 | WR-03 (new review): `UnsafeText("Data:Lab")` is true | other | Reproduced; a refused name is dropped, mail still sends |
|
||||
| 4 | IN-01..IN-03 (new review) | other | Info-level, no send impact |
|
||||
| 5 | Earlier WR-02/03/04 (2026-11-13 review) | architectural | Outside the gap-closure diff, still open |
|
||||
|
||||
### Required Artifacts
|
||||
|
||||
| Artifact | Expected | Status | Details |
|
||||
| -------- | ----------- | ------ | ------- |
|
||||
| `modules/postcard/store.go` | base_code migration, `EnsureLocaleRows`, site_name and inline-opt-out migrations | ✓ VERIFIED | migrations `202611130001..003` present; wired from cabana sync and the show hook |
|
||||
| `modules/postcard/templates.go` | `TemplateBase`, `Catalog.TemplateFor`, `resolveTemplate`, `inlineHTML` | ✓ VERIFIED | used by `mailer.render` and `editor.renderTemplate` |
|
||||
| `modules/postcard/inline.go` | go-premailer wrapper | ✓ VERIFIED | `inlineCSS` with panic recovery |
|
||||
| `modules/postcard/assets/default.htm`, `system.htm`, `minimal.htm`, `partials/header.htm`, `partials/footer.htm` | finished built-in layouts | ✓ VERIFIED | substantive; exercised by `TestBuiltinLayoutsLogo` (CR-01 lives in what they print, see Gaps) |
|
||||
| `modules/cabana/relation_field.go` | `RecordMeta.LocaleVariants` | ✓ VERIFIED | `localeVariants,omitempty`; in `admin.json` and `schema.d.ts` |
|
||||
| `admin/src/components/form/LocaleVariantSwitcher.vue` | switcher | ✓ VERIFIED | `data-locale-variant`; rendered by FormView |
|
||||
| `scripts/check-phase35.sh` | scratch-modfile consumers stage | ✓ VERIFIED | 21 `modfile` lines; requires `TestMailLocaleGroups`, `LocaleVariantSwitcher.test.ts` and the others |
|
||||
| `modules/postcard/{locale,layouts,inline}_test.go`, `locale_postgres_test.go`, `modules/cabana/mail_{locale,brand_layout}_postgres_test.go` | gap-closure tests | ✓ VERIFIED | all named tests pass (run by the verifier) |
|
||||
| `.planning/notes/2026-11-13-mail-template-locale-groups.md`, `...-mail-layouts-css-inlining.md` | decision notes | ✓ VERIFIED | present |
|
||||
| `modules/boardwalk/dist` | rebuilt admin | ✓ VERIFIED | `check-admin-dist.sh`: matches a fresh build |
|
||||
| -------- | -------- | ------ | ------- |
|
||||
| `modules/postcard/safety.go` | tokenizer scheme check, `func UnsafeText` | ⚠️ substantive with defects | exists, wired from `validateHTML` (templates.go:833), `siteNameFrom` (mailer.go:200) and cabana (mail_admin.go:1810); carries both gaps |
|
||||
| `modules/postcard/safety_smoke_test.go` | `TestMailSafetySmoke` | ✓ VERIFIED | passes |
|
||||
| `.planning/notes/2026-11-14-mail-url-scheme-check.md` | decision note, WR-05 | ✓ VERIFIED | present |
|
||||
| `modules/postcard/assets/partials/footer.htm` | `.text` argument | ✓ VERIFIED | plain-text branch in both sections |
|
||||
| `modules/postcard/sitename_test.go` | `TestUnsafeSiteNameDropped` etc. | ✓ VERIFIED (incomplete coverage) | passes; has no case for a name that is only unsafe in context |
|
||||
| `modules/postcard/safety_test.go` | `TestURLSchemeCheck` | ✓ VERIFIED (incomplete coverage) | passes; no raw-text-element payloads |
|
||||
| `modules/cabana/mail_site_name_postgres_test.go` | `TestMailSiteNameSafety` | ✓ VERIFIED | 6 subtests PASS |
|
||||
| `scripts/check-phase35.sh` | requires new names | ✓ VERIFIED | contains `TestMailSiteNameSafety` and the others |
|
||||
| Earlier artifacts (store, templates, inline, layouts, LocaleVariantSwitcher, dist) | | ✓ VERIFIED | no regression; dist, admin and go.mod unchanged since 75669b34 |
|
||||
|
||||
### Key Link Verification
|
||||
|
||||
| From | To | Via | Status | Details |
|
||||
| ---- | --- | --- | ------ | ------- |
|
||||
| `postcard/mailer.go` | `postcard/templates.go` | `resolveTemplate` for fallback-locale names | ✓ WIRED | `mailer.go:111`; `editor.go:214` |
|
||||
| `cabana/mail_admin.go` | `postcard/store.go` | `postcard.EnsureLocaleRows` at sync and show | ✓ WIRED | lines 220 and 1971 |
|
||||
| `admin/src/views/FormView.vue` | `LocaleVariantSwitcher.vue` | `meta.localeVariants` | ✓ WIRED | lines 272-273, 714-717 |
|
||||
| `postcard/templates.go` | `postcard/inline.go` | `inlineHTML` → `inlineCSS` unless opted out | ✓ WIRED | lines 705, 731-737 |
|
||||
| `postcard/mailer.go` | `assets/default.htm` | `siteName`/`year` layout keys | ✓ WIRED | `options()` sets both; also the source of CR-01 |
|
||||
| `postcard/store.go` | `mailbrandsetting/fields.yaml` | `site_name` column | ✓ WIRED | store read at `:356`; form field |
|
||||
| `scripts/check-phase35.sh` | `../sm-user-plugin`, `../sm-paymentgateway-plugin` | scratch `-modfile` | ✓ WIRED | verifier run: workspace resolves to this checkout, trees clean |
|
||||
| 35-01..04 links (NewDBSource, postcard.Migrations, HasMailPartials, Editor.Validate, cooler.Attempter, EditorFrom, /mail/preview, /mail/images) | | | ✓ WIRED | unchanged since the previous report; the regression tests pass |
|
||||
| `postcard/templates.go` | `postcard/safety.go` | `validateHTML` → `unsafeMarkup` | ✓ WIRED | templates.go:833; the raw `eventHandler` check still runs first (line 830) |
|
||||
| `postcard/mailer.go` | `postcard/safety.go` | `layoutSiteName` → `siteNameFrom` → `UnsafeText` | ✓ WIRED | mailer.go:158, 200, 215; editor.go:330 |
|
||||
| `cabana/mail_admin.go` | `postcard/safety.go` | `BeforeValidate` → `postcard.UnsafeText` | ✓ WIRED | mail_admin.go:1810 |
|
||||
| `assets/default.htm`, `system.htm` | `partials/footer.htm` | `partial "footer" "text" $copy` | ✓ WIRED | default.htm:5,34; system.htm:9,39 |
|
||||
| `scripts/check-phase35.sh` | new tests | GO_TESTS / DOCKER_TESTS names | ✓ WIRED | 8 names present |
|
||||
| Earlier links (35-01..35-07) | | | ✓ WIRED | unchanged; regression tests pass |
|
||||
|
||||
### Data-Flow Trace (Level 4)
|
||||
|
||||
| Artifact | Data Variable | Source | Produces Real Data | Status |
|
||||
| -------- | ------------- | ------ | ------------------ | ------ |
|
||||
| Templates list | representative rows + `customized_locales` | `system_mail_templates` grouped by `base_code` | Yes | ✓ FLOWING |
|
||||
| Locale switcher | `meta.localeVariants` | cabana show/save from group rows | Yes | ✓ FLOWING |
|
||||
| Fallback-locale send | template override | `MailOverrides(code)` then the base | Yes | ✓ FLOWING |
|
||||
| Layout header/footer | `siteName`, `logoUrl`, `year` | Branding row / mail.from / clock | Yes | ✓ FLOWING (unsafe names break the render: CR-01) |
|
||||
| Inlined HTML | style attributes | go-premailer over the rendered doc | Yes | ✓ FLOWING |
|
||||
| Layout header/footer | `siteName` | Branding row / mail.from via `siteNameFrom` | Yes | ✓ FLOWING (an `on<letters>=` name still breaks the render: row 11) |
|
||||
| Branding refusal | `site_name` | form → `BeforeValidate` → `UnsafeText` | Yes | ✓ FLOWING |
|
||||
| Earlier flows (list, switcher, fallback send, inlined HTML) | | | Yes | ✓ FLOWING |
|
||||
|
||||
### Behavioral Spot-Checks
|
||||
|
||||
| Behavior | Command | Result | Status |
|
||||
| -------- | ------- | ------ | ------ |
|
||||
| postcard gap-closure and regression unit tests | `go test -short ./modules/postcard -run '^(TestTemplateBase\|TestTemplateFor\|TestSendLocaleFallback\|TestBuiltinLayoutsLogo\|TestHeaderFooterPartials\|TestButtonPartial\|TestSiteName\|TestInlineCSS\|TestInlineCSSOptOut\|TestInlineFailure\|TestOverride\|TestFallback\|TestPartial\|TestBrand\|TestSample\|TestValidateDraft)$'` | 16 PASS | ✓ PASS |
|
||||
| pact pin | `go test -short ./modules/pact -run 'TestHasMailTemplates\|TestRowState'` | ok | ✓ PASS |
|
||||
| Fallback rows (Postgres) | `go test ./modules/postcard -run '^TestEnsureLocaleRows$'` | PASS | ✓ PASS |
|
||||
| Admin side of both gaps (Postgres) | `go test ./modules/cabana -run '^(TestMailLocaleGroups\|TestMailBrandSiteName\|TestMailLayoutInlineOptOut)$'` | 3 PASS, 17 subtests | ✓ PASS |
|
||||
| SPA switcher | `npm --prefix admin run test -- tests/form/LocaleVariantSwitcher.test.ts tests/form/FormViewMail.test.ts` | 14 passed | ✓ PASS |
|
||||
| Embedded admin | `scripts/check-admin-dist.sh` | matches a fresh build | ✓ PASS |
|
||||
| Core plugins unchanged | `scripts/check-phase35.sh --consumers` | passed, both sibling trees clean | ✓ PASS |
|
||||
| API additive | `scripts/check-phase35.sh --additive` | 8 packages vs v0.6.3 | ✓ PASS |
|
||||
| Gate self-test | `scripts/check-phase35.sh --self-test` | passed | ✓ PASS |
|
||||
| CR-01 probe | overlay test (scratchpad, no source change): Send with mail.from `"Metadata: Weekly" <x@example.com>` / Branding `Big Data: Summit` | default and system layouts: `rendered HTML contains a dangerous URL scheme`; minimal and plain names OK | ✗ FAIL (gap) |
|
||||
| vet | `go vet ./modules/postcard ./modules/cabana` | clean | ✓ PASS |
|
||||
| Full short suite | `go test -short ./...` (once) | all ok | ✓ PASS |
|
||||
| postcard gap-closure and regression tests | `go test -short ./modules/postcard -run '^(TestSiteNameSend\|TestUnsafeSiteNameDropped\|TestUnsafeText\|TestFooterSiteNameLiteral\|TestURLSchemeCheck\|TestInlineUnsafeOutput\|TestMailSafetySmoke\|TestInlineCSS\|TestInlineFailure\|TestOverride\|TestFallback\|TestTemplateFor\|TestSendLocaleFallback\|TestBuiltinLayoutsLogo\|TestHeaderFooterPartials\|TestButtonPartial\|TestSiteName)$'` | ok | ✓ PASS |
|
||||
| cabana Postgres (Docker) | `go test ./modules/cabana -run '^(TestMailSiteNameSafety\|TestMailBrandSiteName\|TestMailLocaleGroups\|TestMailLayoutInlineOptOut)$'`; `-v` confirms TestMailSiteNameSafety ran 6 subtests | ok | ✓ PASS |
|
||||
| Gate stages | `check-phase35.sh --self-test`, `--additive`, `--consumers` | all passed | ✓ PASS |
|
||||
| CR-01 residual probe | overlay test (scratchpad): `UnsafeText`, Send on default/system with Branding and mail.from `Online=Shop`/`onboarding=team` | `UnsafeText` false; all 8 sends fail `rendered HTML contains event handlers` | ✗ FAIL (gap) |
|
||||
| CR-02 probe | overlay test: `validateHTML`, `Editor.Validate` and Send through a default-layout override with noscript and svg/title payloads, inlining on/off | `validateHTML` nil for 6 payloads; Validate accepts; sent HTML contains `javascript:alert` in all 4 sends; control payload outside noscript refused | ✗ FAIL (gap) |
|
||||
| Regression baseline | `git show 75669b34:modules/postcard/templates.go` | old `validateHTML` ran `dangerousScheme` over the whole document, so it refused these payloads | confirms regression |
|
||||
|
||||
### Probe Execution
|
||||
|
||||
No `scripts/*/tests/probe-*.sh` is declared or present for this phase. N/A. The phase gate stages above were run directly.
|
||||
No `scripts/*/tests/probe-*.sh` is declared or present for this phase, so this step is N/A. The phase gate stages above were run directly.
|
||||
|
||||
### Requirements Coverage
|
||||
|
||||
REQUIREMENTS.md maps no IDs to Phase 35 (ROADMAP `Requirements: TBD`; the related I18N-03 and KERN-03 are already complete from earlier phases). Plans declare CONTEXT decision IDs and UAT gap IDs:
|
||||
REQUIREMENTS.md has no row naming Phase 35 (`grep -c "Phase 35"` = 0) and no `CR-01`/`WR-01`/`WR-05` IDs. The plan `requirements:` values are review and decision IDs:
|
||||
|
||||
| Requirement | Source Plan | Description | Status | Evidence |
|
||||
| ----------- | ---------- | ----------- | ------ | -------- |
|
||||
| D-01..D-25 | 35-01..04 | CONTEXT decision set | ✓ SATISFIED | previous report (25/25); regression tests green; D-05 superseded by note (35-05); D-10 inlining claim superseded (35-06) |
|
||||
| G-35-1 | 35-05, 35-07 | one record per template, locale switcher | ✓ SATISFIED (automated); visual re-run owed | Truths 2-3 |
|
||||
| G-35-8 | 35-06, 35-07 | finished built-in layouts, site name, inlining | ✓ SATISFIED for the framework part; plugin part deferred; visual re-run owed | Truths 6-8. CR-01 is a regression introduced by this work and tracked as its own gap |
|
||||
| D-06, D-07, D-13, D-16 | 35-05 | reset/drift per locale, Editor path | ✓ SATISFIED | TestMailLocaleGroups reset/drift/save_then_send |
|
||||
| D-10, D-11, D-12, D-14 | 35-06 | Branding, precedence, partials, fallback | ✗ BLOCKED in part | D-14 spirit ("a failing override never stops mail") is broken by CR-01: the file-version fallback fails too |
|
||||
| D-21 | 35-07 | unit tests last, gate | ✓ SATISFIED | gate stages pass |
|
||||
| Orphaned | — | — | none | no REQUIREMENTS.md row names Phase 35 |
|
||||
| CR-01 | 35-08, 35-09 | site name never stops mail | ✗ BLOCKED (partly) | colon and script-URL classes closed; `on<letters>=` class still stops mail (row 11) |
|
||||
| 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; raw-text bypass regressed (row 18) |
|
||||
| D-13 | 35-08 | unsafe URLs refused at save and send | ✗ BLOCKED | CR-02 |
|
||||
| D-10, D-14 | 35-08 | Branding rules; a failing override never stops mail | ✗ BLOCKED (partly) | row 11 (file-version fallback fails as well) |
|
||||
| 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 from the previous report |
|
||||
| Orphaned | — | — | none | no REQUIREMENTS.md row maps to Phase 35 |
|
||||
|
||||
### Anti-Patterns Found
|
||||
|
||||
| File | Line | Pattern | Severity | Impact |
|
||||
| ---- | ---- | ------- | -------- | ------ |
|
||||
| 52 files changed in the gap closure | — | TBD/FIXME/XXX | none found | — |
|
||||
| `modules/postcard/templates.go` | 45, 820 | unanchored `dangerousScheme` over the whole document, now fed configuration text | 🛑 Blocker | CR-01: the regex was there before this phase, but 35-06 made it reachable from config alone |
|
||||
| `modules/cabana/mail_admin.go` | ~1784-1806 | `site_name` with no safety check at save | 🛑 Blocker (same root cause) | stores a value that breaks sends and saves |
|
||||
| `modules/postcard/assets/partials/footer.htm` | 11 | `{{ markdown .body }}` on the site name | ⚠️ Warning | WR-01 |
|
||||
| `modules/cabana/crud.go` / `mail_admin.go` | ~562, ~1000, 1960-1977 | advisory lock inside request tx | ⚠️ Warning | WR-02 |
|
||||
| `modules/cabana/mail_admin.go` | 173-201 | error swallowed inside a Postgres tx | ⚠️ Warning | WR-03 |
|
||||
| `modules/cabana/mail_admin.go` | 518-525 | dead `scopeTemplates` | ℹ️ Info | IN-01 |
|
||||
| `modules/postcard/store.go` | — | imports `lagoon/attach` | ℹ️ Info | accepted by the human in UAT row 10 |
|
||||
| 25 non-planning files changed in 75669b34..HEAD | — | TBD/FIXME/XXX | none found | — |
|
||||
| `modules/postcard/safety.go` | 25-27 | site name checked out of print context | 🛑 Blocker | row 11 (carried-forward gap) |
|
||||
| `modules/postcard/templates.go` | 49, 830 | whole-document `\son[a-z]+\s*=` over text | 🛑 Blocker (same root cause) | turns the footer text into a send failure |
|
||||
| `modules/postcard/safety.go` | 98-145 | tokenizer without `NextIsNotRawText`; raw-text contents unchecked | 🛑 Blocker | row 18; file created after the previous `verified:` timestamp, and the verifier's probe is deterministic evidence |
|
||||
| `modules/postcard/safety.go` | 122-124, 136, 140 | `dangerousScheme` on unstripped values | ⚠️ Warning | advisory 1 |
|
||||
|
||||
### Prohibitions
|
||||
|
||||
| Statement (plan) | Tier | Verdict | Flag |
|
||||
| --------- | ---- | ------- | ---- |
|
||||
| pact/postcard/cabana API changes additive only (35-05, 35-06) | automated | Holds: `--additive` passes against v0.6.3 | none |
|
||||
| go-premailer exactly v1.38.0, note and STACK row before go.mod (35-06) | automated | Holds: `go.mod:43`; `dcd0ae53` is an ancestor of `d3207335` | none |
|
||||
| Tests and gate never write a sibling repository (35-07) | automated | Holds: both trees clean before and after the verifier's consumers run | none |
|
||||
| No sibling repository file changed (35-05, 35-06) | judgment | Holds (LLM, non-authoritative) | unverified-prohibition, human review recommended (Human item 4) |
|
||||
| Nothing pushed or tagged (35-05..07) | judgment | Holds: 75 ahead of origin, newest tag v0.6.4 predates the gap closure | unverified-prohibition, human review recommended (Human item 4) |
|
||||
| 35-07 changes no production code | judgment | Holds: `git diff 0e97113a..a3ce0974` outside .planning touches only tests and `check-phase35.sh` | unverified-prohibition, human review recommended (Human item 4) |
|
||||
| postcard does not import lagoon (35-01) | judgment | Deviates (imports `lagoon/attach`) | resolved: accepted by the human in UAT row 10 |
|
||||
| pact/postcard/cabana API changes additive only (35-08) | automated | Holds: `--additive` passes against v0.6.3; `modules/pact` unchanged since 75669b34 | none |
|
||||
| No new dependency, go.mod/go.sum unchanged (35-08, 35-09) | automated | Holds: empty diff since 75669b34 | none |
|
||||
| admin/ and boardwalk/dist unchanged (35-08) | automated | Holds: empty diff since 75669b34 | none |
|
||||
| Tests and gate never write a sibling repository (35-09) | automated | Holds: both trees clean after `--consumers` | none |
|
||||
| No sibling repository changed (35-08) | judgment | Holds (LLM, non-authoritative) | unverified-prohibition, human review recommended |
|
||||
| Nothing pushed or tagged (35-08, 35-09) | judgment | Holds: 95 ahead of origin/master, newest tag v0.6.4 | unverified-prohibition, human review recommended |
|
||||
| 35-09 changes no production code | judgment | Holds per diff of 35-09 commits (tests, gate, validation doc) | unverified-prohibition, human review recommended |
|
||||
| Framework code, docs, tests name no consuming application (35-08) | judgment | Holds: no consumer names in the 25 changed files | 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
|
||||
|
||||
Recorded UAT passes for rows 2-7, 9 and 10 stand as evidence (`human_verified`). `verification.uat-evidence` reports no covered file changed after the UAT file's last record time. The re-run of test 1 below exercises the save/reset/drift flow again on the grouped record. These items are pending and should run after the CR-01 gap closure:
|
||||
UAT rows 3, 4 and 10 stand as human evidence: the reset, drift and import code they exercised did not change. Rows 2, 5, 6, 7 and 9 passed before 35-08 changed the safety check, the editor, the Branding save path, the mailer and the layouts, so each carries a `retest_reason`. Rows 1 and 8 are still open issues from the first UAT. All items should run after the gaps below are closed:
|
||||
|
||||
### 1. Template list (UAT test 1 re-run)
|
||||
**Test:** On sm-demo-app rebuilt on this framework commit, open Mail templates, open a template, switch to a locale without a file, save it, switch back.
|
||||
**Expected:** One row per template with Customized locales; the Language switcher under the title; the unsaved-changes confirm when switching.
|
||||
**Why human:** Placement and readability in the embedded admin.
|
||||
|
||||
### 2. Preview (UAT test 8 re-run, scoped to built-in layouts)
|
||||
**Test:** Reset the UAT overrides of `golem15.user::mail.activate` and `golem15.user::mail.layouts.user`. Save Branding with a logo and Site name, then preview a template on the default and on the system layout with a body override calling the button partial.
|
||||
**Expected:** Logo header (or name), white card, styled button, © year + name footer.
|
||||
**Why human:** Visual rendering.
|
||||
|
||||
### 3. Inlined mail in a real inbox
|
||||
**Test:** Test-send a template in the default layout to a real webmail or Outlook inbox.
|
||||
**Expected:** The button and card keep their colours after the client strips the style block.
|
||||
**Why human:** Mail clients behave differently.
|
||||
|
||||
### 4. Judgment-tier prohibitions of 35-05..07
|
||||
**Test:** Confirm that no sibling repository changed, that nothing was pushed or tagged, and that 35-07 changed tests only.
|
||||
**Expected:** Accept. The verifier found no evidence against any of them.
|
||||
**Why human:** Judgment-tier items need explicit human resolution.
|
||||
1. **Template list** (UAT 1 re-run): one row per template, Language switcher, unsaved-changes confirm.
|
||||
2. **Preview** (UAT 8 scoped re-run): logo or name header, card, button, literal © footer on default and system.
|
||||
3. **Customize and save a template**: re-test (save-time check changed).
|
||||
4. **Layout editor**: re-test (layout validation changed).
|
||||
5. **Insert image into layout**: re-test (src check rewritten).
|
||||
6. **Branding**: re-test; also check the translated refusal under Site name in en and pl.
|
||||
7. **Send test to me**: re-test (mailer and layouts changed).
|
||||
8. **Inlined mail in a real inbox**: colours survive when the style block is stripped.
|
||||
9. **Judgment-tier prohibitions of 35-05..35-09**: accept or reject.
|
||||
|
||||
### Gaps Summary
|
||||
|
||||
One goal-blocking gap. The goal says postcard renders the override or the file "so mail that already works keeps working". The gap closure (35-06) made the built-in default and system layouts print a site name taken from Branding or, with no admin action, from the display name of `mail.from`. postcard's whole-document safety regex treats any `data:`, `javascript:` or `vbscript:` substring as a URL scheme. A sender name such as "Metadata: Weekly" or a Branding name such as "Big Data: Summit" therefore turns every send on those two layouts into an error. Password resets and other system mail on the default layout stop. The file-version fallback does not save the message, because it carries the same site name. The verifier reproduced this with an overlay probe that changed no source; the same configuration sends at v0.6.3. The Branding form accepts such a name, and every template or layout save on those layouts is then refused.
|
||||
The 2026-11-13 gap is closed for the cases it named. "Metadata: Weekly" and "Big Data: Summit" now send. Script-URL names are dropped at render and refused on the Branding form, and the footer prints the name literally. The 35-REVIEW.md re-review is right on both critical findings; the verifier reproduced each with overlay probes and changed no source file.
|
||||
|
||||
The trigger is narrow, but it comes from configuration alone and the failure is total, so this is FAILED rather than a warning. No later roadmap phase covers it. The fix is small and self-contained, enough for one gap-closure plan:
|
||||
- never let a site name fail a render (drop it, log a rate-limited warning);
|
||||
- refuse an unsafe name on the Branding field at save time;
|
||||
- add send-path regression tests for both sources.
|
||||
1. **CR-01 residual (goal-blocking, carried forward).** The goal clause "mail that already works keeps working" is still false for one class of names. `UnsafeText` checks the site name on its own, but the layouts print it after `© <year> `. A name that begins with `on<letters>=`, such as `Online=Shop` or `onboarding=team`, passes the check and is saved. In the footer it then matches the whole-document handler regex, and every send on the default and system layouts fails, file-version fallback included. Template saves on those layouts are refused too. The trigger can be a `mail.from` display name with no admin action, which is the failure mode the previous gap described. The class is narrow, but the failure is total, and the docs promise that a site name never stops a send. Fixing it means checking the name in its print context. Better: remove the raw `eventHandler` regex once the tokenizer covers raw-text elements, which also resolves WR-02.
|
||||
|
||||
Optionally, the same plan can anchor `dangerousScheme` to URL-bearing attributes and fix WR-01's Markdown footer, which builds the same copyright line.
|
||||
2. **CR-02 (regression introduced by 35-08, blocks a 35-08 must-have and D-13).** Replacing the whole-document scheme regex with a bare tokenizer hides `<noscript>`, `<xmp>` and SVG `<title>`/`<textarea>`/`<style>` contents from the check. Unencoded `javascript:` links inside them now pass save validation and are sent intact, with inlining on and off. The pre-35-08 check refused them. Only an administrator with the layouts or templates permission can author such a payload, and whether it can be exploited depends on the mail client, so on its own it does not stop an administrator from editing mail. It is still a weakening of the phase's documented safety contract, introduced by the gap closure itself. The fix sits in the same function (`z.NextIsNotRawText()` after those tags, plus whitespace stripping for WR-01).
|
||||
|
||||
Everything else in the goal is verified with fresh evidence:
|
||||
- G-35-1 (one record per template with a locale switcher, per-locale customize, reset and drift, send-time fallback);
|
||||
- the framework part of G-35-8 (finished layouts, site name, button partial, CSS inlining with opt-out);
|
||||
- the read-only consumers gate, with the core plugins' mail tests passing against this checkout.
|
||||
|
||||
The UAT re-runs of tests 1 and 8 and a real-inbox check remain human items. The plugin part of G-35-8 is deferred by user decision.
|
||||
Both fixes are in `modules/postcard/safety.go` and `templates.go`, with tests in `sitename_test.go`/`safety_test.go` and the cabana site-name test. One gap-closure plan for the fix plus a tests plan (the project rule puts tests last) would cover them. No later phase covers either gap. Everything else verified in the previous report still holds on fresh test runs.
|
||||
|
||||
---
|
||||
|
||||
_Verified: 2026-11-13T21:30:50Z_
|
||||
_Verified: 2026-11-14T15:23:23Z_
|
||||
_Verifier: Claude (msd-verifier)_
|
||||
|
||||
Reference in New Issue
Block a user