docs(04-04): complete harden-clean-up-optional plan 04-04 — SW persistence spike FAILED, plan-fix ceremony required
Plan 04-04 (spike→auto) closes at Task 1 (Wave 0 SPIKE) with an empirical
NO on the RESEARCH Q2 MEDIUM-confidence hypothesis A3 (offscreen-document
independent lifecycle anchored by active MediaRecorder). Task 2 (Wave 1
A33 verification-only harness assertion) BLOCKED by the plan's explicit
gating condition (videoSize > 100_000); ROADMAP SC #1 remains OPEN.
Spike empirical numbers (one HEADLESS=1 run; 308.7s wall-clock; full log
at /tmp/04-04-spike.log; reproducible via the committed spike script):
- assertA2 prime: PASSED (REC state established)
- 5-min wall-clock idle: elapsed cleanly
- stopServiceWorker CDP: succeeded (worker.close() returned)
- SAVE_ARCHIVE ack: {success: true} (event-driven SW respawn worked)
- video/last_30sec.webm: 8505 bytes (sanity floor 100 KB; healthy 1-3 MB)
- ffprobe on extracted: 'End of file' + 'Duplicate element' (no clusters)
- rrweb/session.json: [] (empty)
- logs/events.json: [] (empty)
- meta.urls: chrome-extension://* only (real-page URLs LOST)
Conclusion: src/offscreen/recorder.ts:91 `let segments: Blob[] = []` RAM-
only architecture does NOT survive 5-min SW idle + Puppeteer CDP worker.
close(). Architectural change required to close ROADMAP SC #1 (canonical
recommendation per 04-RESEARCH.md Q2 sub-question b Option C: IndexedDB
persistence in offscreen — Blobs serialize cleanly via structured-clone;
per-segment write ~3 MB; ~3 writes per 30s window). Per saved memory
`feedback-gsd-ceremony-for-fixes.md` the architectural fix routes through
/gsd-plan-phase rewrite OR /gsd-debug ceremony — NOT improvised inline
inside Plan 04-04.
Task 1 persisting artifacts (committed at 3726eee):
- tests/uat/lib/harness-page-driver.ts: +43/-6 lines
- Browser type added to puppeteer import
- stopServiceWorker(browser, extensionId) helper (Chrome devrel
canonical pattern; Puppeteer >=22.1.0 worker.close())
- findLatestZip exported (was module-internal)
- tests/uat/spike-a33-sw-persistence.ts NEW +202 lines
- One-shot reproducible empirical investigation script
- Reusable for future SW-lifecycle regression (the eventual plan-fix
re-runs this script as its A33-verification gate)
- Committed (not deleted) per the spike-FAILED forensic-evidence pattern
Task 2 was NOT committed (BLOCKED by gating condition); UAT count stays
33/33; Tier-1 FORBIDDEN_HOOK_STRINGS inventory unchanged at 12; A33 not
introduced.
Pre-checkpoint bundle gates (per saved memory feedback-pre-checkpoint-
bundle-gates.md): 6/6 GREEN unchanged from Plan 04-03 baseline (zero
production source changes in Plan 04-04).
- SW chunk new Function: 0 (Plan 04-02 polarity preserved)
- SW chunk eval: 0 (preserved)
- SW chunk Buffer.: 1 (pre-existing JSZip polyfill; logged deferred)
- SW chunk window./doc.: 0/0 (preserved)
- dist/ grep × 12 hooks: 0 matches (Tier-1 inventory invariant held)
- Manifest: validates clean
vitest baseline: 183 tests total. Sequential `npm test` showed 180/183 with
3 pre-existing flakes in tests/background/blob-url-download.test.ts +
tests/background/webm-remux.test.ts + tests/offscreen/webm-playback.test.ts;
all 3 PASS in isolation. Per 04-CONTEXT.md items 9-10 these are documented
pre-existing issues (parallel-vitest Tier-1-build-step race + 2 ffprobe/
ffmpeg flakes pre-dating Phase 3) — NOT a Plan 04-04 regression (Plan 04-04
made zero source-code changes that could possibly affect them).
Files committed:
- .planning/phases/04-harden-clean-up-optional/04-04-SUMMARY.md NEW
- .planning/STATE.md: position advanced 4→5 / 7; progress 87% → 90%;
2 decision entries logged; session metadata updated
- .planning/ROADMAP.md: Phase 4 row count 2/7 → 4/7; Plan 04-04
checklist box ticked with full SPIKE FAILED annotation; SC #1 marked
OPEN with empirical evidence inline
Next step (out of Plan 04-04 scope; routed per spike-first contract):
plan-fix ceremony for IndexedDB persistence layer at src/offscreen/*.
The plan-checker/planner owns whether to (a) rewrite Plan 04-04 in-place,
(b) insert a new plan slot (e.g., 04-08), or (c) close Plan 04-04 as
spike-findings + open a fresh follow-up plan. Recommendation in SUMMARY:
option (b) or (c) — keep Plan 04-04 as the canonical spike-findings record.
This commit is contained in:
@@ -251,6 +251,14 @@ 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.
|
||||
2. A page that issues a failing `fetch` (response code >= 400) produces a
|
||||
`network_error` entry in `events.json`; a failing `XMLHttpRequest` does
|
||||
too.
|
||||
@@ -266,7 +274,7 @@ 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)
|
||||
- [ ] 04-04-PLAN.md — A33 SW state persistence (spike-first; 5-min idle + worker.close() CDP; ROADMAP SC #1)
|
||||
- [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.
|
||||
- [ ] 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
|
||||
@@ -281,4 +289,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) | 2/7 | In Progress| |
|
||||
| 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) | |
|
||||
|
||||
Reference in New Issue
Block a user