test(01-10): wave-3 task-4 — harness A15+A16+A17 (onboarding flag observability + no-re-open settle + design-swap-readiness with @import probe); 24/24 GREEN
Plan 01-10 Wave 3: extends the UAT harness with three new page-side
assertions covering the onboarding contract + the canonical-tokens
design-swap-readiness invariant. UAT baseline 21 → 24 GREEN.
tests/uat/extension-page-harness.ts (page-side):
- assertA15 — chrome.storage.local 'onboarding-completed' === true +
'installed-at' is number. Verifies SW's openWelcomeIfFirstInstall
side-effects.
- assertA16 — 2s settle window; chrome.tabs.query welcome-tab count
delta === 0. Verifies flag-gating across SW respawns.
- assertA17 — 7 sub-checks covering: welcome.html parse + .welcome-hero
+ >=7 mokosh-keyed attrs + welcome.css canonical @import literal OR
inlined --mks-* evidence + (zero hex OR canonical resolved) + >=5
var(--mks-*) refs + bundled JS preserves populate plumbing +
getComputedStyle --mks-rec → rgb(178, 84, 61) (canonical D-04 Loom).
- window.__mokoshHarness surface extended with the three new methods;
type declaration + assignment + page-ready status text updated.
tests/uat/lib/harness-page-driver.ts (host-side):
- driveA15, driveA16, driveA17 — standard page.evaluate wrappers
matching driveA14 / driveA18..A22 idiom. driveA16 dominates the
new wall-clock budget (~2.1s for the settle window).
tests/uat/harness.test.ts (orchestrator):
- Drivers array interleaves A15/A16/A17 AFTER A14 + BEFORE A18.
A22's skip-gate no longer triggers (Plan 01-10 lands welcome.html;
A22 now exercises the substantive token-usage path).
- FORBIDDEN_HOOK_STRINGS unchanged at 12 entries (A15-A17 use only
chrome.tabs.query / chrome.storage.local.get / fetch / DOMParser /
getComputedStyle — all production-API surfaces).
DEVIATION (Rule 1 — auto-fix bug in plan-supplied check):
The plan's A17.6 spec used literal substring checks 'COPY[' and
'chrome.i18n.getMessage(' which fail against minified production
output. Vite/Rollup terser renames `COPY` → `f` (local variable
mangling) and welcome.ts's source uses optional chaining
`chrome?.i18n?.getMessage?.(` which doesn't match the verbatim
literal. Replaced with two minification-survivable witnesses:
1. 'welcome.page.title' — literal Object.freeze key (terser
preserves object-literal keys verbatim).
2. 'i18n' + 'getMessage' + 'welcomeHero' substring conjunction —
chrome global + property access + fallback key literal; all
three survive minification regardless of optional-chaining
insertion or rename.
Both witnesses prove the populate plumbing survives the build (the
ground-truth contract A17.6 enforces). The relaxed contract is
semantically equivalent — neither substring is load-bearing on its
own; both witness the same underlying invariant.
Verify (all GREEN):
- npm run test:uat: 24/24 assertions passed (A0 grep gate + A1..A14
+ A15..A17 + A18..A22 + A23).
- npx tsc --noEmit: clean.
- npm run build:test: clean; dist-test/assets/welcome-wB0e_R_n.js
bundled; harness page bundle includes new asserts.
- SKIP_BUILD=1 npx vitest run tests/background/no-test-hooks-in-prod-bundle.test.ts:
13/13 GREEN (Tier-1 grep gate; FORBIDDEN_HOOK_STRINGS at 12).
- Full vitest baseline preserved: 137 ex-grep-gate + 13 grep-gate
= 150 GREEN (Plan 01-10 target).
A17.7 canonical proof: getComputedStyle.color = 'rgb(178, 84, 61)' —
the @import '../shared/tokens.css' directive resolves through to the
canonical D-04 Loom palette --mks-madder-600 = #b2543d at runtime, as
the empirical proof Plan 01-12 must_have #9 path-B contract demands.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -77,6 +77,10 @@ import {
|
||||
driveA12,
|
||||
driveA13,
|
||||
driveA14,
|
||||
// Plan 01-10 Wave 3 — onboarding + design-swap-readiness
|
||||
driveA15,
|
||||
driveA16,
|
||||
driveA17,
|
||||
// Plan 01-12 Wave 6 — design integration assertions
|
||||
driveA18,
|
||||
driveA19,
|
||||
@@ -331,6 +335,21 @@ async function main(): Promise<number> {
|
||||
// notification ids state; no new SAVE dispatch — A13's already
|
||||
// exercised the SAVE path. Recording stays stopped after A14.
|
||||
{ name: 'A14', drive: driveA14 },
|
||||
// Plan 01-10 Wave 3 — onboarding + design-swap-readiness (read-only;
|
||||
// chained AFTER A14 + before A18 so A15/A16/A17 inspect the
|
||||
// welcome-page artifacts that A22's skip-gate test (Plan 01-12 Wave 6)
|
||||
// previously fell through. With Plan 01-10 landed, A22 no longer
|
||||
// skip-gates — it's a substantive token-usage check.
|
||||
// A15 — chrome.storage.local 'onboarding-completed' + 'installed-at'
|
||||
// A16 — 2s settle: no new welcome tabs spontaneously reappear
|
||||
// A17 — welcome.html parse + .welcome-hero + ≥7 mokosh-keyed +
|
||||
// welcome.css canonical @import or inlined tokens + zero hex
|
||||
// (or canonical resolved) + ≥5 var(--mks-*) + bundled JS
|
||||
// has COPY[ or chrome.i18n.getMessage(welcomeHero +
|
||||
// getComputedStyle --mks-rec probe resolves
|
||||
{ name: 'A15', drive: driveA15 },
|
||||
{ name: 'A16', drive: driveA16 },
|
||||
{ name: 'A17', drive: driveA17 },
|
||||
// Plan 01-12 Wave 6 — design integration assertions (read-only;
|
||||
// independent of A14). Chained here so they execute regardless of
|
||||
// the recording state machine; they only inspect static brand /
|
||||
@@ -340,7 +359,8 @@ async function main(): Promise<number> {
|
||||
// A20 — manifest:name resolves via chrome i18n
|
||||
// A21 — --mks-font-display resolves to Lora
|
||||
// A22 — welcome page tokens.css adoption (CONDITIONAL on 01-10
|
||||
// landing; auto-PASSes with skip-diagnostic on 404)
|
||||
// landing; with Plan 01-10 landed it executes the
|
||||
// substantive token-usage path rather than skip-gating)
|
||||
{ name: 'A18', drive: driveA18 },
|
||||
{ name: 'A19', drive: driveA19 },
|
||||
{ name: 'A20', drive: driveA20 },
|
||||
|
||||
Reference in New Issue
Block a user