Context
During the exact-head review of PR #15440, a tracked-only git archive snapshot with dependencies and local config hydrated ran the named AgentOS journey twice and produced the same geometry failure. The trace showed an otherwise-mounted but unstyled app. In that same snapshot, running:
npm run build-themes -- -n -e dev -t all
made the unchanged E2E pass 1/1. Archived review evidence for PRs #15107 and #15208 records the same clean-extraction theme prerequisite. This is recurring test-harness friction, not a product regression.
The Problem
npm run test-e2e starts the source-mode dev server without ensuring the generated development theme assets exist and match the current SCSS.
Both required outputs are deliberately absent from a tracked-only checkout:
dist/development/css/**
resources/theme-map.json
When either is absent or stale, the browser can still mount the application far enough for geometry, visibility, and interaction assertions to execute against unstyled native-looking controls. The test then reports a deterministic product failure even though the same source passes once its canonical generated assets exist. Exact-head review evidence is therefore not hermetic: a clean snapshot can be less truthful than a developer checkout carrying old generated state.
Architectural Reality
The structure map places the ownership seam at the Playwright configuration layer: test/playwright/playwright.config.e2e.mjs is the ordinary E2E entrypoint and currently has no globalSetup.
.gitignore intentionally excludes dist/ and resources/theme-map.json.
src/worker/App.mjs loads the theme map and derives the CSS requests from it; missing assets change rendered geometry rather than reliably aborting the run.
buildScripts/build/themes.mjs is the canonical producer for both the development CSS and the map.
test/playwright/visual/globalSetup.mjs already proves that SCSS-versus-CSS freshness belongs in Playwright preflight, but its fail-loud golden policy must remain distinct.
harness/prepareAssets.mjs provides the sibling precedent for conditionally rebuilding missing or stale development assets.
ai/scripts/migrations/bootstrapWorktree.mjs runs the broader build for canonical worktrees, but raw exact-head exports intentionally bypass that whole-worktree bootstrap. The E2E command must still own its direct runtime prerequisites.
The Fix
- Give the ordinary E2E config a testable preflight that inspects both the development CSS tree and
resources/theme-map.json against the current SCSS sources.
- When either output is missing or stale, invoke the canonical non-interactive build exactly once:
npm run build-themes -- -n -e dev -t all.
- Revalidate both outputs before Playwright starts the web server/browser; fail loudly with the exact remedy if the builder exits successfully but leaves an incomplete state.
- Reuse or extract the existing freshness primitives where sibling placement stays cohesive; do not duplicate subtly different mtime policy across every harness.
- Preserve the visual suite's stricter fail-loud golden contract. Ordinary functional E2E may self-heal prerequisites; a visual baseline must never silently rebuild beneath a capture.
Acceptance Criteria
Verification Class
L1 unit witnesses for freshness/build decisions plus one L3 clean-export E2E proving that a formerly unstyled AgentOS journey reaches the browser with current themes.
Out of Scope
- Adding the ordinary E2E suite to CI.
- Weakening viewport, geometry, visibility, or interaction assertions.
- Auto-building themes for visual-golden runs.
- Repairing the adjacent
npm run cockpit fresh-checkout promise; that can consume a shared helper later if independently ticketed.
- Committing generated theme artifacts or sharing another checkout's
dist/.
Avoided Traps
- Do not make every E2E invocation rebuild unconditionally.
- Do not hide a failed or incomplete theme build and continue into browser assertions.
- Do not move this into reviewer prose or a review-only snapshot script; the executable E2E entrypoint owns its prerequisites.
- Do not collapse functional self-healing and visual-golden freshness into one policy.
- Do not treat “the app mounted” as proof that styling prerequisites loaded.
Decision Record impact
None. This repairs test-harness prerequisite materialization without changing runtime, public API, persistence, or cross-process authority.
Related
#11163 · #15179 · #15440
Origin Session ID: 019ee5c2-82ba-7b73-8812-df59106ff61a
Retrieval Hint: Playwright E2E clean exact-head export missing dist development CSS theme-map unstyled geometry globalSetup build-themes
Authored by Euclid (GPT-5, Codex Desktop). Unassigned for peer self-selection; this review-first cycle is not claiming the implementation lane.
Context
During the exact-head review of PR
#15440, a tracked-onlygit archivesnapshot with dependencies and local config hydrated ran the named AgentOS journey twice and produced the same geometry failure. The trace showed an otherwise-mounted but unstyled app. In that same snapshot, running:made the unchanged E2E pass 1/1. Archived review evidence for PRs
#15107and#15208records the same clean-extraction theme prerequisite. This is recurring test-harness friction, not a product regression.The Problem
npm run test-e2estarts the source-mode dev server without ensuring the generated development theme assets exist and match the current SCSS.Both required outputs are deliberately absent from a tracked-only checkout:
dist/development/css/**resources/theme-map.jsonWhen either is absent or stale, the browser can still mount the application far enough for geometry, visibility, and interaction assertions to execute against unstyled native-looking controls. The test then reports a deterministic product failure even though the same source passes once its canonical generated assets exist. Exact-head review evidence is therefore not hermetic: a clean snapshot can be less truthful than a developer checkout carrying old generated state.
Architectural Reality
The structure map places the ownership seam at the Playwright configuration layer:
test/playwright/playwright.config.e2e.mjsis the ordinary E2E entrypoint and currently has noglobalSetup..gitignoreintentionally excludesdist/andresources/theme-map.json.src/worker/App.mjsloads the theme map and derives the CSS requests from it; missing assets change rendered geometry rather than reliably aborting the run.buildScripts/build/themes.mjsis the canonical producer for both the development CSS and the map.test/playwright/visual/globalSetup.mjsalready proves that SCSS-versus-CSS freshness belongs in Playwright preflight, but its fail-loud golden policy must remain distinct.harness/prepareAssets.mjsprovides the sibling precedent for conditionally rebuilding missing or stale development assets.ai/scripts/migrations/bootstrapWorktree.mjsruns the broader build for canonical worktrees, but raw exact-head exports intentionally bypass that whole-worktree bootstrap. The E2E command must still own its direct runtime prerequisites.The Fix
resources/theme-map.jsonagainst the current SCSS sources.npm run build-themes -- -n -e dev -t all.Acceptance Criteria
test-e2espec without a manual theme build.theme-map.jsonartifact becomes tracked.Verification Class
L1 unit witnesses for freshness/build decisions plus one L3 clean-export E2E proving that a formerly unstyled AgentOS journey reaches the browser with current themes.
Out of Scope
npm run cockpitfresh-checkout promise; that can consume a shared helper later if independently ticketed.dist/.Avoided Traps
Decision Record impact
None. This repairs test-harness prerequisite materialization without changing runtime, public API, persistence, or cross-process authority.
Related
#11163 · #15179 · #15440
Origin Session ID:
019ee5c2-82ba-7b73-8812-df59106ff61aRetrieval Hint:
Playwright E2E clean exact-head export missing dist development CSS theme-map unstyled geometry globalSetup build-themesAuthored by Euclid (GPT-5, Codex Desktop). Unassigned for peer self-selection; this review-first cycle is not claiming the implementation lane.