feat(01-07): close Phase 1 — REQ-video-ring-buffer complete, SPEC §10 #7 satisfied

Phase 1 closure 2026-05-15 — both acceptance gates green:

- D-12 ffprobe structural gate: `ffprobe -v error -f matroska -i
  tests/fixtures/last_30sec.webm` exit 0 (cd61cbc)
- A3 empirical-playback gate: operator confirmed clean end-to-end Chrome
  playback (no ~1 s freeze); ffmpeg `-v warning -i fixture -f null -`
  exit 0 with zero decoder errors (only expected muxer DTS-monotonicity
  warnings at segment join boundaries — documented D-13 trade-off for
  multi-EBML-header WebM concat; Chrome's MSE pipeline handles this
  natively, satisfying SPEC §10 #7)

Changes:

- .planning/REQUIREMENTS.md
  * REQ-video-ring-buffer checkbox [ ] -> [x]; description AMENDED to
    document the D-13 restart-segments lifecycle replacing D-09..D-11;
    SPEC §10 #2, #3, #7 noted as green 2026-05-15
  * Traceability table row: REQ-video-ring-buffer | Phase 1 | Complete
    (was Pending)

- .planning/ROADMAP.md
  * Phase 1 list-item flipped [ ] -> [x] with closure date + summary
  * Phase 1 Success Criteria 1, 2, 3 individually checked off; criterion 2
    re-worded to reflect D-13 segment-cycling (replacing the original
    single-continuous-recorder wording from D-09..D-11)
  * Plan list: 01-07-PLAN.md flipped [ ] -> [x] with closure note
  * Progress table row: 7/7 Complete 2026-05-15 (was 6/7 In Progress)
  * Phase 5 P1/P2 list: appended `getDisplayMedia` cursor visibility
    constraint (`video: { cursor: 'always' }`) — surfaced as user
    observation during Phase 1 smoke 2026-05-15

- .planning/STATE.md
  * Frontmatter: status -> phase_complete, completed_phases 0 -> 1,
    completed_plans 6 -> 7, percent 86 -> 100; stopped_at + last_activity
    rewritten for closure narrative
  * Current Position: Phase 1 COMPLETE, next Phase 2 of 5, Plan 7/7
    complete, progress bar [██████████] 100% Phase 1
  * Performance Metrics: Phase 1 row populated (7 plans, ~50 min); added
    Plan 07 row with closure narrative incl. the two debug sessions
  * Decisions log: appended [Phase 01-07-closure] decision and
    [Phase 01-07-deferred-to-5] note for the cursor-visibility refinement
  * Session Continuity: rewritten for closure; resume file points to the
    Plan 07 SUMMARY (commit 3)
  * Added "Phase 1 Closure Notes" block with ffprobe + ffmpeg gates,
    fixture metadata, test counts, criteria green-status, and a process
    retro candidate (auto-injection of empirical-acceptance gates when
    RESEARCH.md flags HIGH-risk assumptions)

Refs: .planning/debug/resolved/d12-blob-port-transfer-fails.md,
.planning/debug/resolved/webm-playback-freeze.md
This commit is contained in:
2026-05-15 21:58:38 +02:00
parent cd61cbccb6
commit 7df72aaa60
3 changed files with 74 additions and 43 deletions

View File

@@ -22,7 +22,7 @@ working export → green §10 smoke → harden + clean up**.
Decimal phases appear between their surrounding integers in numeric order.
- [ ] **Phase 1: Stabilize video pipeline** — Collapse offscreen duality, fix MediaRecorder shadow, fix WebM ring buffer playability, replace `chrome.tabCapture` with offscreen `getDisplayMedia` (AMENDED from original DEC-003)
- [x] **Phase 1: Stabilize video pipeline** — Collapse offscreen duality, fix MediaRecorder shadow, fix WebM ring buffer playability, replace `chrome.tabCapture` with offscreen `getDisplayMedia` (AMENDED from original DEC-003). **Closed 2026-05-15** — D-12 ffprobe gate + A3 empirical-playback gate both green against `tests/fixtures/last_30sec.webm` (1.6 MB VP9 1142×1038); D-13 restart-segments retired D-09..D-11 mid-phase; 30/30 vitest green, tsc clean. SPEC §10 #2, #3, #7 functionally satisfied (end-to-end Phase 4 smoke remains owner of §10).
- [ ] **Phase 2: Stabilize DOM + event capture privacy** — Migrate rrweb to v2 `maskInputFn`, plug `content/index.ts setupInputLogging` password leak
- [ ] **Phase 3: Stabilize export pipeline** — Restore user-activation gesture in popup, delete dead `permissions.request`, replace base64 `data:` URL with Blob URL minted in offscreen
- [ ] **Phase 4: SPEC §10 smoke verification** — End-to-end install-and-record-and-export pass against all 9 acceptance criteria
@@ -52,19 +52,23 @@ directory + `vite.config.ts` inline string + `src/background/`.
not on popup open (CON-tab-capture-binding, REQ-video-ring-buffer).
**Success Criteria** (what must be TRUE):
1. There is exactly one source of truth for the offscreen document; rebuilding
1. [x] There is exactly one source of truth for the offscreen document; rebuilding
`vite.config.ts` does not regenerate a divergent inline duplicate, and
`stopRecording` runs without `mediaRecorder is undefined` shadow errors.
2. With the extension loaded and an operator session active, a single
continuous `MediaRecorder` is running on the operator-selected
screen/window source with timeslice 2000 ms; the recorder continues
unchanged across tab switches (no tab re-attach logic; AMENDED from the
original wording). The WebM container header is retained in the ring
buffer indefinitely.
3. The in-memory video ring buffer at any instant contains the WebM header
chunk plus the most recent 30 s of subsequent chunks (no more, no less);
concatenating header + buffered chunks yields a byte sequence a browser
would play.
2. [x] With the extension loaded and an operator session active, a `MediaRecorder`
is running on the operator-selected screen/window source. AMENDED 2026-05-15
(D-13 fix-a3 activation): the recorder cycles in 10 s self-contained segments
(stop+restart on the same `MediaStream`) instead of a single continuous
recorder — replaces D-09..D-11 to fix VP9 keyframe orphan-P-frame freezes.
Recording continues unchanged across tab switches (no tab re-attach logic;
AMENDED from the original wording).
3. [x] The in-memory video ring buffer at any instant contains at most 3 of the
most recent 10 s WebM segments (3 × 10 s = 30 s window, no more, no less);
concatenating segments sequentially yields a multi-EBML-header WebM that
Chrome plays end-to-end (SPEC §10 #7 — operator confirmed clean playback
2026-05-15; ffmpeg `-v warning -i fixture -f null -` exit 0 with zero
decoder errors, only expected muxer DTS-monotonicity warnings at segment
join boundaries).
**Plans**: 7 plans
- [x] 01-01-PLAN.md — Doc cascade: amend DEC-003 / DEC-010 / RETIRE constraints / swap manifest permissions (D-A1..D-A6)
@@ -73,7 +77,7 @@ directory + `vite.config.ts` inline string + `src/background/`.
- [x] 01-04-PLAN.md — Port keepalive + OFFSCREEN_READY handshake (TDD): replaces alarms keepalive on offscreen side
- [x] 01-05-PLAN.md — SW shrink: delete legacy buffer + alarms + IndexedDB + tabCapture paths; wire SW-side onConnect host
- [x] 01-06-PLAN.md — Build pipeline collapse: delete vite.config.ts inline plugin + top-level offscreen/ dir; declare rollupOptions.input
- [ ] 01-07-PLAN.md — Manual smoke + ffprobe D-12 acceptance gate; commit regression fixture
- [x] 01-07-PLAN.md — Manual smoke + ffprobe D-12 acceptance gate + A3 empirical-playback gate; D-12 + A3 debug sessions resolved mid-execution via pre-staged base64 wire format + D-13 restart-segments; regression fixture committed; SPEC §10 #2/#3/#7 functionally green (Closed 2026-05-15)
### Phase 2: Stabilize DOM + event capture privacy
**Goal**: rrweb captures DOM events on typical pages and the user-event log
@@ -199,6 +203,13 @@ finalized at plan time):
- Dead-code cleanup (the `permissions.request` dance removed in Phase 3 may
have stranded helpers; the offscreen duality removed in Phase 1 may have
stranded shims).
- `getDisplayMedia` cursor visibility constraint (`video: { cursor: 'always' }`)
— refines capture quality for diagnostic UX; surfaced during Phase 1 smoke
(2026-05-15) as a user observation. Operator's screen cursor was absent
from captured frames despite being the highest-signal cue when reproducing
pointer-driven bugs. Constraint is opt-in per the `getDisplayMedia` spec
and Chrome implements it via the `CursorCaptureConstraint` enum (`always`
/ `motion` / `never`).
**Success Criteria** (what must be TRUE):
1. After running the extension idle for >5 minutes, then exporting, the
@@ -224,7 +235,7 @@ Phases execute in numeric order: 1 → 2 → 3 → 4 → 5.
| Phase | Plans Complete | Status | Completed |
|-------|----------------|--------|-----------|
| 1. Stabilize video pipeline | 6/7 | In Progress| |
| 1. Stabilize video pipeline | 7/7 | Complete | 2026-05-15 |
| 2. Stabilize DOM + event capture privacy | 0/TBD | Not started | - |
| 3. Stabilize export pipeline | 0/TBD | Not started | - |
| 4. SPEC §10 smoke verification | 0/TBD | Not started | - |