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.
37 KiB
gsd_state_version, milestone, milestone_name, status, stopped_at, last_updated, last_activity, progress
| gsd_state_version | milestone | milestone_name | status | stopped_at | last_updated | last_activity | progress | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1.0 | v2.0.0 | milestone | executing | Completed 04-02-PLAN.md (setimmediate polyfill replaced via layered 4-mechanism mitigation; SW new Function polarity 1→0; UAT 33/33 GREEN preserved) | 2026-05-21T17:24:14.969Z | 2026-05-21 |
|
Project State
Project Reference
See: .planning/PROJECT.md (updated 2026-05-15)
Core value: When an operator hits a bug, one click MUST produce a self-contained archive that lets support reproduce what happened — in under 5 s, no server, no password leaks. Current focus: Phase 04 — harden-clean-up-optional
Current Position
Phase: 04 (harden-clean-up-optional) — EXECUTING Phase 4 of 4 (Hardening — optional) — Plan 04-01 closed (audit P1 polish 3/3); 6 plans remain (04-02 build hygiene queued NEXT in Wave 1) Plan: 5 of 7 Status: Ready to execute Last activity: 2026-05-21
Progress: [█████████░] 90%
Plan 01-10 closure (2026-05-20)
- Welcome tab landed end-to-end across 4 waves (5 plan tasks: 4 autonomous + 1 operator empirical UAT cycle 2 + cycle-2 follow-up brand-rename ack)
- 4 plan-wave commits:
89e1e09(Wave 0 RED onboarding tests) →49f087f(Wave 1 welcome bundle + Vite entries + manifest) →8f329d8(Wave 2 openWelcomeIfFirstInstall + onInstalled wiring) →b112cb7(Wave 3 harness A15+A16+A17) - 5 inter-cycle debug commits between cycle-1 rejection (2026-05-20 ~08:56) and cycle-2 ack (2026-05-20):
4bba679fix(01-09): notifStartup text split — notifStartupCta for onStartup; notifRecordingStarted reserved for manual-start (debug 01-09-startup-notification-misleading-text)d48a715fix(01-10): welcome page mark — bundle canonical mokosh-mark.svg via Vite ?url import + populateMark() + .welcome-hero__mark-img + A17.8 sub-check (debug 01-10-welcome-page-missing-mark; Plan 01-12 must_have #9 path-A swap-in gap closed)0854baffix(01-10): vitest build-test it() timeout — bump to 30s for slower welcome-page build (debug 01-10-vitest-build-test-timeout)a2dfc8cfix(01-09): startVideoCapture — remove stale active-tab dependency (debug 01-09-notification-start-no-active-tab; D-01 cleanup gap; +3 RED→GREEN tests at start-video-capture-no-tab.test.ts)d21ed17fix(01-12): brand polish — replace stale 'AI Call Recorder' refs with Mokosh (debug 01-12-stale-ai-call-recorder-references; 4 files: src/welcome/copy.ts + README.md + package.json + tests/i18n/manifest-i18n.test.ts)
- SUMMARY:
.planning/phases/01-stabilize-video-pipeline/01-10-SUMMARY.md - First-install activation pattern:
chrome.runtime.onInstalled('install')+chrome.storage.localflag-gating (onboarding-completed: true+installed-at: Date.now()) +chrome.tabs.create+ fire-and-forget.catchdefense-in-depth. Subsequent installs/updates do NOT re-open (A16's contract empirically verified). - Plan 01-12 path-B contract honored end-to-end:
welcome.cssopens with@import '../shared/tokens.css';(canonical tokens — Lora display + IBM Plex Sans UI + D-04 Loom palette); NO placeholder welcome-tokens.css file.chrome.i18n.getMessageforwelcomeHeroRu+welcomeHeroEn(Plan 01-12 fallback pattern preserved with|| <en-const>). Non-tagline copy via in-file COPY map (engineering placeholder pending future copy-iteration plan). - Canonical Mokosh mark bundled via Vite
?urlimport:import markUrl from '../shared/brand/mokosh-mark.svg?url'; Vite default-inlines ~600 B SVG asdata:image/svg+xml,...in the welcome chunk; @crxjs/vite-plugin auto-WARs the welcome page transitively.globals.d.tsambient module declaration added for*.svg?url. - A17.7 empirical probe:
getComputedStyleon transient div withcolor: var(--mks-rec)resolves torgb(178, 84, 61)(= #b2543d = --mks-madder-600 per Plan 01-12 Wave 4 D-04 Loom palette adoption). Proves canonical @import wires through to canonical token values, not just engineering placeholders. - A17.8 sub-check added during welcome-mark debug: verifies welcome chunk JS contains the inlined
data:image/svg+xml,...data URL with canonicalviewBox='0 0 32 32'preserved. - Pre-checkpoint bundle gates per saved memory
feedback-pre-checkpoint-bundle-gates.md: Tier-1 hook-string grep + SW CSP-safety + Node-globals + DOM-globals + manifest validation + en↔ru parity — all PASS. setimmediate polyfillnew Functionin SW chunk confirmed pre-existing (logged at.planning/phases/01-stabilize-video-pipeline/deferred-items.mdfor Phase 5 hardening per Plan 01-12 Wave 7 disclosure). Tier-1 FORBIDDEN_HOOK_STRINGS inventory unchanged at 12 (A15-A17 use chrome.tabs.query + chrome.storage.local.get + fetch + DOMParser + getComputedStyle production APIs exclusively). - vitest 147 → 153 GREEN (+3 from
tests/background/onboarding.test.tsWave 0; +3 fromtests/background/start-video-capture-no-tab.test.tsclosure-cycle debuga2dfc8c). - UAT harness 21/21 → 24/24 GREEN (A0-A14 + A15-A17 + A18-A22 + A23 inclusive). A22 functionally GREEN now that welcome.html is reachable (was conditional skip-gate in Plan 01-12 Wave 6).
- Operator empirical UAT cycle-2 ack 2026-05-20 verbatim "All good" on welcome page + canonical mark + Lora-rendered hero + Cyrillic tagline + onStartup notification CTA + notification.onClicked → startVideoCapture path + reload-does-not-re-open + re-install branch.
- Cycle-2 follow-up brand-rename ack received same day for
d21ed17(4-file content rename "AI Call Recorder" → "Mokosh";.planning/intel/*audit trail preserved). - Plan 01-10 closed: 5/5 plan tasks complete (4 autonomous Waves 0-3 + Wave 4 operator empirical cycle-2 ack); 4/4 plan waves complete.
- Phase 1 implications: final functional plan delivered. Phase 1 final-closure unblocked pending REQUIREMENTS / ROADMAP / STATE marker flip + optional
/gsd-verify-work 1.
Plan 01-12 closure (2026-05-20)
- Design integration landed end-to-end across 7 waves (10 plan tasks + 1 operator empirical checkpoint)
- 9 implementation commits:
3fe018b(plan baseline revision post-01-14) →34a9ce1(Wave 0 RED scaffolds) →f86fd60+abab6e1(Wave 1 fonts + tokens.css) →7732a30(Wave 2 icons) →110cebc(Wave 3 manifest i18n + _locales) →468f16d(Wave 4 source adoption) →e8d2881(Wave 5 Vite define + welcome conditional) →b909c37(Wave 6 A18-A22) + 1 pre-checkpoint commit865d394 - SUMMARY:
f319c7d(.planning/phases/01-stabilize-video-pipeline/01-12-SUMMARY.md) - R2 designer substitution: Newsreader → Lora (Cyreal foundry; OFL-1.1; full Latin + Cyrillic) per designer reply 2026-05-19. Canonical token value
--mks-font-display: "Lora", "Iowan Old Style", "Times New Roman", serif. - MV3 CSP self-host invariant verified: zero
googleapis/https://fontsreferences indist/(pertests/build/no-remote-fonts.test.ts); 8 local @font-face rules insrc/shared/tokens.css; ~155 KB font bundle ships undersrc/shared/fonts/with LICENSE + README attribution. - 16 i18n keys across
_locales/{en,ru}/messages.json: extName + extDesc + tooltipOff + tooltipRecPrefix + tooltipErr + popupSavePrompt + popupSaveCta + popupSaveDone + popupSaving + popupSaveDoneShort + popupEmptyState + popupInfoText + notifStartup + notifRecovery + welcomeHeroRu + welcomeHeroEn. EN extName = "Mokosh — Session Capture" (D-07); EN extDesc = "Thirty seconds ago, always at hand." (D-08); RU extName = "Mokosh — Запись сессии"; RU extDesc = "Тридцать секунд назад, всегда под рукой." en↔ru parity verified bytests/i18n/locale-parity.test.ts. - Branded Loom-mark icons (D-01): 8-bit RGBA via
rsvg-convert; replaces Bug A placeholders (was 16-bit RGB at 574/1153/2615 B; now 406/784/1952 B 8-bit RGBA). Clears Chrome imageUtil silent-rejection floors (16≥200B, 48≥500B, 128≥1024B). - BADGE_REC_COLOR flipped from material-green
#00C853to madder#b2543d(= --mks-madder-600 per D-04 loom palette). - src/popup/style.css carries ZERO hex literals (every color via
var(--mks-*)); imports../shared/tokens.css. src/popup/index.ts + src/background/index.ts readchrome.i18n.getMessage('<key>') || '<en-const-fallback>'at every operator-facing site. - UAT harness A18-A22 following Plan 01-13 Approach B pattern (page-side
assertA*+ host-sidedriveA*+ harness orchestrator). FORBIDDEN_HOOK_STRINGS at 13 entries (+1 over 01-14's 12 baseline fordata-mks-keycompleteness). Full A1-A14 + A18-A22 + A23 chain runs in ~95s under Puppeteer headless. - Pre-checkpoint bundle gates per feedback-pre-checkpoint-bundle-gates.md established: SW CSP grep (new Function/eval) + SW Node-globals grep (Buffer.*) + DOM-globals grep + manifest validation + en↔ru parity. Discovery: setimmediate polyfill
new Functionin SW chunk viavite-plugin-node-polyfills— VERIFIED pre-existing across Phase 1 history; NOT a Plan 01-12 regression; logged at.planning/phases/01-stabilize-video-pipeline/deferred-items.mdfor Phase 5 hardening. - vitest: 100 → 147 GREEN (+47 across 6 new test files at tests/build/ + tests/i18n/).
- UAT harness: 16/16 → 21/21 GREEN (A18-A22 added; A22 skip-gates on Plan 01-10 absent).
- Operator empirical brand-fit ack 2026-05-20 verbatim "all good" on fresh build + load unpacked + branded-surface verification (toolbar Loom icon, popup loom palette + Lora display heading, manifest:name resolution to "Mokosh — Session Capture", Russian copy rendering with Lora, notification copy via chrome.i18n).
- Plan 01-13 Task 9 (operator brand/design ack on loaded extension) functionally CLOSED via this checkpoint — same operator + same empirical surface coverage; the LAST remaining Phase 1 brand-design gate.
Outstanding Phase 1 gates
Plan 01-10 (welcome tab):CLOSED 2026-05-20 via cycle-2 operator ack "All good" + 5 inter-cycle debug fixes + brand-rename follow-up (SUMMARY at.planning/phases/01-stabilize-video-pipeline/01-10-SUMMARY.md; 153/153 vitest + 24/24 UAT GREEN; A22 flipped from skip-gate to functionally GREEN)- Phase 1 final-closure marker flip: pending REQUIREMENTS / ROADMAP / STATE markers + optional
/gsd-verify-work 1
Plan 01-13 closure (2026-05-19; brand/design ack subsequently closed via Plan 01-12 Wave 7 2026-05-20)
- Puppeteer-based UAT harness:
npm run test:uatexits 0 with 15/15 GREEN (A0-A14) - Bug A regression rewind empirically verified (commit body
6a77967) - Bug B regression rewind empirically verified (commit body
b665919) - Plan 01-09 functional contract closed via harness PASS per
01-09-PLAN.mdAmendment 2 - Operator UAT Task 9 ack'd 2026-05-19 ("all good" — recovery + restart-after-click covered by harness A7 + A2)
- Save-stops-recording charter divergence fixed inline via debug session (
.planning/debug/resolved/01-09-save-stops-recording.md):- Symptom: SAVE created zip but did NOT stop recording (badge stayed REC; Chrome share banner persisted)
- Root cause: implementation 01-09 over-extended "always-on safety net" framing; SPEC intent is one-shot
- Fix: SW SAVE_ARCHIVE handler dispatches STOP_RECORDING + setIdleMode in finally (
4f4c3e2) - Harness regression coverage: A14 added (
2b6c24b) — post-SAVE state check (badge='', popup='', no new recovery notif)
- CHARTER REVERSAL 2026-05-19 — save-does-not-stop-recording (
.planning/debug/resolved/01-09-save-does-not-stop-recording.md):- Operator UX iteration: prefers original "always-on safety net" framing (continuous recording; SAVE only creates a new zip)
- Revert: SW SAVE_ARCHIVE
finallyblock REMOVED (commit7645765) - Test file inversions:
tests/background/save-archive-does-not-stop-recording.test.ts(renamed viagit mv, history preserved; commit6ac23fd) - Harness A14 inverted to assert continuous-recording post-SAVE: badge='REC', popup endsWith popup.html, no new recovery notif (commit
1baaf45) - Plan 01-09 Amendment 3 landed documenting the reversed charter
- vitest preserved at 98 GREEN;
npm run test:uatpreserved at 15/15 GREEN under inverted contract
- Plan 01-11 closed as spike-pivot (
ba5474cSUMMARY); architecture lessons (noawait import(...)in SW;track.dispatchEvent('ended')nottrack.stop();__MOKOSH_UAT__Vite define-token) carried forward into Plan 01-13's Approach B harness - vitest: 83 → 98 GREEN across Plan 01-13 (+15: Tier-1 grep gate strings + hook contract tests + save-stops unit tests)
Outstanding Phase 1 gates
Plan 01-13 Task 9 (operator checkpoint):CLOSED 2026-05-20 via Plan 01-12 Wave 7 brand-fit ack "all good"Plan 01-12 (design integration):CLOSED 2026-05-20 (R2 Lora substitution + tokens.css canonical + 16 i18n keys + branded icons + manifest i18n; SUMMARYf319c7d)Plan 01-10 (welcome tab):CLOSED 2026-05-20 via cycle-2 operator ack "All good" + 5 inter-cycle debug fixes + brand-rename follow-up; SUMMARY at.planning/phases/01-stabilize-video-pipeline/01-10-SUMMARY.md- Phase 1 final-closure marker flip: pending REQUIREMENTS / ROADMAP / STATE markers + optional
/gsd-verify-work 1
Performance Metrics
Velocity:
- Total plans completed: 9
- Average duration: —
- Total execution time: —
By Phase:
| Phase | Plans | Total | Avg/Plan |
|---|---|---|---|
| 1. Stabilize video pipeline | 7 | ~50 min (+ 2 debug sessions ~45 min) | 7 min |
| 2. Stabilize DOM + event capture privacy | 0 | — | — |
| 3. Stabilize export pipeline | 0 | — | — |
| 4. SPEC §10 smoke verification | 0 | — | — |
| 5. Harden + clean up | 0 | — | — |
| 02 | 4 | - | - |
| 03 | 5 | - | - |
Recent Trend:
- Last 5 plans: 4min, 4min, 8min, 3min, ~10min (Plan 07 closure incl. debug-session arbitration)
- Trend: stable execution time; complexity surfaced in debug sessions (pre-staged fallbacks activated cleanly)
Updated after each plan completion | Phase 01 P01 | 4min | 6 tasks | 6 files | | Phase 01 P02 | 4min | 5 tasks | 8 files | | Phase 1 P03 | 8min | 3 tasks | 5 files | | Phase 01 P04 | 4min | 3 tasks | 1 files | | Phase 01 P05 | 8min | 2 tasks | 1 files | | Phase 1 P06 | 3min | 2 tasks | 2 files | | Phase 1 P07 | ~10min closure + 2 debug sessions (D-12 + A3) | 2 tasks (checkpoint + auto) | 6 files (fixture + REQUIREMENTS + ROADMAP + STATE + SUMMARY + plan-final-commit) | | Phase 01 P14 | 49m | 1 tasks | 7 files | | Phase 01 P12 | ~10h cumulative (7 waves; 10 plan tasks + 1 operator empirical checkpoint) | 10 tasks (7 waves + Wave 7 pre-checkpoint + brand-fit ack) | ~50+ files (8 WOFF2 + 3 PNG + 2 _locales + tokens.css + 6 unit-test files + harness + scripts + 4 source files modified) | | Phase 01 P10 | ~5h cumulative (4 waves; 5 plan tasks + 5 inter-cycle debug sessions + cycle-2 follow-up brand-rename ack) | 5 tasks (Wave 0 RED + Wave 1 bundle + Wave 2 SW wiring + Wave 3 harness + Wave 4 operator UAT cycle-2) | 14 files (4 new src/welcome/* + globals.d.ts + 2 unit-test files + 3 harness files + src/background/index.ts + manifest + 2 Vite configs + closure-cycle debug touches: _locales + README + package.json + onstartup-notification.test.ts + onboarding-tests + manifest-i18n.test.ts) | | Phase 04 P01 | 30m | 2 tasks | 5 files | | Phase 04 P02 | 41min | 2 tasks | 5 files | | Phase 04 P03 | 46min | 2 tasks | 2 files | | Phase 04 P04 | ~25min | - tasks | - files |
Accumulated Context
Decisions
Decisions are logged in PROJECT.md Key Decisions table (DEC-001 through DEC-012, all SPEC-Accepted and locked for Phase 1). Recent decisions affecting current work:
-
Phase 1 framing: roadmap treats the existing codebase as a partially-broken first attempt to be remediated against the SPEC, not as greenfield. The 7 P0 defects from the audit are split across phases 1–3 along commit boundaries; phase 4 is end-to-end SPEC §10 smoke verification.
-
All 12 SPEC decisions (
DEC-001..DEC-012) are LOCKED for Phase 1. Changing any of them requires a formal ADR; none are formally LOCKED in the ingest classification, so a future ADR can revise. -
[Phase ?]: Doc cascade: amendments append (do not replace) original DEC/CON blocks to preserve SPEC provenance — Established convention for future SPEC-amending phases; downstream readers see both old + new with citation
-
[Phase ?]: Manifest: drop alarms permission entirely rather than retain for re-use — Plan 05 deletes the alarms code path; declaring unused permissions expands attack surface (T-1-02)
-
[Phase ?]: Pinned vitest at ^4 (4.1.6 latest stable; 5.x still beta on 2026-05-15)
-
[Phase ?]: Phase 1 Wave-0 test infra: 4 RED tests committed against not-yet-existent src/offscreen/recorder.ts — pins contracts for Plans 03+04
-
[Phase ?]: Reverted premature REQ-video-ring-buffer Complete marking left by Plan 01-01; satisfied by Plans 03+04+07, not by Wave-0 RED tests
-
[Phase 01-03]: Bundled OffscreenLogger into Task 2 commit (Rule 3 blocking dependency — recorder.ts cannot typecheck without the import)
-
[Phase 01-03]: Defensive bootstrap guard (typeof chrome check) lets pure ring-buffer test import recorder module without chrome stub
-
[Phase 01-03]: Removed SW-side VIDEO_CHUNK/VIDEO_CHUNK_SAVED branches + IndexedDB helpers inline (tsc-clean requires; Plan 05 owns remaining SW shrink)
-
[Phase 01-04]: Kept Plan 03's defensive bootstrap guard (typeof chrome / per-API existence checks) instead of Plan 04's verbatim unguarded block — Plan 04's verbatim block regressed ring-buffer and codec-check tests (they don't stub full chrome surface); restored guard preserves Plan 02 RED contract while satisfying Plan 04's new GREEN contract. Rule 1 deviation.
-
[Phase 01-04]: T-1-04 SW-side sender check documented redundantly (4 places in recorder.ts) for Plan 05 executor visibility — Offscreen is trusting party; SW is validating party. Documenting in module header, port-name constant, threat-mitigation comment near bootstrap, and inline at connectPort makes the contract impossible to miss when grepping for T-1-04 during Plan 05.
-
[Phase 01-04]: REFACTOR pass NOT skipped: stale 'Plan 04 wires this' comments replaced with actual D-17/Pattern 5 citations — Forward-pointing TODO-style comments became misleading after the work landed; minimal correctness-preserving comment update with all 9 tests still GREEN.
-
[Phase ?]: [Phase 01-05]: Deleted broken checkPermissions / requestPermissions flow (Rule 1)
-
[Phase ?]: [Phase 01-05]: REQUEST_PERMISSIONS collapsed — under getDisplayMedia (D-01) no runtime perm check is meaningful; the broken 'tabCapture' permission check was sending recording-start into the never-granted branch
-
[Phase ?]: [Phase 01-05]: Added chrome.offscreen.hasDocument() in initialize() — Rule 2 robustness, audit P1 #8 mitigation across SW respawns
-
[Phase ?]: [Phase 01-05]: SW is now a pure coordinator — onConnect host bound to 'video-keepalive' port with T-1-04 sender check; getVideoBufferFromOffscreen replaces synchronous SW-local buffer fetch; OFFSCREEN_READY handshake closes the audit P1 #12 race
-
[Phase ?]: [Phase 01-05]: indexedDB.deleteDatabase('VideoRecorderDB') in onInstalled — T-1-NEW-05-02 / RESEARCH.md Runtime State Inventory cleanup of orphaned IDB from pre-Phase-01 builds
-
[Phase ?]: [Phase 01-06]: Collapsed vite.config.ts from 226 -> 21 lines (RESEARCH.md Example B verbatim); deleted 174-line inline copy-offscreen plugin (audit P0 #1 root cause) and the orphan offscreen/ top-level directory (D-08)
-
[Phase ?]: [Phase 01-06]: crxjs Outcome A confirmed — dist/src/offscreen/index.html (preserves src/ prefix from rollupOptions.input key). SW URL adjusted to chrome.runtime.getURL('src/offscreen/index.html'); RESEARCH.md Pitfall 5 binding empirically verified
-
[Phase 01-07-debug-d12]: D-12 port-blob serialization fixed via base64 wire-format encode/decode (debug session d12-blob-port-transfer-fails resolved 2026-05-15). chrome.runtime.Port JSON-serializes payloads across extension contexts so Blob payloads were silently corrupted (JSON.stringify(blob) === "{}" → SW saw [{}, {}, ...] → new Blob([...]) coerced each to "[object Object]" → 75-byte text instead of WebM). Added src/shared/binary.ts (blobToBase64 / base64ToBlob), TransferredVideoChunk wire-format type, offscreen encode side, SW decode side. All 15 tests green incl. 6-test port-serialization spec. Re-run smoke.sh + ffprobe still required for end-to-end verification.
-
[Phase 01-07-debug-a3]: D-13 restart-segments activated (debug session webm-playback-freeze resolved 2026-05-15). Plan 07 smoke retest after D-12 landed revealed the next-layer A3 failure: the ffprobe-valid WebM froze ~1 s into playback in Chrome because the single-continuous-recorder + 30 s age-trim lifecycle (D-09..D-11) evicted middle chunks containing VP9 keyframe references for retained tail chunks (orphan P-frames). Activated the pre-staged D-13 skeleton in src/offscreen/recorder.ts: stop+restart MediaRecorder every SEGMENT_DURATION_MS=10_000 ms on the same MediaStream, keep last MAX_SEGMENTS=3 self-contained WebM segments (3×10s=30s window preserved). Each segment fresh-encoded → own EBML header + seed keyframe → independently decodable. Side-effect: .stop() per segment fixes the "File ended prematurely" Matroska finalization gap. Type renames propagated: TransferredVideoChunk → TransferredVideoSegment, VideoChunk → VideoSegment, PortMessage.chunks → PortMessage.segments, VideoBufferResponse.chunks → VideoBufferResponse.segments; the header-pin flag from D-09..D-11 is dropped entirely. D-09..D-11 retired in favor of D-13. 28/30 tests pass; the 2 remaining reds are the empirical ffmpeg dry-runs against the still-stale committed fixture (operator regen required). REQ-video-ring-buffer NOT marked complete — Plan 07 still owns that, gated on the operator running ./smoke.sh then verifying Chrome playback + ffmpeg-clean stderr.
-
[Phase 01-07-closure]: Phase 1 closed 2026-05-15: D-12 + A3 acceptance gates both passed. Operator-confirmed Chrome playback clean (no ~1 s freeze); ffmpeg
-v warning -i tests/fixtures/last_30sec.webm -f null -exit 0 with zero decoder errors (only expected muxer DTS-monotonicity warnings at segment join boundaries — non-blocking, documented D-13 trade-off for multi-EBML-header concat); ffprobe + empirical playback both green; 30/30 vitest green (the 2 webm-playback empirical dry-runs flipped GREEN after the fresh fixture committed incd61cbc); REQ-video-ring-buffer marked Complete; SPEC §10 #2, #3, #7 functionally satisfied (end-to-end Phase 4 smoke still owns the full §10 sweep). Three atomic closure commits land the fixture + REQ/STATE/ROADMAP flip + SUMMARY. Process note: Plan 01-07 surfaced TWO unanticipated-cascade failures (D-12 then A3); both had pre-staged fallbacks (base64 wire-format and D-13 restart-segments) that activated cleanly. Candidate retro: should/gsd-plan-phaseauto-inject empirical-acceptance gates (ffmpeg dry-run + Chrome playback) before merging a phase when RESEARCH.md flags HIGH-risk assumptions? -
[Phase 01-07-deferred-to-5]: getDisplayMedia cursor visibility constraint (
video: { cursor: 'always' }) surfaced as a user observation during Phase 1 smoke 2026-05-15. Captured frames lack the screen cursor despite it being the highest-signal cue for reproducing pointer-driven bugs. Constraint is opt-in per the getDisplayMedia spec; Chrome implements CursorCaptureConstraint (always/motion/never). Logged to Phase 5 P1/P2 hardening list — not blocking Phase 1 closure. -
[Phase ?]: Plan 01-14 — monitorTypeSurfaces:'include' shipped as top-level DisplayMediaStreamOptions constraint (W3C spec §6.1; Chrome ≥ 119 picker narrowing); A23 harness gate + Tier-1 grep lockstep extension to 12 strings; 100/100 vitest + 16/16 UAT GREEN. types.ts NOT modified — new cell/op are module-internal.
-
[Phase 01-12]: Design integration landed end-to-end via 7 waves + operator brand-fit ack 2026-05-20 "all good". R2 designer substitution (Newsreader → Lora; Cyreal foundry; OFL-1.1; full Cyrillic via reply 2026-05-19) baked in; src/shared/tokens.css canonical with 8 local @font-face rules + zero remote URLs (MV3 CSP self-host invariant); 16 i18n keys per locale across en + ru with parity; branded Loom-mark icons replace Bug A placeholders (8-bit RGBA); src/popup + src/background migrated to chrome.i18n.getMessage with
|| <const>fallback; BADGE_REC_COLOR flipped from material-green #00C853 to madder #b2543d (= --mks-madder-600 per D-04). UAT harness A18-A22 GREEN. Pre-checkpoint bundle gates established per feedback-pre-checkpoint-bundle-gates.md (5 grep gates pre-checkpoint; setimmediate polyfill new Function in SW chunk verified pre-existing across Phase 1 history — logged to deferred-items.md for Phase 5 hardening). vitest 100 → 147 GREEN (+47); UAT 16 → 21 GREEN (+A18-A22; A22 skip-gates on Plan 01-10 absent). -
[Phase 01-12]: Plan 01-13 Task 9 (operator brand/design ack on loaded extension) functionally closed via Plan 01-12 Wave 7 brand-fit ack 2026-05-20 (same operator + same empirical surface coverage). This was the LAST remaining Phase 1 brand-design gate.
-
[Phase 01-10]: First-install operator-friendly activation landed end-to-end via 4 waves + Wave 4 operator empirical UAT cycle 2 ack "All good" 2026-05-20. chrome.runtime.onInstalled('install') + chrome.storage.local flag-gating + chrome.tabs.create with fire-and-forget .catch defense-in-depth (helper at src/background/index.ts:~186, called after initialize()). Plan 01-12 must_have #9 path-B contract honored end-to-end: welcome.css
@import '../shared/tokens.css';resolves canonical tokens (Lora display + IBM Plex Sans UI + D-04 Loom palette); chrome.i18n.getMessage for welcomeHeroRu + welcomeHeroEn with|| <en-const>fallback (Plan 01-12 fallback pattern). Vite?urlimport + auto-WAR idiom bundles canonical mokosh-mark.svg as inline data URL in welcome chunk (debug 01-10-welcome-page-missing-mark resolved cycle-1 mark-bundling gap). Harness A15-A17 (24/24 UAT GREEN; A17 grew to 8 sub-checks incl. A17.7 getComputedStyle probe verifying --mks-rec resolves to rgb(178,84,61) AND A17.8 mark-bundling invariant). FORBIDDEN_HOOK_STRINGS unchanged at 12 (A15-A17 use chrome.tabs.query + chrome.storage.local.get + fetch + DOMParser + getComputedStyle production APIs exclusively). vitest 147 → 153 GREEN (+6: 3 onboarding tests + 3 start-video-capture-no-tab tests). 5 inter-cycle debug sessions resolved cycle-1 rejection + cycle-2 brand-rename ask:4bba679notifStartup text split +d48a715welcome mark +0854bafvitest timeout +a2dfc8cstartVideoCapture no-tab cleanup +d21ed17brand polish "AI Call Recorder" → "Mokosh". -
[Phase 01-10]: D-16-toolbar charter preserved verbatim — welcome page is informational + read-only; NO REQUEST_PERMISSIONS message type, NO chrome.runtime.sendMessage start path, NO duplicate getDisplayMedia trigger. CTA copy directs operator at toolbar icon. Toolbar onClicked (Plan 01-09) remains the SINGLE start path through chrome.action.onClicked in idle mode.
-
[Phase 01-10]: Three-pipeline DOM population pattern established for src/welcome/welcome.ts: populateMark() walks [data-mokosh-slot='mark'] (canonical SVG via Vite ?url import); populateCopy() walks [data-mokosh-key] (textContent from in-file COPY map for non-tagline strings); populateI18n() walks [data-mokosh-i18n-key] (textContent from chrome.i18n.getMessage with
|| <en-const>fallback for the D-08 tagline strings). Init order populateMark → populateCopy → populateI18n. Filter-pipeline form throughout (no continue per project style). data-mokosh-slot wrapper attribute preserved as design-swap landmark for forward-compat. -
[Phase 01-10]: Closure-cycle debug commit
a2dfc8cremoved pre-D-01 dead code from startVideoCapture (chrome.tabs.query({active:true}) + throw 'No active tab found') — the legacy block was load-bearing in the chrome.tabCapture era but functionally dead post-D-01 (getDisplayMedia whole-desktop in offscreen has no tab dependency). The bug surfaced via the notifications.onClicked path after the new CTA copy in4bba679explicitly invited the click. captureScreenshot() + saveArchive() retain their own genuine tab queries (out of scope for surgical fix). +3 RED→GREEN tests at start-video-capture-no-tab.test.ts pinning the new no-active-tab contract. -
[Phase ?]: [Phase 04-01]: Audit P1 polish landed end-to-end via TDD pair (
3dbc51cRED +7da30afGREEN). Three surgical edits in src/content/index.ts: (1) module-level let previousUrl tracker initialized at module load with typeof-window node-env guard, swapped-and-emitted in handleNavigation so meta.previousUrl carries the operator's actual prior URL (was always 'unknown'); (2) instanceof Request type-narrow inlined at both fetch-wrapper sites (ok-branch line ~190 + catch-branch line ~210), replacing args[0]?.toString() that resolved to literal '[object Request]' for fetch(new Request(url)); (3) event.timestamp = Date.now() prepended in rrweb record() emit callback at line 315, normalizing rrweb-internal page-load-relative timestamps to Unix-epoch ms so cleanupOldEvents (now - event.timestamp) arithmetic at line 33 is meaningful. 9 new vitest tests under tests/content/ (NEW directory) pin all three contracts; baseline 171 -> 180/180 GREEN; tsc-clean preserved; Tier-1 FORBIDDEN_HOOK_STRINGS inventory unchanged at 12. Audit P1 polish backlog CLOSED 3/3. -
[Phase ?]: [Phase 04-02]: Layered 4-mechanism CSP-hardening for transitive-polyfill pre-bundled-distribution interception (runtime queueMicrotask polyfill prelude + nodePolyfills exclude + resolve.alias.setimmediate + stripSetimmediateNewFunction Rollup post-transform plugin). Option α (force JSZip unbundled lib/index.js) attempted + reverted because it broke readable-stream-browser browser-field propagation causing UAT A30+ regressions. Option β preserves JSZip pre-bundled distribution verbatim while excising the offending literal post-bundle.
-
[Phase ?]: [Phase 04-02]: ROADMAP SC #3 (generate-icons ESM/CJS) closed via git mv generate-icons.js generate-icons.cjs — Node 14+ treats .cjs as CJS regardless of package.json type:module per nodejs.org/api/packages.html#determining-module-system. No code change. ROADMAP SC #4 (dead-code grep permissions.request) GREEN regression-pinned via tests/build/dead-code-grep.test.ts. Plan 01-12 Wave 7 setimmediate deferred-items entry CLOSED end-to-end. SW chunk new Function count polarity flipped 1 → 0. UAT 33/33 GREEN preserved.
-
[Phase 04-03]: A29 rewrite — cs-injection-world pattern (verbatim port of Plan 03-02 assertA30 / 03-03 assertA31 skeleton) + strict-sentinel filter (RESEARCH Q3 Code Example Pattern 3) closes the documented iana.org-leftover flake. assertA29 page-side: chrome.tabs.create(https://example.com) + chrome.scripting.executeScript world:'ISOLATED' injects sentinel-bearing
into document.body. driveA29 host-side: filter events by EventType.IncrementalSnapshot + IncrementalSource.Mutation, then descend into data.adds[*].node.textContent for 'a29-mutation-sentinel'. A29.2 strict-sentinel is THE primary check; A29.3 + A29.4 (Meta + FullSnapshot) preserved as defense-in-depth; pre-rewrite A29.5 (loose IncrementalSnapshot >=1) retired (subsumed). Empirical: 5/5 PASS across consecutive UAT runs (was ~2/3 historical). vitest 183/183 GREEN preserved. Tier-1 FORBIDDEN_HOOK_STRINGS unchanged at 12 (rides production chrome.tabs.create + chrome.scripting.executeScript per DEC-011 Amendment 1 grant + manifest scripting permission). -
[Phase ?]: [Phase 04-04]: Wave 0 SPIKE FAILED
-
[Phase 04-04]: Wave 0 SPIKE FAILED — empirically refutes RESEARCH Q2 MEDIUM-confidence A3 (offscreen-document independent lifecycle). videoSize=8505 bytes after 5min idle + Puppeteer CDP worker.close() (sanity floor 100KB; typical 1-3MB). 8505 bytes are corrupt WebM per ffprobe (End of file + Duplicate element; no valid clusters); rrweb/session.json=[]; logs/events.json=[]; meta.urls=chrome-extension://* only. Conclusion: src/offscreen/recorder.ts:91 'let segments: Blob[] = []' RAM-only architecture does NOT survive 5-min SW idle. ROADMAP SC #1 remains OPEN; Task 2 (A33 verification-only) BLOCKED by gating condition; plan-fix ceremony required to add IndexedDB persistence per RESEARCH Q2 sub-question b Option C. Spike-first contract honored — STOP at Task 1; do NOT improvise inline; route to plan-fix ceremony per saved-memory feedback-gsd-ceremony-for-fixes.md.
-
[Phase 04-04]: stopServiceWorker(browser, extensionId) helper landed at tests/uat/lib/harness-page-driver.ts (verbatim Chrome devrel canonical pattern — Puppeteer >=22.1.0 worker.close()). Persisting artifact retained even though Task 2 BLOCKED — helper is non-empty positive scaffolding for the eventual IndexedDB-persistence plan-fix verification harness (A33-equivalent reuse). Pattern: spike-FAILED forensic-evidence — commit the spike script (tests/uat/spike-a33-sw-persistence.ts; 202 lines) AND the persisting helpers (not delete) so future plan-fix can re-run the exact reproducible test that revealed the failure.
Pending Todos
None yet.
Blockers/Concerns
- (informational)
chrome.tabCapturerequires a user gesture on first activation — Phase 3 (P0-4) restores this by moving the call into the popup click handler; until Phase 3 lands, recording cannot start cleanly even if Phase 1's pipeline is correct. Phases 1–3 should not be re-ordered.
Deferred Items
Items acknowledged and carried forward from previous milestone close:
| Category | Item | Status | Deferred At |
|---|---|---|---|
| (none) |
Session Continuity
Last session: 2026-05-21T17:11:40.684Z Stopped at: Completed 04-02-PLAN.md (setimmediate polyfill replaced via layered 4-mechanism mitigation; SW new Function polarity 1→0; UAT 33/33 GREEN preserved) Resume file: None
Prior session: 2026-05-21T08:22:59.958Z — /gsd-pause-work saved Phase 4 execution-ready handoff (dbcf482); Phase 4 plans validated iter-2 PASSED + 3 cosmetic advisories fixed
Earlier session: 2026-05-20T12:54:42.000Z — /gsd-pause-work saved Phase 2 execution-ready handoff (a440c7d); Phase 1 closed end-to-end via verifier audit GREEN (586836f); alpha distribution shipped (dist-archives/mokosh-build-2026-05-20-6dbed91.zip)
Earlier session: 2026-05-20T12:00:00.000Z — Plan 01-10 closed via cycle-2 operator ack "All good" + 5 inter-cycle debug fixes + brand-rename follow-up
Even earlier: 2026-05-20T08:00:00.000Z — Plan 01-12 closed via Wave 7 operator brand-fit ack 2026-05-20 'all good' (SUMMARY f319c7d; 147/147 vitest + 21/21 UAT GREEN)
Earlier session: 2026-05-19T19:41:05.737Z — Completed Plan 01-14 (commit b467123 + SUMMARY 5254145; 16/16 UAT + 100/100 vitest GREEN)
Even earlier session: 2026-05-17T14:30:13Z — resumed from /gsd-pause-work checkpoint ed82fd6; Bug A icons (a881bf0) + intel-unlock (f768498) committed; /gsd-debug spawned for Bug B state-machine routing (subsequently resolved via the recovery-flow amendment at Plan 01-09 Task 5 step 11)
Phase 1 Closure Notes
- ffprobe exit code: 0 (
ffprobe -v error -f matroska -i tests/fixtures/last_30sec.webm) - ffmpeg dry-run exit code: 0 (
ffmpeg -v warning -i tests/fixtures/last_30sec.webm -f null -) — stderr contains only the expected muxer DTS-monotonicity warnings at segment join boundaries; no decoder errors. Documented D-13 trade-off for multi-EBML-header WebM concatenation; Chrome's MSE pipeline handles this natively (SPEC §10 #7 scope: "plays back in a browser" — Chrome confirmed). - Fixture:
tests/fixtures/last_30sec.webm= 1 633 459 bytes (1.6 MB), VP9 codec, Profile 0, 1142×1038, color space bt709, time_base 1/1000, start_pts 0. Captured against the D-13 restart-segments recorder (3 × ~10 s self-contained segments). - Test suite: 30/30 green across 8 files (
tests/offscreen/); both empirical ffmpeg dry-runs inwebm-playback.test.tsflipped GREEN after the fresh fixture committed incd61cbc. - Phase 1 outcome: SPEC §10 acceptance criteria #2 (continuous capture), #3 (≤ 30 s window), and #7 (last_30sec.webm plays in a browser) are functionally green at the Phase 1 level. End-to-end §10 smoke verification remains owned by Phase 4 (all 9 criteria sweep).
- Phase 2 onwards: Phase 2 owns the DOM/event-capture privacy slice (REQ-rrweb-dom-buffer, REQ-user-event-log, REQ-password-confidentiality). Phase 3 owns the popup state machine + base64-URL replacement. Phase 4 runs the full SPEC §10 smoke pass. Phase 5 absorbs P1/P2 hardening (now includes the
getDisplayMediacursor visibility refinement surfaced 2026-05-15). - Process retro candidate: Plan 07 surfaced two cascade failures (D-12 binary transfer + A3 cluster alignment). Both had pre-staged fallbacks (base64 wire-format and D-13 restart-segments) which activated cleanly. The smoke-test step ended up doing the empirical-acceptance-gate work that RESEARCH.md flagged as HIGH-risk. Worth raising in a GSD-framework retro: should
/gsd-plan-phaseauto-inject empirical-acceptance gates (ffmpeg dry-run + Chrome playback) BEFORE merging a phase when RESEARCH.md flags HIGH-risk assumptions, rather than discovering it via Plan 07's smoke step?