Commit Graph

119 Commits

Author SHA1 Message Date
e035fd279d docs(01-09): Amendment 3 + 01-13 SUMMARY reversal note + STATE.md sync + debug records
Plan 01-09 Amendment 3 (2026-05-19) — atomic documentation pass for
the save-does-not-stop-recording charter reversal.

Changes:
- .planning/phases/01-stabilize-video-pipeline/01-09-PLAN.md:
  Amendment 3 block added above <success_criteria> (mirrors
  Amendment 2 placement). Describes the reversed charter,
  references the new debug record, points at the inverted
  test file + harness A14.
- .planning/phases/01-stabilize-video-pipeline/01-13-SUMMARY.md:
  "Subsequent Reversal (2026-05-19)" footer added. Notes that
  npm run test:uat still 15/15 GREEN under the inverted A14
  contract; vitest baseline preserved at 98 GREEN.
- .planning/STATE.md:
  Plan 01-13 closure block extended with CHARTER REVERSAL bullet
  citing the 4 commit SHAs (6ac23fd RED, 7645765 GREEN,
  1baaf45 A14 invert, this commit docs).
- .planning/debug/resolved/01-09-save-stops-recording.md:
  SUPERSEDED 2026-05-19 footer appended (audit trail; original
  fix was technically correct against its charter, reversal is
  UX iteration not technical defect).
- .planning/debug/resolved/01-09-save-does-not-stop-recording.md:
  NEW debug record landed directly in resolved/ (no checkpoint
  cycle — orchestrator-diagnosed reversal). Documents symptom,
  charter clarification cycle, fix shape, RED→GREEN evidence
  with commit SHAs + vitest/harness output, anti-regression
  coverage at unit + E2E layers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 17:50:49 +02:00
8d1c8fb0cc docs(01-12): create Plan 01-12 (Design Integration; R2 Lora unblocks; 7 waves)
Final designer reply received 2026-05-19 unblocks Plan 01-12: R2
substitution — replace Newsreader with Lora (OFL, Cyreal foundry, full
Cyrillic-Latin parity, variable wght 400-700). All 9 brand decisions
now resolved; R2 displaces Newsreader from `--mks-font-display`.

Plan structure: 7 waves, 10 tasks.

- Wave 0 (TDD scaffolds): 6 RED unit tests — tokens-adopted,
  fonts-present, icons-present, no-remote-fonts, manifest-i18n,
  locale-parity. Each RED until its corresponding artifact wave lands.
- Wave 1: Self-host OFL font bundle (Lora variable normal + italic,
  Plex Sans ×4, Plex Mono ×2) at src/shared/fonts/ via pyftsubset
  (Latin + Cyrillic basic subset); land src/shared/tokens.css canonical
  (Google Fonts @import → 7 local @font-face rules; Newsreader → Lora
  per R2; .mks-word class added per RESEARCH §8 + lockup SVG line 21).
- Wave 2: Rasterize Loom mark to icons/icon{16,48,128}.png via
  rsvg-convert; overwrite Bug A placeholders; 8-bit RGBA at all sizes.
- Wave 3: Land _locales/{en,ru}/messages.json (12 keys: 8 Brief §02
  operator strings + 4 supporting keys); manifest.json → __MSG_extName__
  + __MSG_extDesc__ + default_locale 'en' + action.default_title.
  extName='Mokosh — Session Capture' per D-07 user override; extDesc per
  D-08 brand-decisions-v1.md wording.
- Wave 4: src/popup/ + src/background/ adopt tokens.css (loom palette)
  + chrome.i18n.getMessage at every operator-facing copy site; replace
  hex literals with var(--mks-*) references; BADGE_REC_COLOR madder
  '#b2543d' (= --mks-madder-600 per D-04 + RESEARCH §10 Open Q A7).
- Wave 5: Welcome page conditional migration (if 01-10 landed, swap
  welcome-tokens.css → @import canonical tokens.css; migrate copy.ts
  shim to chrome.i18n.getMessage fallback); add __VITE_DEV__ define
  per RESEARCH §12 D-09 spirit; scripts/README.md smoke-isolation note.
- Wave 6: UAT harness A18-A22 (font reachability via document.styleSheets
  walk + fetch + byteLength; icon-not-placeholder via fingerprint diff;
  manifest:name === 'Mokosh — Session Capture'; --mks-font-display
  resolves to Lora via getComputedStyle; welcome tokens loaded
  conditional on 01-10). Tier-1 forbidden-strings UNCHANGED at 10.
- Wave 7: Operator empirical brand-fit checkpoint (last Phase 1 gate);
  SUMMARY + STATE.md + ROADMAP.md sync.

