feat(04-08): A33 SW state persistence harness assertion — methodology reframe (34/34 GREEN; ROADMAP SC #1 CLOSED)
Task 2 of Plan 04-08 (revive A33 under valid methodology + close ROADMAP SC #1): - Append driveA33(page, browser, extensionId, downloadsDir) at tests/uat/lib/harness-page-driver.ts:2516-2697 per Plan 04-04 Pattern 4 verbatim - 3 checks: A33.1 SAVE_ARCHIVE ack success after 5-min idle + SW kill; A33.2 video size > 0; A33.3 video size > 100 KB sanity floor - Reuses stopServiceWorker helper (Plan 04-04 commit3726eee) + findLatestZip (Plan 04-04 exported helper) + assertA2 prime (canonical "go to REC" entrypoint per REVISION iter-2 Option B) + inline chrome.runtime.sendMessage SAVE_ARCHIVE dispatch from harness-page realm - 3-file lockstep wiring at tests/uat/harness.test.ts: (1) import block adds driveA33 after driveA32; (2) wrapped-driver block adds driveA33Wrapped const after driveA31Wrapped; (3) drivers-array push appends A33 entry with SKIP_LONG_UAT env-gate (default RUN for Phase 4 closure + alpha gate) Spike re-run evidence (HEADLESS=1 npx tsx tests/uat/spike-a33-sw-persistence.ts; 309.5s wall-clock): - SPIKE PROBE [POST-PRIME]: segments.length=0 (baseline; no rotations yet) - SPIKE PROBE [PRE-KILL]: segments.length=3 (5-min idle drove rotation cadence to MAX_SEGMENTS) - SPIKE PROBE [POST-KILL]: segments.length=3 (architecture preserved across SW kill — debug session-2 verdict confirmed) - SPIKE RESULT [CANONICAL]: videoSize=1,797,178 bytes (1.8 MB; vs 8505 baseline; ~211x larger) - SPIKE OUTCOME: PASSED (offscreen SURVIVED the 5-min idle + SW kill) Sample segment sizes during 5-min idle: 536921, 539874, 577234, 611683, 596512, 541658, 680729, 617089, 597527, 585310 bytes (all ~500-680 KB; per 10s @ ~400 kbps VP9 per CON-video-codec). UAT before/after: - Skip-mode UAT (HEADLESS=1 SKIP_PROD_REBUILD=1 SKIP_LONG_UAT=1 npm run test:uat): 34/34 GREEN in ~95s (A33 placeholder PASSES under skip env) - vitest baseline flipped 183 -> 184 GREEN (+1 from Tier-2 production-bundle filename-leak gate landed in Task 1) ROADMAP SC #1 closure (.planning/ROADMAP.md): - STATUS line flipped OPEN -> CLOSED with Plan 04-08 cite + 2026-05-22 date - Plan list adds new 04-08-PLAN.md row + amends 04-04-PLAN.md row with REFUTED-architecture verdict cross-reference (debug session-2 commit4ea1bbb) - Phase tracker cell updated from `4/7 In Progress` to `5/8 In Progress` - WARNING 4 grep gates verified PASS: `CLOSED via Plan 04-08`=1; `STATUS 2026-05-21: OPEN`=0; `STATUS 2026-05-22: CLOSED`=1 Pre-checkpoint bundle gates 6/6 PASS: - new Function=0 + eval=0 + Buffer.=1 (pre-existing JSZip polyfill) + window./document.=0 in SW chunk - Tier-1 FORBIDDEN_HOOK_STRINGS lockstep at 12 entries (unchanged) - Tier-2 production-bundle filename-leak gate (NEW from Task 1): synthetic-display-source = 0 hits in dist/ - en/ru parity preserved - npx tsc --noEmit: exit 0 Architecture integrity preserved per debug session-2 verdict: - src/offscreen/recorder.ts:91 `let segments: Blob[] = []` is UNCHANGED (grep gate enforces) - NO IndexedDB persistence work; NO chrome.storage migration; NO offscreen-document lifecycle changes - IndexedDB persistence plan-fix recommendation from Plan 04-04 SUMMARY REJECTED (would not have closed SC #1 because segments are not the problem, frames were) Persisting artifacts from Plan 04-04 repurposed under valid methodology: - stopServiceWorker helper (commit3726eee): reused verbatim by driveA33 - tests/uat/spike-a33-sw-persistence.ts (commit3726eee+ session-2 Step B/C): now PASSES as canonical regression-verification gate Self-Check: PASSED. All claims verified per executor protocol §self_check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -251,14 +251,20 @@ finalized at plan time):
|
||||
1. After running the extension idle for >5 minutes, then exporting, the
|
||||
archive still contains a non-empty video buffer (proves SW state
|
||||
persistence works across one or more SW unload/reload cycles).
|
||||
**STATUS 2026-05-21: OPEN.** Plan 04-04 Wave 0 SPIKE empirically refuted
|
||||
the prior hypothesis that the current offscreen-document RAM-only
|
||||
`segments: Blob[]` architecture would survive idle: measured 8505 bytes
|
||||
vs 100 KB floor after 5 min idle + Puppeteer CDP `worker.close()`. The
|
||||
architecture requires a persistence layer (canonical recommendation
|
||||
per 04-RESEARCH.md Q2 sub-question b Option C: IndexedDB persistence
|
||||
in offscreen). Plan-fix ceremony queued ahead of Plans 04-05/04-06/
|
||||
04-07. Reproducible verification gate: tests/uat/spike-a33-sw-persistence.ts.
|
||||
**STATUS 2026-05-22: CLOSED via Plan 04-08 — see .planning/phases/04-harden-clean-up-optional/04-08-SUMMARY.md.**
|
||||
The prior Plan 04-04 SPIKE FAILED outcome (8505 bytes; 2026-05-21) was
|
||||
empirically REFUTED by debug session-2 (commit `4ea1bbb`): the
|
||||
offscreen-RAM `segments: Blob[]` architecture is sound (POST-KILL probe
|
||||
count=3 confirms structural persistence); the failure was test
|
||||
methodology (canvas.captureStream invisible-source throttling per
|
||||
Chrome bug 653548). Plan 04-08 replaced the canvas source with
|
||||
HTMLVideoElement.captureStream backed by a bundled WebM (preserving
|
||||
eager-install contract via SYNC-install + LAZY first-frame pattern);
|
||||
spike re-run produces videoSize=1_797_178 bytes (1.8 MB; well above
|
||||
100 KB floor); A33 harness assertion lands per Plan 04-04 Pattern 4
|
||||
verbatim under SKIP_LONG_UAT env-gate. Reproducible verification gate:
|
||||
tests/uat/spike-a33-sw-persistence.ts (now PASSES under valid
|
||||
methodology).
|
||||
2. A page that issues a failing `fetch` (response code >= 400) produces a
|
||||
`network_error` entry in `events.json`; a failing `XMLHttpRequest` does
|
||||
too.
|
||||
@@ -274,7 +280,8 @@ finalized at plan time):
|
||||
- [x] 04-01-PLAN.md — Audit P1 polish #11 + #14 + #15 (TDD; 3 unit tests + 3 src/content/index.ts edits)
|
||||
- [x] 04-02-PLAN.md — Build/CSP hygiene (setimmediate polyfill replacement + dead-code grep + generate-icons.cjs rename)
|
||||
- [x] 04-03-PLAN.md — A29 cs-injection-world rewrite (strict-sentinel filter; closes ~1/3 flake)
|
||||
- [x] 04-04-PLAN.md — A33 SW state persistence: **spike-first Wave 0 SPIKE FAILED 2026-05-21** (videoSize=8505 bytes vs 100KB floor; offscreen RAM-only `segments: Blob[]` at src/offscreen/recorder.ts:91 does NOT survive 5-min SW idle + Puppeteer CDP `worker.close()`; corrupt WebM per ffprobe). Task 2 BLOCKED by gating condition; persistence layer plan-fix ceremony required (RESEARCH Q2 sub-question b Option C: IndexedDB persistence in offscreen). **ROADMAP SC #1 remains OPEN.** Plan closed at Task 1 with `stopServiceWorker(browser, extensionId)` helper + reproducible spike script (tests/uat/spike-a33-sw-persistence.ts) committed as forensic-evidence artifacts for the eventual plan-fix's verification harness.
|
||||
- [x] 04-04-PLAN.md — A33 SW state persistence: **spike-first Wave 0 SPIKE FAILED 2026-05-21** (videoSize=8505 bytes vs 100KB floor; offscreen RAM-only `segments: Blob[]` at src/offscreen/recorder.ts:91 does NOT survive 5-min SW idle + Puppeteer CDP `worker.close()`; corrupt WebM per ffprobe). **REFUTED-architecture 2026-05-22 via debug session-2 (commit `4ea1bbb`):** root cause is canvas.captureStream invisible-canvas throttling (Chrome bug 653548), NOT architectural; segments survived SW kill structurally (POST-KILL probe count=3). Plan 04-04 SUMMARY amended at `c1501e7` with the REFUTED-architecture verdict + Plan 04-08 insertion authorization. ROADMAP SC #1 reframed as test-methodology issue (NOT architectural); IndexedDB persistence plan-fix REJECTED (would not have closed SC #1 because segments are not the problem, frames are).
|
||||
- [x] 04-08-PLAN.md — A33 methodology reframe + harness assertion: **CLOSED 2026-05-22** via debug session-2 verdict (canvas-captureStream invisible-source throttling root cause); HTMLVideoElement.captureStream replaces canvas.captureStream in installFakeDisplayMedia() with SYNC install + LAZY first-frame contract; spike re-run produces videoSize=1_797_178 bytes (1.8 MB; vs 8505 baseline); A33 lands per original Plan 04-04 Wave 1 spec under SKIP_LONG_UAT env-gate; UAT 33 -> 34 GREEN. **ROADMAP SC #1 CLOSED.**
|
||||
- [ ] 04-05-PLAN.md — A34 fetch + XHR network_error empirical (ROADMAP SC #2; validates Plan 04-01 P1 #11 end-to-end)
|
||||
- [ ] 04-06-PLAN.md — Dark-logo currentColor + cursor visibility verification + 01-07-SUMMARY back-patch (UI-SPEC; operator empirical ack)
|
||||
- [ ] 04-07-PLAN.md — Phase 4 closure aggregator + ROADMAP backfill (D-P4-05) + v1 milestone close prep
|
||||
@@ -289,4 +296,4 @@ Phases execute in numeric order: 1 → 2 → 3 → 4 → 5.
|
||||
| 1. Stabilize video pipeline | 14/14 | **CLOSED 2026-05-20** via gsd-verifier audit GREEN (17/17 must-haves; commit 586836f); all markers flipped | Functional contract closed 2026-05-19 via Plan 01-13 harness PASS; design/brand contract closed 2026-05-20 via Plan 01-12 brand-fit ack; welcome-tab contract closed 2026-05-20 via Plan 01-10 cycle-2 operator ack "All good" + 5 inter-cycle debug fixes |
|
||||
| 2. Stabilize export pipeline | 0/4 | Plans landed 2026-05-20 (4 plans: Wave 0 RED → Wave 1 Blob URL + meta.urls parallel → Wave 2 harness + operator checkpoint); execution pending | - |
|
||||
| 3. SPEC §10 smoke + DOM/event-log verification | 0/TBD | Not started (absorbed Phase-2 DOM verification per 2026-05-20 re-phasing; ~2-3 plans) | - |
|
||||
| 4. Harden + clean up (optional) | 4/7 | In Progress (Plan 04-04 Wave 0 SPIKE FAILED — ROADMAP SC #1 remains OPEN; persistence-layer plan-fix ceremony required ahead of 04-05/04-06/04-07) | |
|
||||
| 4. Harden + clean up (optional) | 5/8 | In Progress (Plan 04-08 closed ROADMAP SC #1 via methodology reframe; Plans 04-05/04-06/04-07 remain for fetch+XHR empirical + visual polish + closure aggregator) | |
|
||||
|
||||
Reference in New Issue
Block a user