diff --git a/.planning/phases/35-mail-templates-and-layouts-editor/35-VALIDATION.md b/.planning/phases/35-mail-templates-and-layouts-editor/35-VALIDATION.md index 82844ccb..d178616a 100644 --- a/.planning/phases/35-mail-templates-and-layouts-editor/35-VALIDATION.md +++ b/.planning/phases/35-mail-templates-and-layouts-editor/35-VALIDATION.md @@ -60,6 +60,11 @@ created: "2026-11-06" | G-35-8 | CSS inlining: brand colour on the button, DOCTYPE kept, media query left in a style block, text part unchanged, safety check on the inlined output (an unsafe raw layout override falls back to the file), per-layout opt-out (file header key, override column, layout draft), inliner failure sends the un-inlined HTML with one warning per layout per minute | postcard unit | `go test -short ./modules/postcard -run '^(TestInlineCSS\|TestInlineCSSOptOut\|TestInlineFailure)$'` | ✅ 35-07 | ✅ green | | G-35-8 | Admin side: Branding site name (trimmed, max 255, preview and send header, no header row without name or logo); layout form inlining switch (file layout, reset to the file value, custom layout with the switch off) | cabana Postgres | `go test ./modules/cabana -run '^(TestMailBrandSiteName\|TestMailLayoutInlineOptOut)$'` | ✅ 35-07 | ✅ green | | G-35-8 | Core plugins still send their mail against this checkout with the go-premailer requirement, read-only: scratch `-modfile` copies (GOWORK=off, GOPROXY=off), framework resolves to this checkout, sibling trees clean before and after | unit (sibling repos) | `bash scripts/check-phase35.sh --consumers` (self-test plants the dirty-tree and modfile cases) | ✅ 35-07 | ✅ green | +| CR-01 | Site names on the send path: mail.from "Metadata: Weekly" and Branding "Big Data: Summit" show in the header, footer and text part of the default and system layouts on the file-version, override and override-failure fallback paths; an unsafe name (`javascript:alert(1)`, `Shop onclick=x`) is left out of every path with one value-free warning per source per minute and the send succeeds; editor saves and previews under a stored unsafe name are not refused; `postcard.UnsafeText` safe/unsafe texts | postcard unit | `go test -short ./modules/postcard -run '^(TestSiteNameSend\|TestUnsafeSiteNameDropped\|TestUnsafeText\|TestMailSafetySmoke)$'` | ✅ 35-09 | ✅ green | +| CR-01 | Anchored, decoded scheme check: prose ("metadata:", "Big Data: Summit", titles, scheme words in a query) passes; every URL-bearing attribute, srcset, style attribute and element, meta refresh and the `:`, `:`, `:`, `j`, tab- and newline-split spellings are refused; an inlined result that fails the check sends the style-block version | postcard unit | `go test -short ./modules/postcard -run '^(TestURLSchemeCheck\|TestInlineUnsafeOutput)$'` | ✅ 35-09 | ✅ green | +| CR-01 | Admin side: a Branding save of an unsafe site name is a 422 on site_name in en and pl and stores nothing; prose names save; the Branding preview drops an unsafe draft name; a name stored before the check never refuses a template or layout save or stops a send; a mail.from display name with a colon shows on the default and system layouts | cabana Postgres | `go test ./modules/cabana -run '^(TestMailSiteNameSafety\|TestMailBrandSiteName)$'` | ✅ 35-09 | ✅ green | +| WR-01 | The footer of the default and system layouts prints the site name literally and escaped (`*Acme*`, `Acme `, `[x](url)`): no emphasis, no HTML comment, no link; the header shows the same text and the text part's footer line the name verbatim; the footer partial's body argument stays Markdown | postcard unit | `go test -short ./modules/postcard -run '^TestFooterSiteNameLiteral$'` | ✅ 35-09 | ✅ green | +| WR-05 | The scheme check reads decoded attribute values: a layout override with `href="javascript:alert(1)"` falls back to the file version with inlining on and off, and the editor refuses it on content_html (CSS URLs on content_css); a failing inlined result is sent un-inlined with one warning per layout | postcard unit | `go test -short ./modules/postcard -run '^(TestURLSchemeCheck\|TestInlineUnsafeOutput)$'` | ✅ 35-09 | ✅ green | | UI | codeeditor keys, insertImage escaping, footer record actions, preview sandbox | SPA unit + browser | `npm --prefix admin run test -- MailPreview CodeEditor insertImage FormViewMail`; `npm --prefix admin run test:browser -- codeeditor` | ✅ 35-04 | ✅ green | | gates | OpenAPI/schema in sync; dist matches; docs identifiers exist | scripts | `scripts/check-admin-openapi.sh --check`; `scripts/check-admin-dist.sh`; `go test ./cmd/summer -run TestDocsTree` | ✅ | ✅ green | @@ -75,6 +80,7 @@ created: "2026-11-06" - [x] Update `modules/pact/capabilities_test.go` `TestRowStateValues` and attach absolute URL coverage — 35-04 Task 2 - [x] `scripts/check-phase35.sh` — 35-04 Task 1 - [x] Gap closure (G-35-1, G-35-8): `modules/postcard/{locale,locale_postgres,layouts,inline}_test.go`, `modules/cabana/mail_{locale,brand_layout}_postgres_test.go`, extended `admin/tests/form/{LocaleVariantSwitcher,FormViewMail}.test.ts`; `check-phase35.sh` requires every new name and runs the consumers through scratch modfiles — 35-07 +- [x] Gap closure (CR-01): `modules/postcard/sitename_test.go`, `modules/postcard/safety_test.go`, `modules/cabana/mail_site_name_postgres_test.go`; `check-phase35.sh` requires every new name and its self-test compares the planted consumer's go.mod (IN-03) — 35-09 --- @@ -87,11 +93,12 @@ created: "2026-11-06" | One admin entry per template with a locale switcher (UAT test 1 re-run) | G-35-1 | Placement and readability of the switcher and the Customized locales column in the embedded admin | On sm-demo-app rebuilt on this framework commit: open Mail templates, check one row per template with Customized locales, open a template, switch to a locale without a file, save it, switch back; re-run UAT test 1 in full | | Built-in layouts look finished (UAT test 8 re-run, scoped) | G-35-8 | Visual rendering of the layouts and the preview | On sm-demo-app: 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, then to the system layout, with a body override that calls the button partial (`{{ 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) | | Inlined mail in a real inbox | G-35-8 | Mail clients (webmail, Outlook) differ in what they keep of a style block | Test-send a template in the default layout to a real inbox; the button and card keep their colours with the style block stripped | +| Branding site name refusal | CR-01 | The field line under Site name in the embedded admin is visual | On sm-demo-app: type `javascript: Acme` as the Branding Site name and save; the refusal line shows under the field and nothing is saved. Type `Big Data: Summit` and save; it saves and shows in the preview header and footer | | Deferred follow-up check: plugin mail | G-35-8 (plugin part) | Deferred to the plugin follow-up after the framework tag (sm-user-plugin, sm-paymentgateway-plugin: framework bump, button partial in their templates, finished user/paymentgateway layouts keeping their names) | After the plugin follow-up ships: the activate CTA renders as a button and the user and paymentgateway layouts look finished | **G-35-8 status:** framework part closed by 35-05..35-07 (built-in layouts, logo, site name, button partial support, CSS inlining, consumers gate). Plugin part deferred: the plugin templates' CTA through the button partial, the replaced user/paymentgateway layouts and the plugins' framework bump wait for the plugin follow-up after the framework tag (deferred follow-up check above). -**Open item (not in 35-07's scope):** the Branding site name is not checked for a URL scheme at save time. A name holding `javascript:`, `vbscript:` or `data:` is saved; the rendered header then fails the safety check, so the preview refuses it (pinned by `TestMailBrandSiteName/unsafe_name_current_behaviour`) and sends in the built-in layouts fail until the name is changed. A save-time check is a follow-up. +**CR-01 status:** closed by 35-08 and 35-09. Site names are checked with `postcard.UnsafeText`: refused at Branding save (422 on site_name), left out at render with a warning, so no saved value can stop mail on the built-in layouts; the URL-scheme check reads decoded URL-bearing attributes only. Decision note `.planning/notes/2026-11-14-mail-url-scheme-check.md`. --- @@ -104,4 +111,4 @@ created: "2026-11-06" - [x] Feedback latency < 120s - [x] `nyquist_compliant: true` set in frontmatter -**Approval:** pending (gate green after 35-04 and again after 35-07 with the gap-closure tests; formal validate-phase may follow) +**Approval:** pending (gate green after 35-04, after 35-07 and after 35-09 with the gap-closure tests; formal validate-phase may follow)