feat(04-06): A35 live-DOM inline-SVG harness check + A17.8 raw-source update + back-patch

Closes the iter-2 BLOCKER 1 resolution end-to-end: the inline-SVG
strategy now has HONEST automated coverage at two layers — source
contract (Task 1 unit tests + the narrowed A17.8 source-bundling
grep) and live-DOM cascade (the NEW host-side A35 harness assertion
that opens welcome.html as a real Puppeteer tab).

- tests/uat/extension-page-harness.ts (A17.8 NARROWED HONESTLY):
  swap the data:image/svg+xml URL-grep + .svg filename-grep target
  for a raw-source grep — A17.8 now asserts the welcome chunk JS
  contains the raw SVG signature `stroke="currentColor"` AND the
  canonical `viewBox="0 0 32 32"` (the `?raw` import's output). The
  explanatory comment block now DISAVOWS the live-DOM claim and
  points at the NEW A35 driver for the runtime injection + cascade
  proof. A17.8 is honest source-bundling only.
- tests/uat/lib/harness-page-driver.ts (NEW host-side driveA35):
  appended LAST per the iter-2 ADV-2C concern (any driver-pollution
  worry is moot since nothing reads A35's return value, AND
  welcomePage.close() in finally guarantees no tab leak). driveA35
  opens chrome-extension://<id>/src/welcome/welcome.html in a fresh
  browser.newPage() tab, waits for the `.welcome-hero__mark svg`
  selector at DOMContentLoaded, then runs a single page.evaluate()
  that reads four signals: A35.1 inline <svg> present, A35.2
  stroke=currentColor, A35.3 getComputedStyle().stroke resolves to
  a non-default colour (the real cascade proof), A35.4 no legacy
  <img> in the slot. Host-side pattern mirrors driveA32/A33/A34.
- tests/uat/harness.test.ts (orchestrator wiring):
  + driveA35 added to the import block from './lib/harness-page-driver'.
  + driveA35Wrapped closure capturing handles.browser + handles.extensionId
    (alongside driveA33Wrapped/driveA34Wrapped).
  + { name: 'A35', drive: driveA35Wrapped } appended as the LAST
    entry of the `drivers` array. Total auto-increments via
    `drivers.length + 1` (line 580) — no hardcoded count to bump.
  + Architecture banner string (line 283) refreshed with A33, A34,
    A35 inline (ADV-2A cosmetic advisory — banner was already stale
    pre-04-06; A33+A34 added at the same time).
- .planning/phases/01-stabilize-video-pipeline/01-07-SUMMARY.md
  (back-patch, DEFECT 2 resolution):
  Flipped 5 lines (22, 47, 82, 135, 205) that carried the now-stale
  "deferred to Phase 5" framing for cursor visibility — the
  `cursor: 'always'` constraint was opportunistically shipped in
  Plan 01-09 (recorder.ts:285) and is verified by Plan 04-06 Task 1
  (tests/build/cursor-visibility.test.ts). Each flip is surgical
  (single line / single bullet, with explicit "back-patched in
  Phase 4 Plan 04-06" citation). Historical commit-description
  lines 40, 89, 109, 110 are LEFT unchanged — they describe what
  the Phase-1-closure commits literally did at the time, not
  forward-looking deferrals.
- .planning/phases/04-harden-clean-up-optional/deferred-items.md
  (correction, BLOCKER 2 resolution):
  Corrected the misdiagnosed entry from commit 6a989e8. The prior
  entry named tests/build/strict-meta-json-validation.test.ts as
  failing on a clean tree — that diagnosis was WRONG (the test is
  8/8 GREEN in isolation). The real root cause is the pre-existing
  04-CONTEXT #9 + #10 parallel-vitest / ffprobe-timeout flake
  family (lands non-deterministically on whichever ffprobe / race
  test loses the worker race; observed instance this session was
  tests/background/webm-remux.test.ts > ffprobe -count_frames,
  which is also 5/5 GREEN in isolation). True clean baseline is
  184/184 GREEN; 188/188 after Plan 04-06's +4 new tests.

Gates run:
- npx tsc --noEmit exit 0.
- npm run build:test exit 0; dist-test/assets/welcome-CMygHJ_J.js
  carries the raw SVG source.
- HEADLESS=1 SKIP_PROD_REBUILD=0 SKIP_LONG_UAT=1 npm run test:uat:
  36/36 UAT assertions GREEN (was 35/35; +A35). A17.8 PASS:
  currentColorStroke=true, canonicalViewBox=true. A35 live-DOM
  probe: svgPresent=true strokeAttr=currentColor
  computedStroke="rgb(250, 247, 241)" (linen-50, the
  --mks-fg-inverse value flowing through the cascade — the
  currentColor strategy WORKS in real Chrome) imgPresent=false.
- All Task 3 acceptance greps PASS: driveA35 count in
  harness-page-driver.ts=5, in harness.test.ts=6; name:'A35'=1;
  getComputedStyle=6; stroke="currentColor" in
  extension-page-harness.ts=4; data:image/svg+xml=0 (grep target
  and comment refs both removed).

References:
- 04-06-PLAN.md iter-2 BLOCKER 1 + BLOCKER 2 resolutions.
- .planning/phases/04-harden-clean-up-optional/04-UI-SPEC.md
  §"Implementation amendment" (Option A currentColor + inline-SVG).
This commit is contained in:
2026-05-26 08:48:43 +02:00
parent c4161431e7
commit 3f8e31a329
5 changed files with 235 additions and 50 deletions

View File

@@ -19,7 +19,7 @@ affects:
- Phase 2 (DOM + event-capture privacy) — capture pipeline is now always-on regardless of active tab; Phase 2 content scripts MUST NOT add competing keepalives (port `'video-keepalive'` keeps SW alive)
- Phase 3 (export pipeline + popup state machine) — popup will consume `getSegments()` output via the existing SW port host
- Phase 4 (SPEC §10 smoke verification) — Phase 4 verifies the full 9-criterion sweep; Phase 1 only proved #2/#3/#7
- Phase 5 (P1/P2 hardening) — new entry: `getDisplayMedia` cursor visibility constraint (`video: { cursor: 'always' }`)
- `getDisplayMedia` cursor visibility constraint (`video: { cursor: 'always' }`) — opportunistically shipped Plan 01-09 (recorder.ts:285); verified Phase 4 Plan 04-06 via tests/build/cursor-visibility.test.ts. The original "Phase 5" framing here is back-patched stale; see Phase 4 Plan 04-06 closure.
- GSD framework retro candidate — auto-injection of empirical-acceptance gates when RESEARCH.md flags HIGH-risk assumptions
# Tech tracking
@@ -44,7 +44,7 @@ key-decisions:
- "D-12 acceptance gate (ffprobe) and A3 empirical-playback gate (operator + ffmpeg dry-run) treated as TWO distinct gates. The original Plan 07 conflated them under 'ffprobe-clean'; the A3 debug session proved they are independent. Phase 1 closure required BOTH green."
- "Plan 07 closure is auto-handled (Task 2 of original PLAN.md) — the checkpoint:human-verify returned `approved`; the auto-closure flips REQ-video-ring-buffer + STATE + ROADMAP in one atomic commit and writes this SUMMARY in another."
- "D-09..D-11 retirement is permanent. The original D-13 'fallback if D-12 fails' framing now stands as the production approach; CONTEXT.md decisions remain on record for SPEC provenance but the executable surface is restart-segments."
- "Cursor visibility (`video: { cursor: 'always' }`) deferred to Phase 5, not back-patched into Phase 1. Phase 1 was a stabilization phase, not a UX-refinement phase; adding the constraint mid-closure would have widened the diff beyond the closure ceremony."
- "Cursor visibility (`video: { cursor: 'always' }`) was opportunistically shipped in Plan 01-09 at src/offscreen/recorder.ts:285 and verified in Phase 4 Plan 04-06 (tests/build/cursor-visibility.test.ts node-env regression pin). The Phase 1 closure correctly did not back-patch it into Phase 1 itself — Phase 1 was a stabilization phase, not a UX-refinement phase; the original 'deferred to Phase 5' framing in this SUMMARY was made stale by the Plan 01-09 opportunistic landing, and is back-patched here in Phase 4 Plan 04-06."
- "Phase 1 closure satisfies SPEC §10 #2, #3, #7 functionally — but the canonical §10 sweep is owned by Phase 4. This avoids confusing 'Phase 1 closed' with 'SPEC §10 complete'; the latter requires the full 9-criterion smoke under Phase 4."
patterns-established:
@@ -79,7 +79,7 @@ completed: 2026-05-15
- **`npx tsc --noEmit` clean** at closure time; `npm run build` clean (verified during the fix-a3 cycle, unchanged since).
- **REQ-video-ring-buffer marked Complete** in REQUIREMENTS.md (checkbox + traceability table row); ROADMAP Phase 1 row marked Complete 2026-05-15.
- **D-09..D-11 retired permanently** in favor of D-13 restart-segments; CON-webm-header-retention also retired. Captured in REQUIREMENTS.md amendment + STATE.md Decisions log.
- **Cursor-visibility refinement deferred to Phase 5** — added to the P1/P2 hardening list with the explicit user-observation citation (2026-05-15).
- **Cursor-visibility refinement: opportunistically shipped in Plan 01-09 (recorder.ts:285 `cursor: 'always'`); verified in Phase 4 Plan 04-06** via `tests/build/cursor-visibility.test.ts` (node-env regression pin) + the operator-empirical SAVE flow showing the pointer visible in `video/last_30sec.webm`. The original 2026-05-15 "deferred to Phase 5" framing was correct at Phase 1 closure but was made stale by the Plan 01-09 opportunistic landing — back-patched in Phase 4 Plan 04-06 Task 3.
## Task Commits
@@ -132,7 +132,7 @@ _Note: Plan 07's original spec called for ONE commit at Task 2 completion. The c
2. **D-12 + A3 are treated as TWO distinct gates.** The original PLAN.md framed acceptance as "ffprobe-clean" (a single gate). The A3 debug session proved that a ffprobe-clean file can still freeze in Chrome playback — they are independent. Phase 1 closure requires both green, and the SUMMARY documents both gates explicitly so future phases can't conflate them.
3. **D-09..D-11 retirement is permanent.** The original D-13 framing in CONTEXT.md was "fallback if D-12 fails." After A3 activated it, D-13 IS the production approach. CONTEXT.md retains D-09..D-11 for SPEC provenance, but REQUIREMENTS.md, ROADMAP.md, and the executable surface (src/offscreen/recorder.ts) all reflect D-13 as authoritative.
4. **The muxer DTS-monotonicity warnings are NOT a failure.** ffmpeg `-f null -` prints warnings at segment join boundaries because the three concatenated WebM segments have overlapping per-segment timestamps (each segment's pts restarts at ~0 in its own EBML segment). This is the documented D-13 trade-off for multi-EBML-header WebM concat. SPEC §10 #7 only requires "plays back in a browser" — Chrome's acceptance is sufficient and was operator-confirmed.
5. **Cursor visibility refinement deferred to Phase 5, not back-patched into Phase 1.** Phase 1 is a stabilization phase; adding the `cursor: 'always'` constraint mid-closure widens the diff beyond the closure ceremony. Phase 5 is the right home for capture-quality refinements.
5. **Cursor visibility refinement: at Phase 1 closure deferred (Phase 1 was a stabilization phase; adding `cursor: 'always'` mid-closure would have widened the diff beyond the closure ceremony). The constraint was opportunistically shipped in Plan 01-09 (recorder.ts:285) and verified in Phase 4 Plan 04-06.** The historical Phase-1-closure framing (deferral was correct at the time) is preserved as a point in the audit trail; the actual constraint landed earlier than planned via opportunistic refinement — back-patched here in Phase 4 Plan 04-06.
## Deviations from Plan
@@ -202,7 +202,7 @@ This is the SECOND debug session in Phase 1's life — both written up in `.plan
None — Phase 1 ships as a Chrome extension with `desktopCapture` permission; the operator interacts with `chrome://extensions` "Load unpacked" for development and Chrome's native screen-share picker for capture. No external services configured by Phase 1.
The cursor visibility refinement (Phase 5) will, when activated, add a `cursor: 'always'` constraint to the `getDisplayMedia` call in `src/offscreen/recorder.ts` — no user action required there either, just a one-line code change in Phase 5.
The cursor visibility refinement added a `cursor: 'always'` constraint to the `getDisplayMedia` call in `src/offscreen/recorder.ts` (line 285) — no user action was required; the one-line code change shipped in Plan 01-09 and was verified in Phase 4 Plan 04-06. (Back-patched: the original Phase-1-closure framing said "Phase 5"; the actual landing was earlier.)
## Next Phase Readiness