feat(01-12): wave-6 task-1 — harness A18-A22 (font reachability + icon-distinct + manifest-i18n + Lora-resolved + welcome-tokens)

UAT harness extended with 5 new page-side assertions following the
01-13 Approach B pattern (page-side assertA* + host-side driveA*
wrapper + harness.test.ts orchestrator entry):

A18 — Lora WOFF2 reachable from harness page (font self-host MV3 CSP
  invariant). Walks document.styleSheets for the first @font-face rule
  referencing Lora, resolves the rebased asset URL (handles Vite's
  content-hashing), fetches, asserts byteLength >= 40_000 (subset Lora
  is ~49 KB) + WOFF2 signature 'wOF2'. 4 checks.

A19 — icons rasterized from Loom mark (not Bug A placeholders). Fetches
  icon128.png, parses IHDR bytes 24-25 (bit-depth + color-type),
  asserts (8, 6) RGBA vs the placeholder (16, 2) RGB. 2 checks.

A20 — manifest:name resolves via chrome i18n. Reads
  chrome.runtime.getManifest().name; asserts it matches EN extName
  'Mokosh — Session Capture' OR RU 'Mokosh — Запись сессии' (robust
  to whatever locale Chrome uses); explicitly checks no __MSG_
  placeholder leaks. 2 checks.

A21 — --mks-font-display resolves to Lora stack. Creates transient
  .mks-display-1 probe div, reads getComputedStyle.fontFamily,
  asserts the stack starts with 'Lora' or '"Lora"' (accommodates
  both quoted + unquoted forms across Chrome versions); explicitly
  checks no Newsreader leak (R2 substitution complete). 2 checks.

A22 — welcome page tokens.css adoption (CONDITIONAL on Plan 01-10).
  Skip-gate on missing welcome.html: catches both HTTP 404 AND
  network-layer fetch failure (Chrome extensions throw TypeError
  'Failed to fetch' for non-web_accessible_resources paths). On
  reachable: extracts <link rel=stylesheet> hrefs, fetches each,
  asserts >= 3 var(--mks-*) usages OR tokens.css reference. 1 check.

Companion changes:

- tests/uat/extension-page-harness.html gains `<link rel="stylesheet"
  href="../../src/shared/tokens.css">` so A18 + A21 have the @font-face
  rules + .mks-display-1 class + CSS custom properties resolvable via
  document.styleSheets + getComputedStyle. Vite's crxjs plugin handles
  the asset path rebasing at build:test time.

- tests/uat/lib/harness-page-driver.ts: driveA18..driveA22 wrappers
  following the established driveA8 pattern (page.evaluate → window.
  __mokoshHarness.assertXX). No new host-side fs/ffprobe primitives;
  all A18-A22 work is page-side.

- tests/uat/harness.test.ts: orchestrator drivers list extended with
  A18-A22 between A14 and A23. FORBIDDEN_HOOK_STRINGS UNCHANGED at 12
  entries post-Plan-01-14 (A18-A22 use production chrome.* + fetch +
  getComputedStyle exclusively; no new test-mode symbols).

Verification (this commit):
- npm run test:uat: 21/21 GREEN (was 16/16 post-01-14)
- SKIP_BUILD=1 npm test: 147/147 GREEN
- Tier-1 grep gate: 13/13 GREEN (no FORBIDDEN_HOOK_STRINGS growth)
- npx tsc --noEmit: clean
- npm run build + npm run build:test: both succeed

The chain of A1..A14 + A18..A22 + A23 runs in ~95 seconds end-to-end
under Puppeteer headless mode against the bundled Chrome at
~/.cache/puppeteer/chrome/linux-148.0.7778.167.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 07:41:51 +02:00
parent e8d2881874
commit b909c374cc
4 changed files with 552 additions and 2 deletions

View File

@@ -77,6 +77,13 @@ import {
driveA12,
driveA13,
driveA14,
// Plan 01-12 Wave 6 — design integration assertions
driveA18,
driveA19,
driveA20,
driveA21,
driveA22,
// Plan 01-14 — picker-narrowing constraint
driveA23,
getManifestVersion,
} from './lib/harness-page-driver';
@@ -324,6 +331,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-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 /
// i18n / token / icon surfaces.
// A18 — Lora WOFF2 reachability + size floor
// A19 — icons NOT the Bug A placeholders
// 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)
{ name: 'A18', drive: driveA18 },
{ name: 'A19', drive: driveA19 },
{ name: 'A20', drive: driveA20 },
{ name: 'A21', drive: driveA21 },
{ name: 'A22', drive: driveA22 },
// Plan 01-14 A23: read-only inspection of the last getDisplayMedia
// constraints object captured by A2's setupFreshRecording. Verifies
// the production call at src/offscreen/recorder.ts:270 passes