ROADMAP.md Phase 1 plan list extended from 7 → 13 entries (gap noted in
01-13 SUMMARY's known-limitations now closed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 14:59:59 +02:00
3a530c2334 docs(01-10): rewrite plan in place — D-02/D-08/D-17-onboarding charter + design-swap-in-ready arch + harness A15+A16+A17
Drops the 2026-05-17 draft (zero commits, zero SUMMARY — virgin). Carries:
- onInstalled flag-gated welcome tab (3 RED→GREEN unit tests; storage-key contract pinned per prior I-02 fix)
- 5 new src/welcome/* files: welcome.html + welcome.ts + welcome.css + welcome-tokens.css + copy.ts
- Design-swap-in-ready: every color via var(--mks-*); every string via COPY map; every font via var(--mks-font-*) with system fallback
- vite.config.ts + vite.test.config.ts both gain welcome rollup input
- manifest.json gains web_accessible_resources for welcome.html
- Harness extended A15+A16+A17 (onboarding flag observability + no-re-open settle + design-swap invariant); Tier-1 forbidden-strings inventory unchanged at 10
- 4 autonomous tasks + 1 operator empirical checkpoint

Deletes: REQUEST_PERMISSIONS flow (gone in 01-09); duplicate Start button (D-16-toolbar owns start path); start-path divergence

Cites: D-17-onboarding (CONTEXT.md L537+), D-02 (welcome layout), D-08 (tagline), D-03 (voice register), D-16-toolbar (start ownership), brand-decisions-v1-followup-display-font.md (Plan 01-12 blocker; this plan ships TODAY with placeholders)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 14:23:56 +02:00
285e46f620 docs(01-13): close — operator UAT ack 2026-05-19 + save-stops debug resolved + SUMMARY landed
Plan 01-13 fully closed. Operator UAT acked "all good" on 2026-05-19;
recovery flow (A7) + restart-after-click (A2) both harness-covered, no
manual verification needed.

What this commit lands:
- 01-13-SUMMARY.md (full spike-pivot-then-implementation narrative; tracks
  all 16 commits across Plan 01-11 spike + Plan 01-13 4-wave execution +
  save-stops debug session; documents 15/15 npm run test:uat GREEN +
  98/98 vitest GREEN + Bug A/B regression-rewind demos verified)
- Save-stops debug record moved to .planning/debug/resolved/ (closure-
  canonical location; prior inline path tracked via git mv)
- STATE.md sync: completed_plans 11→12, percent 95→96, Plan 01-13
  fully-closed narrative + save-stops debug session captured

Phase 1 functional contract: CLOSED via harness PASS.
Remaining Phase 1 gates: Plan 01-10 (welcome tab) + Plan 01-12 (design
integration; pending designer Newsreader-Cyrillic reply).

Phase 2 inherits the harness as its closure-gate template.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 13:46:49 +02:00
89f3337334 docs(01-09-save-stops): debug record — RED → GREEN → A14 evidence + closure notes
Updates .planning/debug/01-09-save-stops-recording.md with:
  - status awaiting_human_verify
  - SHA references (red_commit cd83eb0, green_commit 4f4c3e2, a14_commit 2b6c24b)
  - Verification evidence (98/98 unit GREEN, 15/15 UAT GREEN, tsc+build clean)
  - Vitest + UAT output snippets
  - A14 design rationale
  - Noteworthy: no PortMessage/Message changes (STOP_RECORDING already
    in MessageType + offscreen handler already wired); resetBuffer
    intentionally NOT called by SW post-save (offscreen.stopRecording
    deliberately omits it; next session's startRecording handles it);
    empty-buffer trade-off (brief recovery notif in production, badge
    still resolves to OFF — documented inline in src/background/index.ts).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 13:32:51 +02:00
cd83eb0498 test(01-09-save-stops): RED — SAVE_ARCHIVE triggers STOP_RECORDING + setIdleMode + no recovery notif
Plan 01-13 Task 9 operator UAT closure. Operator 2026-05-19 empirical
session: SAVE click downloaded zip but recording stayed live (badge=REC,
sharing banner persisted, subsequent toolbar press re-opened SAVE-only
popup). Operator pressed 4×, got 2 zips + confusion.

Root cause: src/background/index.ts saveArchive() returns success after
chrome.downloads.download without signaling offscreen to stop or
transitioning the SW state machine — SPEC `Тз расширение фаза1.md`
"one click MUST produce a self-contained archive" was over-extended to
"always-on" framing by the implementation.

Fix contract (RED today; GREEN after src/background/index.ts patch):

  A: setBadgeText({text:''}) called post-save (setIdleMode side effect)
  B: setPopup({popup:''}) called post-save (re-enables chrome.action.onClicked
     restart path per MV3 contract)
  C: chrome.runtime.sendMessage({type:'STOP_RECORDING'}) dispatched
     (offscreen recorder.ts:848 STOP_RECORDING case already wired —
     no offscreen-side change needed)
  D: NO mokosh-recovery-* notification fires (deliberate stop ≠ error;
     mirrors Bug B `user-stopped-sharing` suppression branch from
     .planning/debug/resolved/01-09-recovery-flow.md)

Tests A/B/C RED (assertion errors `expected 0 >= 1`); Test D GREEN today
as the regression guard against fix over-rotating to setErrorMode.

Test architecture mirrors tests/background/request-id-protocol.test.ts:
synthetic BUFFER response delivered via port.onMessage listeners to drive
saveArchive's request-id'd buffer fetch to completion. Empty-segments
BUFFER causes createArchive → EmptyVideoBufferError → catch branch; the
fix's STOP+IDLE dispatch MUST happen on both success and empty-buffer
paths (operator UI contract: SAVE click = stop, success or empty alike).

Debug record: .planning/debug/01-09-save-stops-recording.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 13:17:19 +02:00
9c5ff8b2a7 docs(01-13): wave-4 task-8 — Plan 01-09 closure-via-harness amendment + STATE.md sync
Lands the Wave 4 closure docs:
- 01-09-PLAN.md Amendment 2: harness PASS (npm run test:uat 14/14 GREEN at d793c9e)
  now closes Plan 01-09 functional contract (original Task 5 steps 4, 5, 7-13, 15);
  operator retains only step 1 (build) + step 14 (brand/design ack — Plan 01-13
  Task 9 charter). Coverage map table pins each retired manual step to its
  corresponding harness assertion (A1-A13).
- STATE.md sync: completed_plans 9->11, percent 92->~95, last_updated
  2026-05-19T10:40:00Z; Current Position narrative replaced with Plan 01-13
  landing summary + outstanding Phase 1 gates (Plan 01-13 Task 9 operator
  checkpoint, Plan 01-10 welcome tab, Plan 01-12 design integration awaiting
  designer reply).

Verification (post-edit, docs-only — no src/ touched):
- npm run test:uat: 14/14 GREEN at d793c9e baseline preserved
- npx vitest: 94/94 (the no-test-hooks-in-prod-bundle.test.ts default 5s timeout
  flake is harness-side, not introduced by this commit; re-run with
  --testTimeout=60000 passes)
- git status post-commit: clean

Followup: ROADMAP.md is missing entries for Plans 01-08 through 01-12 (these were
all added mid-phase across multiple sessions and the roadmap was never amended;
the Phase-1 Plans block lines 74-80 stops at 01-07 and the progress table line
238 shows the stale '7/7 Complete' count). Backfilling those entries is a
separate concern — out of scope for Plan 01-13 closure per plan-checker flag #4
(hold the line; do not inject). STATE.md notes the counter > total mismatch for
visibility.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 10:50:13 +02:00
70f4f4136a docs(01-13): create UAT harness plan — Approach B (extension-internal page)
5 waves, 9 tasks. Inherits Plan 01-11 spike-pivot rationale per
01-11-SUMMARY (commit ba5474c). Implements full 14-assertion harness
via Approach B architecture, proven by prototype c647f61.

- Wave 0: clean broken Approach-A artifacts (sw-hooks.ts, SW dynamic
  import, popup-bridge lib, feasibility probes); update Tier-1 grep
  gate to 10-string Approach-B forbidden inventory.
- Wave 1: promote c647f61 prototype (extension-page-harness +
  a6.test.ts) to production paths; A6 stays GREEN.
- Wave 2: rebuild Approach-B driver utilities (launch.ts,
  assertions.ts, harness-page-driver.ts) replacing deleted
  popup-bridge primitives.
- Wave 3 (4 task bundles): wire A1-A13 functional assertions; canonical
  Bug B (A6) + Bug A (A8) RED-on-regression demos mandatory in commit
  bodies.
- Wave 4: append 01-09 Amendment 2; update STATE.md + ROADMAP.md;
  operator brand/design checkpoint.

Open questions resolved: Wave 3 granularity = 4 bundles; tabs
permission gap = workaround retained (Phase 5 hardening); failure
isolation = single browser + bail-on-first; CI plumbing = defer.

Frontmatter validation: valid=true. Plan structure: valid=true,
task_count=9, all tasks have files/action/verify/done.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 14:28:04 +02:00
ba5474c54f docs(01-11): close as spike-pivot — SUMMARY landed, AMENDMENT-A deleted, pivots to 01-13
Closes Plan 01-11 honestly per GSD spike-pivot pattern. Original
Approach A (Puppeteer sw.evaluate per RESEARCH §1+6) empirically
falsified across Wave 3 execution + feasibility research. Approach B
(extension-internal-page harness + offscreen synthetic stream) proven
via c647f61 prototype; full implementation moves to Plan 01-13.

What this commit does:
- ADDS 01-11-SUMMARY.md (spike-then-pivot framing per GSD artifact-
  types.md PLAN→SUMMARY lifecycle; captures retained infrastructure,
  falsified hypotheses, working prototype, bridge to 01-13)
- REVERTS frontmatter amendment block in 01-11-PLAN.md; replaces with
  closed_as/pivoted_in/closure_note pointing at SUMMARY + 01-13
- DELETES 01-11-PLAN-AMENDMENT-A.md (improvised artifact type — not
  recognized in GSD artifact-types.md; content folded into SUMMARY)

Lesson for orchestrator (captured in SUMMARY §Architectural Notes):
when a plan attempts an approach that proves infeasible, the right
move is honest SUMMARY + new plan, NOT in-place rewrite + AMENDMENT
artifact. The project's own pattern (01-08, 01-09, 01-10, 01-11
added mid-phase as new work surfaced) confirms add-new-plan-when-
scope-shifts is the established pattern.

Plan 01-09 closure via harness PASS NOT achieved by 01-11; still
requires operator UAT pending Plan 01-13 landing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 14:02:38 +02:00
565f8fa44c docs(01-11): amendment A — pivot to extension-internal harness page
Architectural pivot triggered by feasibility research prototype
(commit c647f61, A6 PASS 5/5 + Bug-B regression rewind verified).

Two empirical findings invalidate original architecture:
1. MV3 service workers BLOCK dynamic import. await import('test-hooks/
   sw-hooks') in src/background/index.ts silently kills the SW —
   chunk loads, await never resolves, no listeners register. Cited
   Chromium es_modules.md + w3c/webextensions#212.
2. Puppeteer WebWorker.evaluate against MV3 SW only exposes chrome.
   {loadTimes,csi} — not the extension chrome.* API surface.

The Wave 1 (cb1a729) SW-side hooks are fundamentally broken in test
builds (production unaffected — gated by __MOKOSH_UAT__ which is
false in prod). Executor must DELETE the SW-side dynamic import +
sw-hooks.ts entirely; offscreen-side hooks stay (offscreen IS a DOM
document; dynamic import works there).

Replacement (Verdict-A architecture, proven by prototype):
- Extension-internal harness page at chrome-extension://<id>/tests/
  uat/extension-page-harness.html — privileged extension context
  with FULL chrome.* API access
- Puppeteer drives the page via page.goto + page.evaluate
- For SW state: page calls chrome.runtime.sendMessage; SW responds
  via production messaging
- For getDisplayMedia: offscreen-side installFakeDisplayMedia() patches
  navigator.mediaDevices.getDisplayMedia → Canvas captureStream
  synthetic MediaStream

A6 (Bug B regression catch) PROVEN. Industry-standard pattern (MetaMask,
eyeo, Chrome MV3 official testing docs all converge).

Effort remaining: ~7-10h subagent budget (Wave 0 + bonus debug-import
commits keep; Wave 1 hooks rewire 30min; Wave 2 scaffolding 1-2h;
Wave 3 13 more assertions 4-6h; Wave 4 closure 1h).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 12:10:52 +02:00
0cd50fde94 docs(debug): import Bug B recovery-flow debug record from prior session
Untracked file present at session spawn (per orchestrator pre-flight
intelligence). The Bug B debug investigation that produced commit
b9eeeeb (the conditional-routing fix in src/background/index.ts
RECORDING_ERROR handler that Plan 01-11 assertion 6 verifies) was
recorded under .planning/debug/resolved/01-09-recovery-flow.md but
never committed. Importing it now so the debug provenance is
preserved alongside Plan 01-11's harness coverage of the bug class.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:46:09 +02:00
2669ce38e7 docs(intel): designer follow-up #1 — Newsreader has no Cyrillic glyphs
D-05 picked Newsreader as display serif. Engineering research
(01-12-RESEARCH.md §1, commit 3df2750) verified Newsreader ships NO
Cyrillic glyphs via designer's own Brief embedded subset list +
Production Type's repo README ("Google Fonts Latin Plus glyph set").

Russian display text (welcome hero, tagline) under current D-05 picks
silently falls through to Iowan Old Style → Times New Roman → serif.
Mokosh's audience is Russian-primary, so this is the default rendering
path, not a corner case.

Routing back to designer per D-05 OWNER (Design team) with 4 options:
- R1 fallback chain (Newsreader + Cyrillic-capable secondary)
- R2 substitute display family entirely
- R3 other (designer proposes)
- R4 accept the Iowan/Times fallback

Candidate Cyrillic-capable OFL serifs: PT Serif, EB Garamond, Lora,
Source Serif. PT Serif highlighted (ParaType, RU-foundry, pairs with
IBM Plex Sans).

Blocks Plan 01-12 planner spawn + Plan 01-10 welcome hero.
Plan 01-11 (harness) unaffected — non-overlapping surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:25:35 +02:00
3df2750c64 docs(01-12): research Plan 01-12 (Design Integration) — 13 areas + BLOCKER
13 research surfaces investigated per Plan 01-12 prompt. Key findings:

- BLOCKER §1: Newsreader has no Cyrillic glyphs (verified via Decision
  Brief's own embedded @font-face subsets + Production Type README).
  Russian display text in Newsreader will silently fall through to
  serif fallback. Recommend §1 R1: add Cyrillic-capable OFL serif (PT
  Serif / EB Garamond / Lora) to --mks-font-display stack.

- §3 + §4: Mark legibility at 16 px is VERIFIED OK. rsvg-convert
  produces 406 / 784 / 1952 B PNGs at 16/48/128 — all clear Chrome
  imageUtil floors. The 2x2 weave holds at 16 px.

- §10: 8 i18n strings extracted verbatim from Brief §02 (decoded via
  Python JSON-decode of the bundler-template script). Recommended
  __MSG_*__ key names + source-file mapping table included.

- §12: D-09 (smoke gating) is NEAR-NO-OP. smoke.sh is a standalone
  bash script; nothing in src/ references it; dist/ carries no smoke
  artifacts. Recommend documenting current state + adding optional
  no-smoke-in-dist regression test.

- §13: tokens.css line 12 Google Fonts @import migration → 8 local
  @font-face rules (Plex variable consolidation collapses the
  estimated 12-18 down to 8).

All tooling verified installed on dev machine: rsvg-convert 2.60.0,
pyftsubset 4.63.0, woff2_compress, inkscape 1.4.4. No npm install
needed for execute-plan; only one-off font source TTF downloads.

7 assumptions logged for planner to surface (A1 default_locale, A2
popup DOM rework, A4 Cyrillic serif fallback are highest-impact).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:23:27 +02:00
5efc2a89e3 docs(intel): ingest designer-team handoff v1 + record 9 brand decisions
Designer-team delivered two bundles (2026-05-17):
- Mokosh.zip: presentation artifacts (Decision Brief + Surface Kit standalone HTMLs)
- Mokosh Design System.zip: implementation handoff (tokens.css + mark/lockup SVGs + memo)

Designer respected every contract: codename Mokosh preserved, MV3 CSP
acknowledged (flagged dev-only Google Fonts @import in tokens.css line 12
for engineering to replace), Cyrillic-first typography (IBM Plex Sans),
WCAG AA validation noted, made recommendations not unilateral decisions.

9 decisions resolved per user ack:
- D-01..06, D-08, D-09: accepted designer defaults
- D-07 OVERRIDE: B · "Mokosh — Session Capture" (vs designer's A · just "Mokosh")
  — operator-facing manifest:name surfaces capture purpose

Brand decisions persisted to brand-decisions-v1.md;
brand-identity.md Open Questions section marked resolved with backlink.

Designer artifacts staged at .planning/intel/design-incoming/ for Plan 01-12
(Design Integration) consumption. Mokosh.zip presentation HTMLs (3.4 MB)
preserved as audit/onboarding reference; can be pruned later if repo size
warrants.

Plan 01-12 implementation handoff catalogued in brand-decisions-v1.md
§"Implementation handoff" — covers tokens.css ingestion, WOFF2 self-hosting,
SVG → PNG rasterization, manifest:name + description update,
welcome layout, VITE_DEV smoke gating.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 21:00:54 +02:00
66e6c4af74 docs(01-11): create Puppeteer UAT harness plan (14 assertions, 9 tasks)
Retires operator-as-assertion-library role from Plan 01-09 Task 5. Bug A
(notification icon API rejection) and Bug B (state-machine routing of
user-stopped-sharing) both escaped vitest unit coverage and cost ~4-6h of
operator UAT cycles in Phase 1. Plan 01-11 ships a Puppeteer-driven Node
harness with CDP attach to SW + offscreen contexts; the 14 assertions cover
the Plan 01-08/01-09 functional contract end-to-end.

Locked from research (RESEARCH §1-§11):
- Puppeteer 25.0.2 + tsx + node:assert/strict (no vitest browser mode)
- Two-bundle separation via vite.test.config.ts (mode 'test' + dist-test/)
- Hook gating: import.meta.env.MODE === 'test' + dynamic import (Vite
  tree-shakes from production)
- Bug B trigger: track.dispatchEvent(new Event('ended')) — NOT track.stop()
  (W3C spec + empirical probe7 — track.stop does NOT fire 'ended')
- Tier-1 grep gate (tests/background/no-test-hooks-in-prod-bundle.test.ts)
  enforces zero __mokoshTest in production dist/
- Single browser, serial assertions, bail-on-first-failure (open question 4)

Wave structure (4 waves):
- Wave 0 (Task 1): puppeteer+tsx install, vite.test.config, build:test +
  test:uat scripts, Tier-1 grep gate committed GREEN.
- Wave 1 (Task 2): gated SW + offscreen hooks at src/test-hooks/; production
  bundle remains hook-free.
- Wave 2 (Task 3): harness scaffolding — tests/uat/lib/* + harness.test.ts
  with assertion 0 wired GREEN + assertions 1-13 stubbed RED.
- Wave 3 (Tasks 4-7): wire 13 assertions in 4 logically-grouped bundles
  (1-4 toolbar/displaySurface; 5-7 SAVE+BugB+ERROR; 8-10 BugA+icons+manifest;
  11-13 buffer continuity + ffprobe + zip).
- Wave 4 (Tasks 8-9): amend Plan 01-09 Task 5 to redirect functional steps
  to npm run test:uat; operator confirms brand/design.

Bug A + Bug B each have RED-on-regression canonical demos required in the
respective task's commit body — proves the harness CAN catch the regression,
not just passes under current conditions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 18:15:44 +02:00
969afbac89 docs(01-11): research Puppeteer UAT harness — empirical probes verify 10/10 unknowns
Probes 1-11 against local Chrome 148.0.7778.167 + Puppeteer 25.0.2:
- triggerExtensionAction works; popup-vs-onClicked contract confirmed
- --headless=new supports MV3 + getDisplayMedia (Xvfb not required)
- offscreen page reachable via background_page target type + .asPage()
- BLOCKER: track.stop() does NOT fire 'ended' per W3C spec — Bug B harness
  must use track.dispatchEvent(new Event('ended')) instead

13-assertion implementation table + 7 pitfalls + 2-bundle build design.
Wave 0 grep gate enforces tree-shake of __mokoshTest from production.
2026-05-17 17:42:40 +02:00
9d0313acd2 docs(01-09): amend Task 5 step 11 + success criteria #3 post-Bug B
Original step 11 expected stop-sharing → ERROR badge + recovery
notification; under Bug B fix (b9eeeeb), user-stopped-sharing is
correctly routed → IDLE (badge OFF, no recovery notification) because
it's a deliberate lifecycle event, not an error.

Amendments:
- Step 11: badge OFF (not ERROR); no recovery notification; popup cleared
- Step 12: operator clicks toolbar directly (no notification to click)
- Step 14: failure-mode list updated to match new expectations
- Step 15 added: ERROR state coverage moved to separate genuine-error step
- Success criteria #3: split user-stopped-sharing (→ OFF) from genuine
  errors (→ ERROR + recovery notification, preserved fallback)

See .planning/debug/resolved/01-09-recovery-flow.md for the debug record.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:56:07 +02:00
6dca46529b chore(01-09): resume from pause — sync STATE.md, remove HANDOFF.json
HANDOFF.json artifact consumed per /gsd-resume-work workflow
(one-shot resumption pointer). STATE.md synced forward to reflect
true mid-Plan-01-09 state — status flipped planning→executing,
progress 90→92, Current Position now shows Phase 1 REOPENED with
Plan 01-09 Bug B pending and Plan 01-10 Wave 3 pending.

Session continuity records:
- Pause checkpoint commit:  ed82fd6
- Bug A icons commit:       a881bf0
- Intel docs unlock commit: f768498
- Next: /gsd-debug session for Bug B state-machine routing

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:30:54 +02:00
f768498b87 docs(intel): unlock creative decisions across brand + design + assets specs
Adds brand-identity.md (Brief #1: name + blurb + creative slate).
Rewrites design-system.md and assets-spec.md to flip aesthetic
prescriptions into options while keeping Chrome MV3 / WCAG /
icon-size floors as binding (marked (FLOOR) inline). Mokosh codename
is the only locked decision; every other creative choice delegated
to brand + design teams with explicit ownership annotations.

Three-file intel pack now consistent:
- brand-identity.md: brand-team primary (naming, voice, blurb)
- design-system.md: design-team primary (palette, type, components)
- assets-spec.md: design-team primary (deliverables + floors)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:29:57 +02:00
ed82fd6051 wip: phase-01 paused mid-Plan-01-09; Bug B fix + icon placeholder commit pending 2026-05-17 16:05:17 +02:00
949aa03db5 docs(intel): design system + assets spec for designer-team handoff
Two new cross-phase intel docs surfacing the visual + interaction
language and the concrete asset deliverables list.

Triggered by Plan 01-09's notification-icon failure: the original
placeholder PNGs (icons/icon{16,48,128}.png at 79/123/306 bytes)
are too small for chrome.notifications.create's imageUtil validation.
Plan 01-09 closeout blocks on valid replacement icons.

design-system.md captures:
- Brand voice (quietly competent operator-tool; not playful)
- Identity (Mokosh codename + "AI Call Recorder" display name)
- Color tokens (semantic state + UI surfaces; WCAG AA validated)
- Typography (system fonts only; type scale)
- Iconography (solid filled, 24px grid, neutral mark + state via badge)
- Spacing (4px base scale)
- Motion (conservative; reduced-motion-aware)
- Component conventions (toolbar action, notification, popup, welcome)
- Accessibility & i18n (Russian-first, contrast floors)
- Open design decisions (mark concept, pulsing badge, tagline)

assets-spec.md captures:
- Priority 0 (blocks Plan 01-09): icons 16/48/128 with min file sizes
  + dimension/format requirements + validation commands
- Priority 1 (Plan 01-10): welcome page hero, optional 192px icon
- Priority 2 (future phases): per-state icon variants, popup polish,
  runbook visuals
- Three implementation paths: auto-generated placeholders (interim),
  design-first (commission), hire/commission

User will delegate execution to designer team; specs are handoff-ready
with binding technical floor + designer-judgment aesthetic direction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 16:02:56 +02:00
c711d7e74e docs(01-09): SUMMARY — Tasks 1-4 autonomous complete; Task 5 awaiting operator
Plan 01-09 SUMMARY:
  • 17 new tests landed GREEN (4 displaySurface + 5 toolbar-action
    including W-02 popup-idle-race + 4 badge + 4 notification).
  • Baseline 64 + 17 new = 81 GREEN. Full suite 18 files / 81 tests.
  • Tier-1 SW-bundle-import gate (Layer 1 + 2) remains GREEN.
  • tsc clean; npm run build clean; dist/manifest.json carries
    notifications permission.
  • 4 deviation rules auto-fixed inline (navigator getter helper,
    jsdom-free W-02 Test E refactor, cursor type-widening cast,
    chrome.* listener try/catch for pre-existing test compatibility).
  • Task 5 (operator empirical checkpoint) deferred per plan.
2026-05-17 15:49:24 +02:00
073e7b3584 docs(debug-01-08): update Resolution — B+ polyfill closed Layer 2 gap
The 01-08 fix took TWO iterations, not one. Iteration 1
(commits 52c7636 + 74400ae, archived in cc6e81a) resolved
the SW INIT crash via resolve.alias for ebml + chrome.* mock
for the Tier-1 Layer 1 gate. That landing masked a SECOND
defect — ts-ebml's EBMLDecoder constructor crashes with
`ReferenceError: Buffer is not defined` because MV3 SW has
no Buffer global. The runtime path is unreachable at module
init (EBMLDecoder is only constructed when remuxSegments
runs, which only fires from the SAVE_ARCHIVE handler), so
Layer 1 of the gate could not catch it.

Iteration 2 (commits dd7bf00 + 761dfc0) closed that gap by
extending the Tier-1 gate to Layer 2 (source-imports
webm-remux.ts, invokes remuxSegments — caught the Buffer
bug empirically) and applying B+ — vite-plugin-node-polyfills
with narrow Buffer-only config — to provide Buffer at SW
runtime via bundler-level import rewrite.

Updates to the debug archive:
- frontmatter `updated:` bumped to 12:25Z
- two new Evidence entries (12:15Z Layer 2 RED, 12:20Z B+
  GREEN) document the iteration-2 empirical path
- one new Eliminated entry: "C-config alone is sufficient" —
  FALSIFIED by Layer 2 (the resolve.alias fix from iteration
  1 is necessary but not sufficient; ts-ebml's runtime Buffer
  use is an orthogonal concern that requires the polyfill)
- Resolution.root_cause rewritten to describe BOTH defects
  (bundler-config + runtime-Buffer) and explain why they
  surfaced sequentially
- Resolution.fix rewritten with iteration-1 / iteration-2
  structure, citing all 4 commits across both iterations
- Resolution.verification rewritten with explicit Layer 1
  vs Layer 2 verification claims and the full vitest count
  (62 passing, 2 failing — pre-existing fixture-dependent
  webm-playback duration tests, unchanged)
- Resolution.files_changed lists all 4 commits across both
  iterations + this archive update

The session was correctly resolved-and-archived after
iteration 1 with the information then available; iteration
2 is an additive correction once the extended gate surfaced
the second defect. Per the project's
feedback-pre-checkpoint-bundle-gates memory, the extended
Tier-1 gate is now the canonical bundle-loadability check
any future plan executor with SW surfaces must run before
operator-empirical checkpoints.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 12:20:42 +02:00
cc6e81a825 docs(debug-01-08): archive — fix landed, gate completed
Resolves Vite/Rollup CJS-interop tree-shake bug that killed SW init.
Two-part fix:
- vite.config.ts resolve.alias for ebml -> CJS main entry (52c7636)
- tests/background/sw-bundle-import.test.ts chrome.* Proxy mock (74400ae)

Full vitest: 61 passing, 2 RED (pre-existing fixture-dependent
webm-playback tests; Plan 01-08 Task 5's empirical responsibility).
Tier-1 SW-bundle-loadability gate now GREEN.

Status: investigating -> resolved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 11:31:25 +02:00
c75854cbef test(debug-01-08): RED Tier-1 SW-bundle-loadability gate + corrected hypothesis
Adds tests/background/sw-bundle-import.test.ts that loads the built SW
chunk under SW-simulated globals (Buffer/process/window/document stripped)
via a spawned Node child process. Pins the orchestrator-side gap that
caused Plan 01-08's SW init crash: the prior deps test only checked
SOURCE packages under default Node globals, never the bundled output, so
Vite/Rollup's CJS-interop bug (tree-shaking the `ebml` package while
leaving a dangling `{tools:f}=Pc` destructure against an empty Pc) went
undetected until operator empirical smoke.

RED against HEAD aabbd0c — failure surfaces the exact production error
("Cannot read properties of undefined (reading 'readVint')"), proving
the test is a true regression gate, not a tautology.

Also rewrites .planning/debug/01-08-sw-incompatibility.md to reflect the
actual root cause (Vite/Rollup CJS interop) rather than the orchestrator's
initial falsified hypothesis (new Function + Buffer globals — disproven
by Node simulation showing the throw fires at module-init line 12:33809
before any CSP-eval or Buffer-ref code path executes).

Full vitest: 60 passing + 3 RED (this gate + the 2 pre-existing Task 5
fixture-dependent duration tests). No regressions.

Per feedback-pre-checkpoint-bundle-gates.md (auto-loaded memory): any
future plan executor whose work surfaces a SW must run this test before
any operator-empirical checkpoint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 09:52:45 +02:00
aabbd0c05c docs(01-08): write SUMMARY — Tasks 1-4 autonomous complete; Task 5 awaiting operator
- D-14-remux WebM remux pipeline (ts-ebml parse + webm-muxer write)
  replaces D-13 file-concat; single-EBML-headered output empirically
  spans 29.954 s of 912 VP9 frames (matching the per-segment sum
  301+300+311 with zero loss).
- All 5 RED unit tests in tests/background/webm-remux.test.ts flipped
  GREEN; 2 SW-compat tests in webm-remux-deps.test.ts GREEN; 53 baseline
  tests preserved. tsc exit 0. npm run build exit 0.
- mergeVideoSegments deleted from src/background/index.ts; only a
  retirement comment naming Plan 01-08 D-14-remux remains.
  EmptyVideoBufferError surface preserved (W-01 free-text rename only).
- CONTEXT.md amendment provenance verified intact (B-01 grep checks all
  pass — no file mutation by this plan; the orchestrator landed the
  amendment at plan-creation time in commit 2e499d7).
- 2 deviations documented (Rule 1: tsc-required codec field in
  EncodedVideoChunkMetadata; Rule 3: stale comment cleanup in
  decodeBufferSegments). No scope creep.
- Self-check: all 6 files + 4 task commits verified present.
- Task 5 = checkpoint:human-verify (operator regenerates
  tests/fixtures/last_30sec.webm via ./smoke.sh, confirms Chrome + mpv
  playback ~30 s, flips the 2 webm-playback duration tests GREEN).
2026-05-17 09:29:26 +02:00
2e499d7387 docs(01): add Plans 01-08 / 01-09 / 01-10 (amended Phase 1 charter)
Plans cover the post-D-13 architecture and the auto-start UX charter
expansion that landed during 2026-05-16 UAT:

- Plan 01-08 — WebM remux via ts-ebml@3.0.2 + webm-muxer@5.1.4. Replaces
  the broken file-concat in mergeVideoSegments with a real single-EBML
  remux. Drives the 2 RED tests in tests/offscreen/webm-playback.test.ts
  to GREEN. Regenerates the canonical fixture against the remuxer.
  5 tasks (4 TDD + 1 operator empirical checkpoint), wave 1.

- Plan 01-09 — Whole-desktop constraint (displaySurface:'monitor',
  cursor:'always') + post-grant validation, chrome.action.onClicked
  direct toolbar invocation, chrome.action badge state machine
  (REC/OFF/ERROR), chrome.runtime.onStartup notification + recovery
  notification on onUserStoppedSharing, popup scoped to SAVE-only.
  17 new test assertions across 4 test files. smoke.sh updated to
  auto-select an entire screen. 5 tasks (4 TDD + 1 operator empirical
  checkpoint), wave 2 (depends on 01-08).

- Plan 01-10 — chrome.runtime.onInstalled welcome tab on first install
  via chrome.storage.local guard; vanilla welcome.html/ts/css bundle
  with single "Начать запись" button consuming install-time activation.
  Uses centralized Logger pattern. 4 tasks (3 TDD + 1 operator empirical
  checkpoint), wave 3 (depends on 01-09).

CONTEXT.md amendment block appended with 4 disambiguated decisions:
- D-14-remux: WebM remux supersedes D-13 file-concat
- D-15-display-surface: whole-desktop + cursor visibility lifted from
  Phase 5 deferral
- D-16-toolbar: toolbar onClicked + popup SAVE-only + badge state
  machine + onStartup/recovery notifications
- D-17-onboarding: welcome tab on first install (distinct from
  D-17-port-lifecycle from Option C)
The earlier D-17 port-lifecycle heading also renamed to hyphenated
form for cross-ref consistency.

Plan-check loop: 3 iterations (initial + 2 revisions). Iteration 1
surfaced 11 findings (2 BLOCKER + 6 WARNING + 3 INFO); all addressed
via revision iter 1 with checker-recommended fixes. Iteration 2
surfaced 3 derivative regressions (literal-string grep anchors from
the iter-1 fixes did not match live CONTEXT.md); all addressed in iter
2 with empirically-validated literals. Iteration 3 PASSED clean.

Validation: gsd-sdk frontmatter.validate + verify.plan-structure both
return valid=True for all 3 plans. Plan 01-08 Task 4 verify-chain
grep tested end-to-end against live CONTEXT.md (exit 0).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 09:19:22 +02:00
bc310d98cf revert(01): reopen Phase 1 — D-13 multi-EBML-concat is unplayable
REQ-video-ring-buffer flipped from [x] back to [ ]. ROADMAP.md Phase 1
row reverted from [x] Closed 2026-05-15 to [ ] reopened 2026-05-16.
STATE.md status flipped phase_complete → phase_reopened with full
historical narrative preserved.

Root cause (confirmed at byte level by gsd-debugger 2026-05-16):
D-13's concat-of-self-contained-WebM-segments architecture produces a
3-EBML-header WebM that standards-compliant Matroska parsers
(mpv, ffmpeg, Chrome HTMLMediaElement) play only as the first segment
(~9.94 s) and silently drop the remaining 2 segments. Confirmed via
operator mpv drag-drop test of BOTH the canonical 2026-05-15 closure
fixture and the 2026-05-16 UAT-produced fixture — both exhibit the
same broken playback.

The 2026-05-15 "operator-confirmed clean Chrome playback" assessment
was insufficient: it verified the file plays without freezing but did
not measure total duration. Phase 1's primary deliverable
(REQ-video-ring-buffer / SPEC §10 #7) is therefore NOT satisfied.

Fix path chosen by user: ts-ebml (parse) + webm-muxer (write) to
replace mergeVideoSegments file-concat with real single-EBML remux.
Will land as Plan 01-08 via fresh /gsd-plan-phase ceremony.

RED test landed in tests/offscreen/webm-playback.test.ts (2 new
assertions on container-format-duration + ffmpeg-full-decode-duration).
2 failures, 53 baseline tests still GREEN.

Option C port-lifecycle refactor (debug session
empty-archive-port-race, commits 674c415..f0871c0) DID land cleanly
and is retained — that fix was orthogonal and correctly resolved the
silent-empty-archive symptom that previously masked this deeper bug.

Debug session: .planning/debug/d13-multi-ebml-concat-unplayable.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 19:47:47 +02:00
f1026954fc test(01): UAT BLOCKER #2 — D-13 multi-EBML-concat plays only ~9 s; both committed fixture and UAT output exhibit same broken playback. Phase 1 architecture finding. 2026-05-16 18:57:48 +02:00
f0871c0237 docs(option-c): archive empty-archive-port-race + amend CONTEXT.md D-17 port lifecycle
Two doc updates closing the debug session per the resolved pattern this
phase has established (cf. resolved/d12-blob-port-transfer-fails.md and
resolved/webm-playback-freeze.md):

1. **Move debug session to resolved/** with the Resolution section
   filled in (root_cause, fix, verification, files_changed). Status
   flipped tdd_red_confirmed -> resolved. Original investigation
   notes + bisect results + Option C strategy spec all preserved
   in-place — the file is the full provenance trail.

2. **Amend 01-CONTEXT.md D-17** with the new port lifecycle commitments.
   Append-only (D-17 itself untouched) per the doc cascade rule
   established earlier this phase ("amendments append, do not replace,
   to preserve SPEC provenance"). The amendment narrates:
   - What was Claude's-discretion at Phase 1 plan time has been
     specified by Option C.
   - The 290 s pre-emptive setTimeout reconnect (Pitfall 4) is RETIRED.
   - The architectural commitments added: PING/PONG health probe,
     request-id'd REQUEST_BUFFER/BUFFER, SW retry on port replacement,
     outer 10 s hard-timeout, operator-visible EmptyVideoBufferError
     surface.
   - The 4 pinning contracts added (port-health-probe,
     request-id-protocol, port-lifecycle-continuous, plus the
     refactored port-reconnect-race).

Suite remains 11 files / 53 tests, all GREEN. Quality gates intact.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 15:40:02 +02:00
674c415945 test(debug-empty-archive): RED gate for empty-archive-port-race (H1 + H1.b + H2)
Phase 1 UAT Test 3 surfaced a two-headed BLOCKER:
(a) silent empty-video archive when save crosses a port-reconnect window,
(b) 3x "Attempting to use a disconnected port object" Uncaught Errors
starting at the 290 s pre-emptive reconnect mark.

Bisect confirmed: H1 (port lifecycle race) was introduced by Plan 01-04
(b064a21); H2 (createArchive silent-skip on empty segments) is an upstream
defect (555eb05) that became fatal once CR-01 + sweep #5 guaranteed the
silent-skip branch would fire on every save during a reconnect window.

This commit lands the 3 RED tests at the unit-test level — they match the
UAT error string byte-for-byte for H1/H1.b and pin the silent-drop
contract for H2. They will flip GREEN as the Option C architectural
refactor (request-id'd port protocol + port-health probe + retry +
operator-visible error surface) lands across the next commits.

Baseline: 8 files / 43 tests (40 GREEN, 3 RED). tsc --noEmit exit 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 14:17:45 +02:00
13094d4248 test(01): UAT partial — 2 pass, 1 BLOCKER (silent empty-video archive + port-reconnect race), 1 blocked 2026-05-16 13:57:24 +02:00
0cf964cb93 docs(01): goal-backward verification (10/10 PASS, 2 advisory, human_needed for operator residue) 2026-05-16 11:12:52 +02:00
75b88c6219 chore(session): consume HANDOFF.json + refresh STATE session continuity after resume
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-16 11:07:42 +02:00
92810a0f34 docs(01): add code review fix report (16/18 + 8 sweep, status: all_fixed) 2026-05-16 11:06:48 +02:00
7bc2ef8c38 wip: phase-01 paused at review-fix 5/18; 13 findings + 8 sweep targets remain .planning/phases/01-stabilize-video-pipeline/.continue-here.md .planning/HANDOFF.json 2026-05-16 09:30:16 +02:00
bf00bf65aa docs(01): add code review report (3 critical, 9 warning, 6 info) .planning/phases/01-stabilize-video-pipeline/01-REVIEW.md 2026-05-15 22:35:00 +02:00
1d06d9d70b docs(01-07): write Plan 07 SUMMARY and close phase 1 artifacts
Plan 07 SUMMARY — manual smoke + ffprobe D-12 gate + A3 empirical-playback
gate, three-attempt closure narrative with two pre-staged fallback
activations (base64 wire-format from CONTEXT.md Doc Cascade; D-13
restart-segments from CONTEXT.md), and the process-retro candidate flag.

Structure:

- Frontmatter: dependency graph (requires Plans 01..06; provides D-12/A3
  gates + fixture + REQ closure + D-09..D-11/CON-webm-header-retention
  retirement); patterns established (pre-staged contingency activation;
  three-attempt acceptance); requirements-completed [REQ-video-ring-buffer]
- Accomplishments: D-12 + A3 gates green; 30/30 tests; tsc clean; REQ
  marked Complete; cursor-visibility deferred to Phase 5
- Task Commits: this closure cycle (cd61cbc fixture + 7df72aa REQ/STATE/
  ROADMAP flip + this SUMMARY), plus the prior D-12 fix cycle (5 commits
  c0d9166..bf07619) and A3 fix cycle (6 commits 5530292..872f25d)
- Deviations from ORIGINAL Plan 07: two architectural escalations, both
  resolved by pre-staged fallbacks without re-planning; the closure
  ceremony itself split into 3 atomic commits (spec'd as 1) for
  reviewability
- Issues Encountered: three-attempt journey documented (attempt 1 75-byte
  text → D-12 fix; attempt 2 ffprobe-valid freezes → A3 fix; attempt 3
  clean)
- Process Observation: candidate retro for /gsd-plan-phase to auto-inject
  empirical-acceptance gates BEFORE merging a phase when RESEARCH.md flags
  HIGH-risk assumptions
- Next Phase Readiness: Phase 2 constraints (no competing keepalives;
  T-1-04 sender-check respected) + workflow next steps (code-review +
  verifier per user settings)
- Self-Check: PASSED — all closure artifacts present and verified

Phase 1 is complete; next workflow steps are /gsd-code-review +
/gsd-verify-work, then /gsd-plan-phase 2.
2026-05-15 22:02:11 +02:00
7df72aaa60 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
2026-05-15 21:58:38 +02:00
872f25d649 docs(fix-a3): resolve webm-playback-freeze debug session, update STATE
Closes the second debug session in Phase 1's life (after d12). Both
sessions resolved fast — ~30 min for d12, ~15 min for the RED-test
landing in this one — because the planner had explicitly pre-staged
contingencies (D-12 ffprobe gate + D-13 restart-segments skeleton)
for the assumptions RESEARCH.md flagged HIGH-risk. Neither was a
planning oversight; both were the documented HIGH-risk assumption
activating as expected.

Changes:
- Moved .planning/debug/webm-playback-freeze.md →
  .planning/debug/resolved/webm-playback-freeze.md (status:
  root-cause-confirmed → resolved).
- Added the Resolution section: root-cause one-liner, applied-fix
  description, the 5 files-changed list, the 6 fix-a3 commit hashes,
  the in-tree verification matrix, and the explicit operator
  next-step (re-run ./smoke.sh, verify Chrome playback +
  ffmpeg-clean stderr + the 2 webm-playback.test.ts assertions
  flipping GREEN, then Phase 1 closes).
- Updated STATE.md frontmatter `stopped_at`, the Decisions log
  with a [Phase 01-07-debug-a3] entry summarising D-13 activation
  + the type renames + the retired old-API surface, and the
  Session Continuity block (timestamp, stopped_at narrative,
  resume-file pointer).

Phase 1 close is still pending operator regen of
tests/fixtures/last_30sec.webm. REQ-video-ring-buffer must not
be marked complete by this commit — Plan 07's §10 #7 acceptance
criterion owns that and only the in-Chrome playback + ffmpeg-clean
stderr (against a freshly regenerated fixture) can close it.
2026-05-15 21:18:36 +02:00
bf076199b4 docs(fix-d12): resolve debug session and update STATE
- Mark .planning/debug/d12-blob-port-transfer-fails.md as
  status: resolved; fill in the Resolution section with the
  applied fix (5 commit hashes, files changed), verification
  output (15/15 tests, tsc clean, vite build green, zero
  as-any/ts-ignore in fix-touched files), and inline answers
  to the specialist-review questions raised by the planner.
  Move the file to .planning/debug/resolved/.
- Update STATE.md frontmatter (stopped_at) + Decisions log
  + Session Continuity to record the D-12 fix landing and
  the open Plan 07 ffprobe gate (still requires operator
  smoke.sh + ffprobe re-run before Phase 1 can close).
- Land smoke.sh — the operator's D-12 acceptance-gate harness
  that surfaced the original failure. Self-contained: dedicated
  /tmp/mokosh-smoke-profile, auto-accept desktop-capture picker,
  Downloads polling, ffprobe gate, fixture staging.

REQ-video-ring-buffer remains NOT-complete — Plan 07 owns it,
operator must re-run ./smoke.sh to verify the fix end-to-end
in Chrome.

Refs: debug session d12-blob-port-transfer-fails (resolved).
2026-05-15 20:23:29 +02:00
1ebfb42b30 docs(01-06): complete vite.config.ts collapse plan
- 01-06-SUMMARY.md: detailed write-up — 226 → 21 lines, Outcome A
  reconciliation (dist/src/offscreen/index.html), full dist layout
  for Plan 07's smoke test, T-1-NEW-06-01 / T-1-NEW-06-02 grep gates
- STATE.md: completed_plans 5 → 6, percent 71 → 86, current plan
  advanced 6 → 7, two new decisions logged, session stopped_at updated
- ROADMAP.md: Phase 1 plan progress row 4/7 → 6/7; 01-06-PLAN.md
  checked off

REQ-video-ring-buffer remains unchecked — Plan 07 owns the ffprobe gate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 18:17:43 +02:00
9e236cbc7b docs(01-05): complete SW shrink + port host plan
Plan 05 closes: src/background/index.ts is now a pure coordinator with
zero video-buffer state, T-1-04 mitigations on both onConnect and
onMessage, OFFSCREEN_READY handshake, port-based buffer fetch via
'video-keepalive' port, IDB orphan cleanup on install, and chrome.offscreen.hasDocument()
re-sync on SW respawn (audit P1 #8). 9/9 vitest tests still green;
tsc clean; no as any / @ts-ignore.

REQ-video-ring-buffer stays pending — Plan 07's ffprobe gate owns the
final completion marker.
2026-05-15 18:07:07 +02:00
05d00509bf docs(01-04): complete offscreen port keepalive + OFFSCREEN_READY handshake plan
- Add 01-04-SUMMARY.md with TDD RED/GREEN/REFACTOR gate records,
  acceptance grep gates, threat mitigations (T-1-04, T-1-NEW-04-01),
  Plan 05 SW-side handoff (REQUIRED sender.id === chrome.runtime.id
  check), and 1 Rule 1 deviation documented
- Advance STATE.md Plan counter 4 → 5, progress 43% → 57%
- Append 3 decisions to STATE.md Accumulated Context
- Update ROADMAP.md: 01-04-PLAN checkbox → [x], phase progress row 3/7 → 4/7

REQ-video-ring-buffer NOT marked complete — still pending Plan 07
ffprobe D-12 gate per the requirement's traceability.
2026-05-15 17:54:04 +02:00
30e5efd364 docs(01-03): complete offscreen recorder TDD plan
- Add 01-03-SUMMARY.md documenting RED -> GREEN gate (Plan 02 tests now
  pass), 3 Rule-3 auto-fixes (OffscreenLogger inline, defensive
  bootstrap, SW dead-code removal), and Plan 04 / 05 handoff notes.
- Update STATE.md: advance plan counter to 4 of 7 (43%), append
  metrics + 3 execution decisions, record session.
- Update ROADMAP.md: mark Plan 01-03 [x] complete.

REQ-video-ring-buffer remains NOT complete — still pending Plans 04
(port keepalive) and 07 (ffprobe acceptance gate).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 17:42:21 +02:00
edc605d475 docs(01-02): complete wave-0 test infrastructure plan
- 01-02-SUMMARY.md created (Vitest 4.1.6 installed; 4 RED test files
  pinning Plans 03+04 contracts; tests/fixtures/.gitkeep marker)
- STATE.md advanced: plan 2/7 -> 3/7; progress 14% -> 29%; metric row
  added; 3 decisions logged; session continuity updated
- ROADMAP.md progress row updated: Phase 1 = 2/7 In Progress
- REQUIREMENTS.md: REVERTED premature [x] + "Complete" marking of
  REQ-video-ring-buffer (Plan 01-01 mistakenly marked it; the requirement
  is satisfied by Plans 03+04+07's implementation + ffprobe gate, not by
  RED test scaffolding). Now reads "[ ]" + "In Progress" — honest state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 17:28:49 +02:00
13b67f5136 docs(01-01): complete doc-cascade plan
Plan 01-01 (Wave-0 doc cascade) complete. Six tasks landed atomically
in commits 125c032, fb88830, b1ed2cb, 597d967, 32bc996, 4a5194e. Every
code-touching plan in Phase 1 (01-02..01-07) now reads a consistent
baseline: getDisplayMedia replaces tabCapture in DEC-003; long-lived
port replaces alarms in DEC-010; manifest.json carries the final
Phase-1 permissions set (desktopCapture, activeTab, downloads,
scripting, storage, offscreen).

SUMMARY: .planning/phases/01-stabilize-video-pipeline/01-01-SUMMARY.md
2026-05-15 17:19:48 +02:00
32bc99642e docs(01-01): amend Phase 1 description + Success Criterion #2 per D-A5
Rewrite the Phase 1 one-liner in the Phases list to call out the
chrome.tabCapture -> getDisplayMedia swap, and rewrite Success
Criterion #2 to describe the new operator-selected screen/window
capture and the absence of tab-reattach logic. Phases 2-5 sections are
untouched. The verbatim phrase 'no tab re-attach logic' is preserved
as written in the plan to document the amendment in-place; the
original 'recorder re-attaches to the new active tab' wording is gone.
2026-05-15 17:16:07 +02:00
597d967ccf docs(01-01): amend REQ-video-ring-buffer per D-A4
Replace the REQ-video-ring-buffer bullet to bind the new
getDisplayMedia + offscreen-document acquisition path and drop the
'active-tab' wording (the new API is screen/window-scoped, not
tab-scoped, so there is nothing to re-attach on tab switch). Encoding,
buffer window, and SPEC §10 acceptance citations are unchanged. Adds
CON-display-capture-binding alongside the existing constraint bindings.
2026-05-15 17:15:24 +02:00
b1ed2cbf49 docs(01-01): amend PROJECT.md DEC-003/DEC-010 + Constraints per D-A3
Rewrite DEC-003 and DEC-010 rows in the Key Decisions table to reflect
the Phase 01 amendments (getDisplayMedia + long-lived port keepalive),
each citing the .planning/intel/decisions.md amendment block as the
canonical source. Swap the two Constraints bullets that cited
chrome.alarms keepalive and tabCapture binding for replacement
bullets bound to CON-display-capture-binding.
2026-05-15 17:14:59 +02:00