From 051813ee6e76ebd9cbe217e324aea06b693011db Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 22 May 2026 09:03:08 +0200 Subject: [PATCH] =?UTF-8?q?docs(04-08):=20plan-checker=20iter-1=20?= =?UTF-8?q?=E2=80=94=20ITERATE-NEEDED=20(2=20BLOCKER=20+=205=20WARNING=20+?= =?UTF-8?q?=203=20advisory)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plan 04-08's core thesis (HTMLVideoElement.captureStream bypasses canvas throttling per debug session-2 verdict) IS the correct path to close ROADMAP SC #1. But two blocking issues prevent reliable delivery: BLOCKER 1: Vite `?url` asset-emission analog mis-applied — mokosh-mark.svg is 877 bytes (inlined as data:image/svg+xml URI) so the Plan 01-10 "?url + crxjs auto-WAR" precedent is NOT a direct analog for the 1.9 MB WebM which will emit as a separate dist-test/assets/.webm file. WAR auto-generation for extracted assets is unverified in this codebase. Remediation: probe-then-decide OR Blob URL from ?raw ArrayBuffer. BLOCKER 2: installFakeDisplayMedia()'s eager-install-at-module-load contract is silently broken by the proposed async conversion. The race window opens because recorder.ts:48 resolves before the async install completes; recorder.startRecording → real getDisplayMedia → headless hang. Remediation: keep sync monkey-patch; defer the canplay wait into fakeGetDisplayMedia closure (lazy first-frame). WARNINGS surface unverified headless autoplay reliability, displaySurface monkey-patch portability to HTMLVideoElement tracks, spike probe-value gates not surfaced as automated verify, and ROADMAP.md flip without grep enforcement. Architectural alignment confirmed (segments: Blob[] preserved; IDB correctly rejected; D-P4-01 honored). iter-2 is a methodology-tightening pass, not re-architecture. Estimated ~150-300 lines of plan edits. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../04-08-CHECKER-iter-1.md | 291 ++++++++++++++++++ 1 file changed, 291 insertions(+) create mode 100644 .planning/phases/04-harden-clean-up-optional/04-08-CHECKER-iter-1.md diff --git a/.planning/phases/04-harden-clean-up-optional/04-08-CHECKER-iter-1.md b/.planning/phases/04-harden-clean-up-optional/04-08-CHECKER-iter-1.md new file mode 100644 index 0000000..043a746 --- /dev/null +++ b/.planning/phases/04-harden-clean-up-optional/04-08-CHECKER-iter-1.md @@ -0,0 +1,291 @@ +--- +phase: 04-harden-clean-up-optional +plan: 08 +checker_iteration: 1 +checked_at: 2026-05-22T08:56:00Z +plan_commit: 504d9dc +verdict: ITERATE-NEEDED +severity_summary: + blocker: 2 + warning: 5 + cosmetic-advisory: 3 +goal_backward_check: "Plan 04-08 IS architecturally aligned with closing ROADMAP SC #1 — the HTMLVideoElement.captureStream() methodology bypasses the canvas-throttling root cause identified in debug session-2. BUT two blocking issues prevent the plan from delivering reliably as written: (1) the Vite ?url asset-emission assumption is mis-extrapolated from a 877-byte-inlined SVG to a 1.9 MB extracted WebM (different bundling path; web_accessible_resources auto-WAR behavior is unverified for the extracted-asset case); (2) the conversion of installFakeDisplayMedia() to async forces module-load top-level await on `canplay` + `videoEl.play()`, which has unverified interactions with the existing recorder.ts:47 top-level await chain AND the offscreen document creation sequence. Both are fixable in iter-2 but they ARE blocking as currently specified." +recommendation: "Spawn planner iter-2 with the 2 BLOCKERs + 5 WARNINGs as concrete remediation items. After iter-2 lands, the plan SHOULD pass and close SC #1 under valid methodology." +--- + +# Plan 04-08 Pre-Execution Validation — Iter-1 + +**Plan under review:** `.planning/phases/04-harden-clean-up-optional/04-08-PLAN.md` @ commit `504d9dc` + +**Phase goal recall:** Close ROADMAP SC #1 ("After running the extension idle for >5 minutes, then exporting, the archive still contains a non-empty video buffer") via methodology reframe, per debug session-2 REFUTED-architecture verdict (commit `4ea1bbb`). Plan 04-08 inserts as Wave 5.5 between Plans 04-06 and 04-07, replaces `canvas.captureStream(30)` with `HTMLVideoElement.captureStream(30)` in `installFakeDisplayMedia()`, re-runs the spike under valid methodology, then lands A33 + driveA33 + orchestrator wiring (33→34 GREEN). + +**Authority artifacts read:** + +- `.planning/phases/04-harden-clean-up-optional/04-08-PLAN.md` (804 lines) +- `.planning/phases/04-harden-clean-up-optional/04-04-PLAN.md` (476 lines) +- `.planning/phases/04-harden-clean-up-optional/04-04-SUMMARY.md` (267 lines incl. post-debug amendment) +- `.planning/debug/sw-offscreen-persistence-investigation-session-2.md` (97 lines) +- `.planning/phases/04-harden-clean-up-optional/04-CONTEXT.md` + `04-RESEARCH.md` + `04-PATTERNS.md` +- `.planning/PROJECT.md` + `.planning/ROADMAP.md` +- `src/test-hooks/offscreen-hooks.ts` (541 lines — current installFakeDisplayMedia + uninstallFakeDisplayMedia + 6 bridge ops) +- `src/offscreen/recorder.ts` lines 40-100 (top-level await + `let segments: Blob[] = []` at line 91) +- `tests/uat/spike-a33-sw-persistence.ts` (337 lines) +- `tests/uat/lib/harness-page-driver.ts` lines 1-100 + line 2464 (driveA32 location) +- `tests/uat/harness.test.ts` lines 95-138 (import block + FORBIDDEN_HOOK_STRINGS at lines 123-138) + lines 340-487 (wrapped-driver + drivers-array) +- `globals.d.ts` (37 lines) +- `manifest.json` + `dist/manifest.json` + `dist-test/manifest.json` +- `vite.config.ts` lines 1-50 + 145-170 + `vite.test.config.ts` (101 lines) +- `dist/assets/welcome-BXz6I5Ha.js` (verified SVG inlined as data:image/svg+xml URI) +- `tests/fixtures/last_30sec.webm` (1888636 bytes, ffprobe confirms codec=vp9 width=1142 height=1044) + +--- + +## Goal-Backward Verification — Closes SC #1? + +**Architectural claim:** Plan 04-08 replaces canvas.captureStream (throttled to 0 frames under headless 5-min idle per debug session-2) with HTMLVideoElement.captureStream backed by a bundled WebM source. The video file's real decoded frame timeline is NOT subject to invisible-canvas throttling — `videoEl.captureStream(30)` on a `