SC-1 / D-05 (CR-01): cors:<profile> headers now reach every response of a profiled route. Router.wrap skips the cors entry in its middleware loop and wraps the recovered handler in r.corsProfiles[profile].profileMiddleware just inside recordPattern (modules/surf/router.go:483-485, fix commit 0723536). Verifier probe on HEAD c5d9a7b: [deny, cors:spa] 401, group Use(deny) + route cors:spa 401, nested group 401, handler panic 500 (JSON), middleware panic 500, raw-group panic 500, oversize body 413, throttle 429 all carry ACAO=https://www.example.com, ACAC=true, Vary: Origin; disallowed origin gets Vary: Origin only. The same probe against the pre-fix tree (0723536^) fails 7 of 11 cases.
finding
category
reason
evidence_status
WR-04 residual: credentialed allowed_origins https://*.co.uk loads (probe origins catch https://*.com and https://*, not multi-label public suffixes such as co.uk or com.pl)
security
Raised in this re-verification by a scratch probe of surf.LoadCORSConfig (https://*.co.uk -> no error; https://*.com, https://*, https://*example.com -> error). Plan 06's must-have names probe origins and the https://*.com example, and that contract holds; refusing public-suffix wildcards would need a public-suffix list (a new dependency) or an extra probe set. Operator must write such an entry deliberately. Resolve by adding probes such as https://cors-probe.co.uk / .com.pl, or accept and note in docs/services/routing.md.
scratch-probe output only; new scope relative to the carried-forward gap, not blocking
test
expected
why_human
Cookie refresh across real api/www subdomains in a browser. Deploy to staging with auth.cookie.domain set to the parent domain and cors:<profile> (or http.cors) credentialed for the www origin. Log in on www, wait past the access TTL.
The SPA reads the 401, the refresh call sends the cookie, the rotated cookie replaces the old one, the replayed old token answers 401.
Needs real DNS, TLS and a browser's cookie and CORS enforcement; httptest cannot reproduce SameSite/Domain handling.
test
expected
why_human
S3-compatible upload. Build with build.tags [summercms_s3], set storage bucket_url s3://...?endpoint=..., upload a public file, fetch it via storage.uploads.public_url and via /storage/uploads; try a protected (is_public false) upload with public_url set.
Both URLs serve the public file; the protected upload is refused with attach.ErrProtectedNeedsPrivateBucket (admin answers the opaque 500 and logs the reason).
Needs bucket credentials. Note deferred-items.md: the blob's stored Content-Type is the sniffed type.
test
expected
why_human
Live Nuxt purge. Save a menu entry and a FAQ entry in admin against a running Nuxt site using the 0.3.0/0.5.0 layers; for a proxied deployment set NUXT_SITE_CACHE_ALLOW_PROXIED=true.
The page updates without waiting for the 300 s SWR TTL; the app log shows 'cooler: site cache purged' after the save returned.
Needs a running Nuxt site and the app; purges are now asynchronous.
test
expected
why_human
Swagger UI under its new nonce-only CSP. Enable http.api_docs, open /api-docs in a browser.
The UI renders the spec with no CSP violations in the console (script-src is now only 'nonce-...').
Browser rendering; plan 06 (WR-06) tightened script-src, and whether the pinned swagger-ui-bundle 5.33.1 needs anything beyond nonce-tagged scripts is only observable in a browser. SRI values were checked automatically in the initial verification.
Phase 19.3: Framework transport and infrastructure for WavePath Verification Report
Phase Goal: The framework has the transport and infrastructure pieces a multi-client, multi-instance application needs: JWT cookie refresh across subdomains, credentialed CORS, a cache module with a Redis-backed rate-limit store, an S3 blob option, an OpenAPI page and Turnstile verification.
Mode: mvp (ROADMAP marks the phase mode: mvp, but the goal is not written as a user story; as in the initial report, this report uses standard goal-backward verification with a derived User Flow Coverage table. Run /msd mvp-phase 19.3 to restate the goal, or drop mode: mvp, to make the mode consistent.)
Verified: 2026-10-15T21:08:52Z (HEAD c5d9a7b, local master, not yet tagged or pushed: expected, the release follows verification)
Status: human_needed
Re-verification: Yes, after gap-closure plan 19.3-06
Re-verification Summary
Item
Previous (2026-10-15T20:45Z)
Now
Evidence
SC-1 / D-05, CR-01: cors:<profile> headers on refusals, 413, 500
✗ FAILED (partial)
✓ VERIFIED
Verifier probe (below) on HEAD: 11/11 PASS. Same probe on the pre-fix tree 0723536^: 7/11 FAIL. TestCORSProfileHeadersOnRefusals and TestCORSProfileVaryKeptWithHandlerVary are required by name in SURF_TESTS and passed in the gate
WR-01..WR-09 (warnings)
open
fixed, verified in code and by named tests
see Plan 06 must-haves
Previously verified must-haves (35)
✓
✓ no regressions
full gate with Docker green; cross-instance smokes and go test -short ./... green
Resolved gap (history)
The initial verification recorded one gap. Router.wrap composed cors:<profile> at its list position, inside the body limit and panic recovery. A guard listed before the profile, a guard on an enclosing group and a recovered 500 therefore answered without Access-Control-Allow-Origin, and the browser hid the 401 that starts the SPA's cookie refresh. Plan 06 (commit 0723536) resolves the profile through routeCORSProfile, skips the cors: entry in the middleware loop after the unknown-profile check, and wraps the recovered handler in r.corsProfiles[profile].profileMiddleware just inside recordPattern (modules/surf/router.go:417-485). bufferedResponse.commit now merges Vary through addVary instead of replacing it (router.go:837-852), so a handler's own Vary does not drop Vary: Origin. The docs say the profile applies whatever its position: docs/services/routing.md:101,271, modules/surf/README.md:31 and docs/architecture/request-lifecycle.md:40.
User Flow Coverage (derived; the goal is not a user story)
Flow: a SPA on www.example.com talks to an API on api.example.com run as several instances.
Step
Expected
Evidence
Status
Log in, get a cookie
httpOnly token cookie, Domain/SameSite/Secure from auth.cookie.*, Max-Age = refresh window; production refuses an insecure cookie
bouncer.Turnstile, surf factory; Turnstile 422/503 carry the profile's headers (TestCORSProfileHeadersOnRefusals/turnstile_*); boot warning without a secret (TestTurnstileEmptySecretWarnsAtBoot)
Goal Achievement
Observable Truths (roadmap success criteria)
#
Truth
Status
Evidence
SC-1
bouncer refresh issues a new httpOnly token cookie with configurable Domain/SameSite/Secure, blacklists the old JTI; 60-min TTL and 14-day refresh window are config keys; credentialed CORS for a configured SPA origin is available as middleware
✓ VERIFIED
Cookie half unchanged from the initial run and still green. CORS half: global http.cors (initial run) and now cors:<profile> decorate every response of the route; verifier probe 11/11 on HEAD, 7/11 FAIL on the pre-fix tree; credentialed wildcard/unanchored origins refused at boot (TestCORSCredentialedOriginRules, TestCORSAnchoredPatternNoSuffixMatch)
SC-2
Cache module with memory and Redis drivers; Redis-backed Store so rate limits hold across instances; Redis client decision note before code
✓ VERIFIED
Unchanged since the initial run; cooler suites and TestRateLimitParityDocker, TestRedisCacheDocker passed in the gate; TestRateLimitAcrossInstancesSmoke passed separately
SC-3
S3 blob driver selectable through framework config without the app importing it; /api-docs + /api-docs.json servable; Turnstile middleware available
✓ VERIFIED
Unchanged artifacts plus plan 06 hardening (WR-06, WR-07, WR-08), each pinned by a required test that passed in the gate (attach tests ran untagged and with -tags summercms_s3)
SC-4
Touched modules' READMEs and docs/ updated; new code has unit tests in the last plan
✓ VERIFIED
Plan 06 updated the surf, bouncer, lagoon and cooler READMEs and docs/services/{routing,authentication,storage,caching}.md, docs/architecture/request-lifecycle.md; TestDocsTree and docs:build --check passed in the gate's docs stage. Plan 06 commits its tests in 8d80580 (Task 6) after the fix commits, so the "unit tests last" rule holds for the gap-closure plan
Regression check: cooler required tests and Docker parity passed in this gate run
02 (cookies, CORS, Turnstile, api-docs)
7
7 ✓
D-05 previously failed, now VERIFIED (CR-01 closed)
03 (S3 tag, DiskExtension, public_url)
6
6 ✓
Regression check: build and attach tests (both tag modes) and TestStoreDiskExtension (Postgres) passed
04 (site-cache purge, plugins, layers)
7
7 ✓
Regression check: plugin Docker admin suites passed with the queued purge; three layers' shared files still byte-identical (gate cmp)
05 (tests, gate)
8
8 ✓
Gate still fail-closed on required names (lists include the plan 06 tests)
06 (gap closure)
8
8 ✓
See below
Plan 06 truths:
#
Truth (abridged)
Status
Evidence
1
CR-01: every response of a cors:<profile> route carries ACAO (exact origin), ACAC, Vary: Origin for 401/403 (route-before or group), 422/503 Turnstile, 429, 413, panic 500 (JSON and raw); disallowed origin gets Vary: Origin only; handler Vary merged
✓ VERIFIED
Verifier probe 11/11 (real HTTP server via httptest.NewServer); TestCORSProfileHeadersOnRefusals (11 subtests incl. Turnstile 422/503, 403) and TestCORSProfileVaryKeptWithHandlerVary passed in the gate
2
CR-01 gate and docs
✓ VERIFIED
scripts/check-phase19.3.sh:80 lists both tests in SURF_TESTS; docs lines cited above
3
D-04 / WR-04: credentialed wildcard-host, unanchored and probe-matching origins fail boot, globally and per profile; non-credentialed configs unchanged
D-03 / WR-05, WR-09: production refuses Secure resolving to false (set or inferred); zero CookieConfig writes Lax + Secure
✓ VERIFIED
cookie.go:111 error names auth.cookie.secure and app.url; TestLoadCookieConfigProductionInferredSecure, TestZeroCookieConfigDefaults, TestLoadCookieConfigErrors passed
5
D-17, D-12, D-18 / WR-06, WR-07, WR-08
✓ VERIFIED
apidocs.go:65-67,208; attach/store.go:42,136 returns ErrProtectedNeedsPrivateBucket after the argument checks, before the body is read; boot warning in bucket.go; Turnstile secret warning in BuildRouter; TestAPIDocsCSPNoHostSource, TestStoreProtectedNeedsPrivateBucket (both tag modes), TestTurnstileEmptySecretWarnsAtBoot passed
sitecache.go:109,115CheckRedirect: noRedirect → http.ErrUseLastResponse; enqueue/work/Wait (sitecache.go:212-275) keep one request in flight and one pending follow-up; cooler.go:119 waits in Close. TestSiteCachePurgeNoRedirect (redirect target receives 0 requests, 307 logged, token not logged), TestSiteCachePurgeAsyncCoalesced, TestSiteCachePurgeWaitAndClose, Docker TestSiteCacheBulkCommitCoalesced, TestSiteCacheAfterCommitOnly passed. Plugin commits change only test files (git show --stat)
7
D-11 / WR-03: layer purge route honours siteCache.allowProxied; shared files byte-identical with updated pins; caching docs pair remote https purge_url with the flag
✓ VERIFIED
purge.post.ts passes allowProxied (=== true or 'true') to authorizeSitePurge; sha256 of the shared files is identical in vue-faq-layer, vue-menu-layer, vue-journal-layer; layer TAP 24/37/170 pass, including "allowProxied lets a proxied request reach the token check"
8
Release precondition: gate --all green with Docker and names every new test; disposition records CR-01, WR-01..WR-09 fixed; nothing tagged or pushed before the human reply
✓ VERIFIED
Gate exit 0 (below). 19.3-REVIEW-DISPOSITION.md: 10 fixed, 11 info open. git tag --contains 0723536 empty; summercms.go 22 commits ahead of origin/master, no v0.1.28 on origin; plugins and layers each 1 commit ahead of origin with no tag on HEAD
Required Artifacts (plan 06)
Artifact
Expected
Status
Details
modules/surf/router.go
profile outermost; Turnstile boot warning
✓ VERIFIED
profileMiddleware applied at router.go:483-485
modules/surf/cors.go
credentialed origin rules with probe origins
✓ VERIFIED
cors-probe.invalid at cors.go:92-93
modules/surf/apidocs.go
nonce on every script tag
✓ VERIFIED
3 tags
modules/bouncer/cookie.go
production refusal, zero-config defaults
✓ VERIFIED
"resolves to false" at cookie.go:111
modules/lagoon/attach/store.go
protected-upload refusal
✓ VERIFIED
modules/cooler/sitecache.go
no-redirect client, queue, Wait
✓ VERIFIED
../vue-faq-layer/server/lib/siteCachePurge.ts (and two siblings)
allowProxied opt-in
✓ VERIFIED
byte-identical
scripts/check-phase19.3.sh
requires gap-closure tests
✓ VERIFIED
Artifacts from plans 01-05: unchanged status (✓ VERIFIED; cors.go upgraded from ⚠️ PARTIAL).
Key Link Verification (plan 06)
From
To
Via
Status
surf/router.go wrap
surf/cors.go
routeCORSProfile(rt) then r.corsProfiles[profile].profileMiddleware(h) after recovery, inside recordPattern
WIRED (probe confirms runtime effect)
scripts/check-phase19.3.sh
surf/cors_profile_test.go
SURF_TESTS names TestCORSProfileHeadersOnRefusals
WIRED (ran in the go stage: 29 surf tests passed)
cooler/sitecache.go
lagoon.AfterCommit
PurgeSiteCacheAfterCommit callback only calls p.enqueue
WIRED
cooler/cooler.go
cooler/sitecache.go
Handle.Close → h.purger.Wait(ctx)
WIRED
layer purge.post.ts
layer siteCachePurge.ts
authorizeSitePurge({..., allowProxied})
WIRED
Key links from plans 01-05: unchanged, WIRED.
Data-Flow Trace (Level 4)
Not applicable: no rendered dynamic data. The runtime flows (cookie → Refresh → blacklist; request → throttle → shared Redis counter; save → after-commit → queued purge POST; refusal → profile CORS headers) are each exercised by a passing test or the verifier probe.
scratch module outside the repo (replace to the repo), surf.Assemble + httptest.NewServer, profile spa credentialed for https://www.example.com
[deny,cors:spa] 401, [cors:spa,deny] 401, group Use(deny) + route cors:spa 401, group Use(cors:spa) > inner group Use(deny) 401, handler panic 500, [boom,cors:spa] middleware panic 500, raw-group panic 500, body.limit:16 64-byte POST 413, throttle 200 then 429: all ACAO=https://www.example.com, ACAC=true, Vary=Origin. Disallowed origin 401: no ACAO/ACAC, Vary=Origin. ALL PASS
✓ PASS
Same probe on the pre-fix tree (git archive 0723536^)
identical probe, replace to the extracted tree
7/11 FAIL (route-before 401, group 401, all three 500s, 429, disallowed-origin Vary)
discriminating, as expected
Credentialed wildcard validation
scratch module calling surf.LoadCORSConfig
https://*.example.com ok; https://*.com, https://*, https://*example.com refused; https://*.co.uk ok (Advisory)
✓ PASS (contract)
Cross-instance rate limit and cookie refresh smokes
go test -count=1 -run '^(TestRateLimitAcrossInstancesSmoke|TestCookieRefreshAcrossSubdomainsSmoke|TestCookieRefreshHandlerRotatesAndBlacklists)$' ./modules/surf ./modules/bouncer
all PASS (real Redis container)
✓ PASS
Regression, whole module (once)
go test -short -count=1 ./...
all packages ok
✓ PASS
examples/hello workspace module
cd examples/hello && go test -count=1 ./...
ok
✓ PASS
Probe Execution
No scripts/*/tests/probe-*.sh exist and no plan declares one. The phase gate was run by the verifier in its own process (above).
Requirements Coverage
REQUIREMENTS.md maps no IDs to phase 19.3 (no orphans). Phase-local IDs from PLAN frontmatter (plans 01-06):
Plans 01-05: verdicts from the initial run still hold (cooler imports, bouncer imports, Flush scope, byte-identical * CORS, Turnstile secret never logged, no new s3.* keys, Journal/menu/FAQ compatibility, test network scope).
Plan
Prohibition
Verdict
Evidence
06
No breaking change to Journal, menu, FAQ: exported cooler purge names/signatures, Journal aliases, plugin controllers unchanged; only plugin test files change
holds
plugin commits e52b286, 4b42978, 4f633f0 touch only *_test.go; PurgeSiteCacheAfterCommit and SiteCachePurger.Purge keep their signatures (Wait is additive); Journal alias tests passed. Note: the plugin tests now call SiteCachePurger.Wait, so the plugins need the v0.1.28 require bump before they build on origin without go.work (recorded in the SUMMARY handoff)
Framework code and docs never name a consuming application
holds
gate docs stage: "no consuming application named in framework lines since 2d352ff^"
06
Nothing pushed or tagged before the human's reply
holds
no tag contains 0723536; no v0.1.28 on origin; plugins and layers 1 commit ahead with untagged HEADs
06
IN-01..IN-11 not addressed
holds
disposition shows all 11 open
Anti-Patterns Found
No TBD/FIXME/XXX/TODO/HACK markers in files changed by plan 06 (the only match is the gate's TAP SKIP|TODO directive parser at scripts/check-phase19.3.sh:261). No stubs: every plan 06 change is exercised by a named test that ran.
File
Finding
Severity
Impact
modules/surf/cors.go
Credentialed https://*.co.uk-style wildcards (multi-label public suffix) still load
📋 Advisory
Needs a deliberate misconfiguration; outside plan 06's stated contract. See frontmatter advisory
19.3-REVIEW.md IN-01..IN-11
Info findings, open by design
ℹ️ Info
recorded in 19.3-REVIEW-DISPOSITION.md
deferred-items.md
S3 object Content-Type from sniff; Redis Remember outage latency; pre-existing gofmt/naming in older files
ℹ️ Info
follow-ups, unchanged
19.3-VALIDATION.md
still status: draft, nyquist_compliant: false
ℹ️ Info
/msd-validate-phase 19.3 can settle it
Advisory (New Scope, Unevidenced)
#
Finding
Category
Why Advisory
1
Credentialed wildcard on a multi-label public suffix (https://*.co.uk) passes boot validation
security
new scope relative to the carried-forward gap; only scratch-probe evidence; plan 06's contract (probe origins, https://*.com) holds
Human Verification Required
Cookie refresh across real subdomains. Deploy to staging with auth.cookie.domain set to the parent domain and cors:<profile> (or http.cors) credentialed for the www origin. Log in on www and wait past the access TTL.
Expected: the SPA reads the 401, the refresh call sends the cookie, the rotated cookie replaces it.
Why human: needs real DNS and TLS, and a browser's cookie and CORS enforcement.
Real S3/R2/MinIO upload. Build with build.tags: [summercms_s3], set bucket_url: s3://...?endpoint=..., upload, fetch via public_url and via /storage/uploads; try a protected upload with public_url set.
Expected: both URLs serve the public file; the protected upload is refused.
Why human: needs bucket credentials.
Live Nuxt purge. Save a menu entry and a FAQ entry in admin against a site on the new layer versions (set NUXT_SITE_CACHE_ALLOW_PROXIED=true behind a proxy).
Expected: the page updates without waiting for the 300 s SWR TTL; the purge is logged after the save returned.
Why human: needs a running Nuxt site and the app.
Swagger UI under the nonce-only CSP. Enable http.api_docs, open /api-docs.
Expected: the UI renders the spec with no CSP violations in the console.
Why human: browser rendering; WR-06 tightened script-src since the initial verification.
The initial report's item 5 (triage WR-01..WR-09) is settled: all ten CR/WR findings are fixed in 19.3-REVIEW-DISPOSITION.md.
Gaps Summary
No gaps. The one gap from the initial verification (SC-1 / D-05, CR-01) is closed in code, docs and gate. The verifier reproduced the earlier failure scenarios in a scratch module outside the repo: every case now carries the profile's headers on HEAD, and the same probe still fails on the pre-fix tree, so it actually tests the fix. The full gate passes with Docker required, and the earlier must-haves show no regression. The status is human_needed because four checks need real infrastructure or a browser. The release steps in the 19.3-06 SUMMARY handoff remain for the phase session: whole-phase docs, the v0.1.28 tag, the plugin require bumps and the layer tags. Until the plugins move to v0.1.28, their tests do not build on origin without go.work.
Verified: 2026-10-15T21:08:52ZVerifier: Claude (msd-verifier)