b6b3f377b8710426d1f0f268d76792f5ef8f727f
212 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
| b6b3f377b8 | chore: merge partial executor worktree (worktree-agent-aac9035b8c3b890ac) — Wave 3 Plan 02-04 A24+A25 (529 mid-plan) | |||
| 47e9818cb1 |
feat(02-04): harness A25 — empirical <5s SAVE→zip latency (REQ-archive-export-latency, SPEC §10 #6)
Wire A25 into the UAT harness as the binding empirical gate for REQ-archive-export-latency / SPEC §10 #6 (5000ms hard ceiling end-to-end from SAVE_ARCHIVE dispatch to zip-on-disk). Architecture: - Page-side assertA25 records t0 (performance.now) + t0Wall (Date.now) + tAck bookends around the chrome.runtime.sendMessage(SAVE_ARCHIVE) call. Returns A25Result extending AssertionRecord with the 3 timing fields + ackSuccess flag. - Host-side driveA25(page, downloadsDir) snapshots zip dir BEFORE page.evaluate dispatch, polls for new-or-overwritten .zip via mtime delta (mirrors A12/A13 overwrite-aware pattern), uses page-supplied t0Wall as the host anchor for the dispatch→file-on-disk latency check (NOT a host-side Date.now captured before page.evaluate, which would include setupFreshRecording + 11s segment-settle wall time and always fail the 5s budget). [Rule 1 - Bug] Initial implementation used host-side Date.now() captured before page.evaluate as the latency anchor — this incorrectly included the 11s segment-settle window in the budget. First run observed A25.3=11188ms (FAIL). Fix: page-side captures Date.now() at the SAVE_ARCHIVE dispatch instant (AFTER setupFreshRecording + segment-settle complete) and returns it as t0Wall in A25Result; the driver uses this as the canonical host anchor. Result on re-run: A25.3=61ms (GREEN, well under 5s SLO). Documented per T-02-04-02 disposition (bracket only the SAVE dispatch, not the broader test orchestration). Files modified: - tests/uat/extension-page-harness.ts (+~115 lines): assertA25 + A25_* constants + A25Result interface - tests/uat/lib/harness-page-driver.ts (+~95 lines): driveA25 + A25_HOST_POLL_TIMEOUT_MS const + A25_LATENCY_CEILING_MS const - tests/uat/harness.test.ts (+~15 lines): import driveA25, wrap with downloadsDir, append to drivers list Verification: - HEADLESS=1 npm run test:uat → 26/26 GREEN - elapsedAck=60ms, host-side delta=61ms (both well under 5000ms SLO) - npx vitest run tests/background/no-test-hooks-in-prod-bundle.test.ts → 13/13 GREEN (Tier-1 FORBIDDEN_HOOK_STRINGS unchanged at 12) - npx tsc --noEmit → clean Plan 02-04 scope: 2/3 tasks landed (A24 + A25); Task 3 adds A26 (meta.json 8-field) + A27 (multi-tab strict) + A28 (archive-layout strict). |
|||
| 4ae73250fa |
feat(02-04): harness A24 — empirical Blob URL download verification (D-P2-01 closes P0-6)
Wire A24 into the Plan 01-13 Approach B UAT harness as the binding empirical gate for D-P2-01. A24 verifies end-to-end that SAVE_ARCHIVE → chrome.downloads. download receives a `blob:` URL prefix (NOT `data:application/zip;base64,`), closing audit P0-6 functionally. The Plan 02-02 unit tests pin the wire-format at the SW↔offscreen boundary; A24 pins it at the chrome.downloads platform boundary through a real Chrome instance. Strategy: chrome.downloads.onCreated listener captures the URL cross-realm. The plan's <action> block proposed a chrome.downloads.download monkey-patch installed in the harness page realm — but that intercepts only same-realm calls, missing the SW's call. The canonical cross-realm capture pattern is chrome.downloads.onCreated (fires for any download initiated by any extension realm, with the full DownloadItem including .url). Documented as a deviation from the plan's pseudo-code in SUMMARY.md (Rule 1 — bug fix vs the pseudo-code strategy; same A24 contract verified, correct mechanism). Files modified: - tests/uat/extension-page-harness.ts (+~150 lines): assertA24 + A24_* constants - tests/uat/lib/harness-page-driver.ts (+~30 lines): driveA24 page.evaluate wrapper - tests/uat/harness.test.ts (+~10 lines): import driveA24, append to drivers list Verification: - HEADLESS=1 npm run test:uat → 25/25 GREEN (24 baseline + A24) - capturedUrl observed: blob:chrome-extension://lpgnfoop.../... - npx vitest run → 171/171 GREEN (no regression) - Tier-1 FORBIDDEN_HOOK_STRINGS gate → 13/13 GREEN (12 strings preserved) - npx tsc --noEmit → clean Plan 02-04 scope: 1/3 tasks landed (A24); Tasks 2-3 add A25+A26+A27+A28 (latency, meta.json shape, multi-tab strict, REQ-archive-layout strict). |
|||
| 3821e5c402 | docs(phase-02): update tracking after wave 2 part 2 — 02-03 GREEN (D-P2-02 + D-P2-03 close P1 #10) .planning/ROADMAP.md | |||
| 38f3aa8d7f | chore: merge executor worktree (worktree-agent-ac398144f27b986ca) — Wave 2 Plan 02-03 | |||
| 935ba1d489 |
docs(02-03): complete D-P2-02 meta.urls + D-P2-03 8-field schema plan
SUMMARY for Plan 02-03 documenting: - New module src/background/tab-url-tracker.ts (4 exports incl. snapshotOpenTabs per DEC-011 Amendment 1 capability). - SessionMetadata field-count delta (7 → 8: removed url; added urls + schemaVersion). - 8th field `schemaVersion` decision: ratified per Plan 02-01 Task 3 planner pick; value '2' marks the D-P2-02 url→urls cutover. - Filter rules verbatim from CONTEXT.md `<specifics>`: include https + http + chrome-extension://; exclude chrome:// + about: + devtools:// + file:// + blob: + data:. - DEC-011 Amendment 1 verified in place (already landed via plan-checker iteration-1 revision pass commits |
|||
| af035564d3 |
docs(02-03): REQUIREMENTS — REQ-meta-json-schema amended for 8-field shape with urls[] + schemaVersion
- Rewrite REQ-meta-json-schema block (lines ~106-119) to reflect the
Plan 02-03 D-P2-02 + D-P2-03 cutover:
* 8 fields exact (was 7); `url: string` REMOVED; `urls: string[]`
+ `schemaVersion: '2'` ADDED.
* Acceptance criteria: schemaVersion === '2'; ISO-8601 timestamp;
urls entries match URL_SCHEME_ALLOW regex (https + http +
chrome-extension://); urls deduplicated + first-seen-ordered; semver
extensionVersion; non-negative integer totalEvents; exactly 8 keys.
* F2 explicitly carried in the urls acceptance bullet: empty array IS
permitted (whole-desktop-no-tab session is a meaningful operator
state); non-empty arrays validate each entry against the filter regex.
* Binding note preserves the original CON-meta-json-schema 7-field
shape as SPEC provenance while documenting that this REQ supersedes
it for the Phase 2 cutover.
- Traceability table entry updated:
Phase 3 (originally) → **Phase 2** → Phase 2 (implementation landed
via Plan 02-03; harness validation deferred to Plan 02-04).
- Footer dated 2026-05-20 with the REQ-meta-json-schema amendment
citation; prior Plan 01-10 closure entry demoted to "Earlier update".
Verification gates per plan:
- grep -c "schemaVersion" .planning/REQUIREMENTS.md → 3 (≥2 required ✓)
- grep -c "urls.*string\[\]" .planning/REQUIREMENTS.md → 2 (≥1 required ✓)
|
|||
| 78031e7782 |
feat(02-03): meta.json — urls[] + schemaVersion (D-P2-02 + D-P2-03; replaces url:string)
- src/shared/types.ts SessionMetadata: REPLACE `url: string` with
`urls: string[]`; ADD `schemaVersion: string` as the first field.
Total 8 fields. Field-emission order follows source-declaration order
(TypeScript object-literal insertion order; JSON.stringify emits in
insertion order per ECMA-262). Docstring cites D-P2-02 + D-P2-03 +
Plan 02-01 Task 3 planner-resolved 8th field decision + F2 empty-array
permission.
- src/background/index.ts:
* Import { initTabUrlTracker, snapshotOpenTabs, getTabUrlsSeen } from
'./tab-url-tracker'.
* Register initTabUrlTracker() at module top-level alongside
chrome.downloads.onChanged (Plan 02-02 precedent for D-P2-* feature
registration). Defensive try/catch matches the surrounding chrome.*
listener pattern; tracker module has its own initialized flag for
idempotency.
* createArchive: snapshotOpenTabs() before reading getTabUrlsSeen()
(DEC-011 Amendment 1 capability — captures tabs opened but never
activated). Empty urls[] emitted faithfully per F2 (no fake
extension-origin sentinel; logger.warn for diagnostic visibility on
whole-desktop-no-tab sessions).
* metadata literal: schemaVersion: '2' first, urls (not url), 8 fields
total. ECMA-262 insertion-order guarantee + JSON.stringify deliver
the canonical wire shape.
- Always-on charter preserved: createArchive does NOT call
clearTabUrlsSeen() — tracker continues accumulating across saves
(Plan 01-09 Amendment 3 invariant).
Verification:
- npx tsc --noEmit → clean.
- npm run build → clean (dist/assets/index.ts-8LkXuqac.js 378.82 kB,
~+2 kB vs pre-Task-2 baseline for the new tab-url-tracker module).
- npx vitest run → 171/171 GREEN (was 163 GREEN / 8 RED; +8 GREEN net).
- Tier-1 grep gate: 13/13 GREEN unchanged.
Closes 8 RED tests:
- tests/background/meta-json-urls-schema.test.ts Tests 1+2 (Tests 3+4+5
flipped in Task 1).
- tests/build/strict-meta-json-validation.test.ts Tests 1+3+8 (Tests 2,
4, 5, 6, 7 remain GREEN regression guards).
|
|||
| 7beb69059e |
feat(02-03): tab-url-tracker — chrome.tabs.onActivated + onUpdated → urls[] with dedup + filter (D-P2-02)
- Add src/background/tab-url-tracker.ts: initTabUrlTracker, getTabUrlsSeen,
snapshotOpenTabs, clearTabUrlsSeen.
- Filter: positive-allow regex ^(https?|chrome-extension):// — INCLUDE
https + http + chrome-extension://; default-deny chrome://, about:,
devtools://, file://, blob:, data: (per CONTEXT.md `<specifics>` URL
filter clause).
- Dedup: Set membership gate + first-seen-ordered array; getTabUrlsSeen
returns a slice so callers cannot mutate internal state.
- snapshotOpenTabs: defensive chrome.tabs.query({}) enumeration for SAVE-
time augmentation (DEC-011 Amendment 1 capability). Captures tabs the
operator opened but never activated.
- Module guards: initialized flag prevents double-listener registration;
all chrome.tabs.* listener calls wrapped in defensive try/catch matching
the src/background/index.ts:bootstrap pattern.
- Tier-1 grep-gate preserved (13 entries): NO `_resetForTesting` /
`_observeForTesting` ergonomic test hooks exported (would have leaked
into production bundles per tests/background/no-test-hooks-in-prod-
bundle.test.ts). Tests drive chrome.tabs.onUpdated callbacks directly
via the chrome stub — Plan 02-01 SUMMARY anticipated this option.
[Rule 3 - Blocking] tests/background/meta-json-urls-schema.test.ts Tests 3+4
extended to wire chrome.tabs.onUpdated callbacks directly (replaces the
optional `_resetForTesting` / `_observeForTesting` skeletons). Test 5
simplified (empty-tracker assertion needs no observation seeding on a
freshly-reset module graph). Test 5 F2 contract preserved verbatim.
Verification:
- npx tsc --noEmit → clean
- npx vitest run tests/background/meta-json-urls-schema.test.ts → 3/5 GREEN
(Tests 3+4+5 the tracker-contract trio flipped; Tests 1+2 still RED as
they pin the SessionMetadata + createArchive amendment — Task 2 territory)
|
|||
| d3aa567a54 | docs(phase-02): update tracking after wave 2 part 1 — 02-02 GREEN (D-P2-01 closes P0-6) .planning/ROADMAP.md | |||
| 3f251c5666 | chore: merge executor worktree (worktree-agent-a7b893984f8b14c8f) — Wave 2 Plan 02-02 | |||
| 95b5bd252c |
docs(02-02): complete Blob URL download pipeline plan (D-P2-01 closes P0-6)
SUMMARY.md documents: - 3 RED tests in tests/background/blob-url-download.test.ts flipped GREEN (wire-format polarity guard, 6 MB latency + wire-format, revoke lifecycle). - 6 files modified (3 prod source + 3 test files; +518 / -35 lines). - Wire-format extension: 3 new PortMessageType variants on keepalivePort. - Operator-facing improvement: archives >2 MB now download successfully (was: silent failure with data:URL Network error). - Rule 3 deviation: extended Plan 02-01 test helpers with the offscreen-side CREATE_DOWNLOAD_URL → DOWNLOAD_URL → REVOKE_DOWNLOAD_URL round-trip simulation pattern + capturedArchiveBytes bytes capture. This pattern is reusable by Plan 02-03 and was anticipated in Plan 02-01 SUMMARY. - Forward link: Plan 02-03 (meta.urls + tab-url-tracker) is unblocked; Plan 02-04 (UAT harness A24+) is unblocked. Verification: - npx tsc --noEmit: clean - npm run build: clean - npm run build:test: clean - tests/background/blob-url-download.test.ts: 3/3 GREEN - Tier-1 FORBIDDEN_HOOK_STRINGS: 13/13 GREEN (unchanged) - Full vitest: 163 passed / 8 failed (was 159 passed / 12 failed); +4 GREEN net delta. 8 remaining RED are exactly Plan 02-03 territory. |
|||
| 79964e62d2 |
feat(02-02): SW — downloadArchive via offscreen-minted Blob URL + revoke lifecycle (D-P2-01 closes P0-6)
Production changes (src/background/index.ts):
- pendingDownloadUrlResolvers Map<requestId, resolver> routes DOWNLOAD_URL
responses back to the in-flight downloadArchive Promise; mirrors the
pendingBufferRequests pattern from the BUFFER round-trip so port
replacement mid-mint does not lose the response.
- pendingRevokes Map<downloadId, url> tracks (downloadId → minted blob:URL)
for the chrome.downloads.onChanged revoke dispatch.
- onConnect port message sink extended with DOWNLOAD_URL routing branch
(alongside existing PING/BUFFER routing).
- downloadArchive rewritten: encode archive via blobToBase64 → post
CREATE_DOWNLOAD_URL on videoPort → await DOWNLOAD_URL response (race
against 5s BLOB_URL_MINT_TIMEOUT_MS) → reject empty / non-blob: URLs
(T-02-02-03 mitigation) → call chrome.downloads.download → register
(downloadId, url) in pendingRevokes. NO data:URL fallback — typed
errors route through saveArchive's catch to RECORDING_ERROR.
- chrome.downloads.onChanged listener registered at module init:
on terminal state ('complete' / 'interrupted'), posts REVOKE_DOWNLOAD_URL
to videoPort and clears the pendingRevokes entry.
Deviation (Rule 3 — auto-fix blocking issue):
- Plan 02-01's test helpers in blob-url-download.test.ts +
meta-json-urls-schema.test.ts + strict-meta-json-validation.test.ts
modeled only the REQUEST_BUFFER → BUFFER round-trip, not the new
CREATE_DOWNLOAD_URL → DOWNLOAD_URL round-trip Plan 02-02 introduces.
Without the test-side mint simulation, the SW's downloadArchive
times out at the offscreen mint step → chrome.downloads.download
never called → ALL existing meta.json tests timeout.
- Each helper extended with a tryFireDownloadUrl block that decodes
the CREATE_DOWNLOAD_URL.dataBase64, mints a Node-native blob:URL via
URL.createObjectURL, captures the archive bytes for downstream
JSZip extraction (capturedArchiveBytes), and replies DOWNLOAD_URL.
Test 3 (revoke lifecycle) additionally shims port.postMessage to
call URL.revokeObjectURL on receipt of REVOKE_DOWNLOAD_URL — the
test-side equivalent of src/offscreen/recorder.ts handleCreateDownloadUrl.
- Pre-existing Plan-02-02-era TODO comments in both test files
explicitly anticipated this extension ("Plan 02-03 implementer will
likely need a different helper, e.g. spy on URL.createObjectURL").
Verification (full §verification block from plan):
- npx tsc --noEmit: clean
- npm run build: clean
- npx vitest run tests/background/blob-url-download.test.ts: 3/3 GREEN (was 3 RED)
- npx vitest run tests/background/no-test-hooks-in-prod-bundle.test.ts: 13/13 GREEN
- npm test full suite: 163 passed / 8 failed (was 159 passed / 12 failed);
net delta +4 GREEN = 3 RED→GREEN flips + 1 ffprobe-flaky pass. 8 remaining
RED are exactly the Plan 02-03 territory (5 meta-json-urls-schema + 3
strict-meta-json-validation RED tests).
- grep -c "data:application/zip;base64," src/background/index.ts: 0 (gone)
- grep -c "blob:" src/background/index.ts: 8 (new pipeline)
- grep -c "chrome.downloads.onChanged" src/background/index.ts: 5 (listener wired)
- dist/ post-build: 0 "data:application/zip;base64," matches; 1 file with
"chrome.downloads.onChanged" (the SW chunk).
|
|||
| f0b95f4a83 |
feat(02-02): offscreen — CREATE/REVOKE Blob URL handlers on keepalivePort (D-P2-01)
- onPortMessage gains CREATE_DOWNLOAD_URL + REVOKE_DOWNLOAD_URL branches.
- handleCreateDownloadUrl helper decodes SW-supplied base64 archive bytes
via base64ToBlob, mints a blob:URL via URL.createObjectURL, and posts
DOWNLOAD_URL{requestId,url} back on the keepalivePort. On any failure
(empty payload, decode throw, mint throw) responds with url:'' so the
SW's outer timeout / typed error path fires cleanly.
- mintedDownloadUrls Set tracks minted URLs purely as a diagnostic signal;
unknown-URL revokes get a warn but still execute (WHATWG spec: revoke
on unknown URL is a no-op).
- base64ToBlob added to the existing src/shared/binary import.
- No changes to bootstrap/connectPort/ping/segment-rotation/__MOKOSH_UAT__
test hooks. Concurrent mints are allowed (URL minting is stateless
per-Blob); only encodeAndSendBuffer needs its existing in-flight guard.
Architectural rationale (D-P2-01): SW lacks URL.createObjectURL per
DEC-006; offscreen has it. Reusing the existing keepalivePort (D-17)
avoids two connect-overhead penalties per save flow.
|
|||
| 483998dec1 |
feat(02-02): wire-format — extend PortMessage with CREATE_DOWNLOAD_URL/DOWNLOAD_URL/REVOKE_DOWNLOAD_URL (D-P2-01)
- PortMessageType union grows 4 → 7 entries adding the D-P2-01 Blob URL migration triplet (CREATE_DOWNLOAD_URL, DOWNLOAD_URL, REVOKE_DOWNLOAD_URL). - PortMessage interface gains optional dataBase64, mimeType, url fields following the same optional-tagged-union pattern as the existing segments? field. Wire format reuses the D-12 base64 precedent from src/shared/binary.ts (chrome.runtime.Port JSON-serializes payloads). - Docstring above the union explains the SW↔offscreen mint/revoke lifecycle and points to .planning/phases/02-stabilize-export-pipeline/ 02-CONTEXT.md D-P2-01 for the full architectural rationale. - No SessionMetadata changes — meta.urls migration is Plan 02-03 territory. |
|||
| ed64d872be | docs(phase-02): update tracking after wave 1 — 02-01 RED gate complete .planning/ROADMAP.md | |||
| 0df9a35598 | chore: merge executor worktree (worktree-agent-a523bf9bbd145af79) — Wave 1 Plan 02-01 | |||
| a991e1732a |
docs(02-01): complete RED gate — 3 test files pin D-P2-01 + D-P2-02 + D-P2-03 + F2
Plan 02-01 Wave 0 RED gate closed. Three failing test files (16 it()
blocks total: 11 RED + 5 GREEN regression guards) pin the locked
decisions for Phase 2 ahead of Plans 02-02 + 02-03 implementation:
- blob-url-download.test.ts (3 RED) — D-P2-01 offscreen Blob URL
pipeline (closes audit P0-6: base64 data: URL → blob: URL).
- meta-json-urls-schema.test.ts (5 RED) — D-P2-02 meta.url → meta.urls
migration + F2 empty-tracker → urls:[] resolution.
- strict-meta-json-validation.test.ts (3 RED + 5 GREEN) — D-P2-03
strict 8-field schema validation with EXPECTED_KEYS pin including
planner-suggested `schemaVersion` 8th field.
Test count delta: 155 GREEN → 159 GREEN + 11 RED (+4 GREEN regression
guards, +11 RED test contracts). Vitest reporter:
Test Files 4 failed | 27 passed (31)
Tests 12 failed | 159 passed (171)
(12 failed = 3 + 5 + 3 RED from this plan + 1 pre-existing flaky
ffprobe test in webm-remux.test.ts — out of scope; documented in
SUMMARY.md Deferred Issues.)
Tier-1 grep gate: 13/13 GREEN preserved (this plan touches no
production code).
Planner-resolved tensions carried forward in SUMMARY.md:
- D-P2-03 'non-empty urls[]' vs CONTEXT.md permissive empty-array →
F2 resolved in favor of permissive (Test 3 of Task 3 relaxed).
- 8th field name `schemaVersion` → tentative planner pick;
Plan 02-03 implementer commits to schemaVersion: '2' const.
- tab-url-tracker module seam → planner-suggested name
`src/background/tab-url-tracker.ts` with getTabUrlsSeen() export.
- Plan claim 'ALL 8 fail' reconciled honestly: 3 RED + 5 GREEN
regression guards (timestamp/semver/totalEvents/buffer-seconds/
duration-minutes already match current 7-field shape).
Plan suggestions reconciled with reality:
- vitest env: 'node' not 'jsdom' (Node 24 has URL/Blob/performance
globals; jsdom not in devDeps). FileReader polyfill inline.
- Task 2 Test 1 source-text scan instead of tsc-compile-failure
(vitest.config.ts typecheck:{enabled:false}).
Per worktree-mode constraint: STATE.md, ROADMAP.md, REQUIREMENTS.md
NOT modified. The orchestrator owns those writes after all worktree
agents in Wave 0 complete.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 94e03467c6 |
test(02-01): RED — pin strict 8-field meta.json schema validation (D-P2-03)
Plan 02-01 Task 3 RED gate. Eight strict-validation tests pin D-P2-03
(strict 8-field meta.json schema) plus F2 plan-checker-iter-1
resolution (empty urls[] permitted for whole-desktop-no-tab sessions).
Tests (3 RED-today + 5 GREEN-today regression guards; ALL 8 GREEN
after Plan 02-03):
1. RED — Object.keys(meta).length === 8.
2. GREEN — timestamp matches ISO-8601 Z-suffix regex.
3. RED — urls is Array of valid URLs (empty permitted per F2).
4. GREEN — extensionVersion matches semver.
5. GREEN — totalEvents is non-negative integer.
6. GREEN — videoBufferSeconds === 30 (CON-video-window).
7. GREEN — logDurationMinutes === 10 (CON-event-log-window).
8. RED — no extra fields beyond EXPECTED_KEYS.
RED evidence (vitest 4.1.6 against current HEAD):
× Test 1: meta.json has 7 fields; D-P2-03 requires exactly 8.
Current keys: [timestamp, url, userAgent, extensionVersion,
videoBufferSeconds, logDurationMinutes, totalEvents].
× Test 3: meta.urls is not an Array. Got: undefined.
× Test 8: meta.json contains extra (unexpected) fields: ["url"].
PLANNER-RESOLVED TENSIONS (documented in file header):
- D-P2-03 'non-empty urls[]' vs CONTEXT.md permissive empty-array:
resolved in favor of the permissive clause (F2 — empty is the
canonical representation of whole-desktop-no-tab sessions).
- 8th field name 'schemaVersion': tentative planner pick to mark
the D-P2-02 url→urls breaking-change cutover.
- Plan's 'ALL 8 fail' claim vs reality: 5 of 8 already pass under
the current 7-field shape (timestamp, semver, totalEvents,
videoBufferSeconds, logDurationMinutes). These stay GREEN as
regression guards after Plan 02-03 lands.
EXPECTED_KEYS constant:
['timestamp', 'urls', 'userAgent', 'extensionVersion',
'videoBufferSeconds', 'logDurationMinutes', 'totalEvents',
'schemaVersion']
Plan 02-03 implementer MUST add `schemaVersion` (recommended value:
'2') to satisfy Tests 1 + 8 simultaneously.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 9e45d333cc |
test(02-01): RED — pin meta.json urls[] schema + dedup/filter + empty-tracker (D-P2-02 + F2)
Plan 02-01 Task 2 RED gate. Five failing tests pin D-P2-02 (meta.json
url→urls migration) and the F2 plan-checker-iter-1 resolution (empty-
tracker → urls:[], no sentinel fallback) ahead of Plan 02-03.
Tests:
1. SessionMetadata interface in src/shared/types.ts has 'urls: string[]'
and no 'url:' field. Source-text scan (typecheck disabled in
vitest.config.ts so tsc-failure pin would be a no-op).
2. createArchive emits meta.json with Array urls and no url field.
3. meta.urls deduplicates repeated URLs (first-seen-first order).
4. meta.urls filters chrome:// + about:; includes chrome-extension://.
5. Empty tracker → meta.urls === [] (NOT undefined/null/[origin]).
RED evidence (vitest 4.1.6 against current HEAD):
× Test 1: SessionMetadata interface body does not contain a
'urls: string[]' field (and still contains 'url:').
× Test 2: meta.urls is not an Array. Got: undefined.
× Tests 3+4+5: src/background/tab-url-tracker.ts does not exist —
Plan 02-03 GREEN gate. Each expect.fail emits the precise
contract for the GREEN flip (export name getTabUrlsSeen(),
dedup Set semantics, first-seen-first order, URL filter spec,
empty-array empty-tracker resolution).
Module seam (Plan 02-03 implements):
src/background/tab-url-tracker.ts
export function getTabUrlsSeen(): string[]
Fed by chrome.tabs.onUpdated + chrome.tabs.onActivated (per DEC-011
Amendment 1 'tabs' permission grant).
Baseline: 155 GREEN preserved (no regressions); this plan now has 8
NEW RED tests total (Task 1: 3 + Task 2: 5).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 748a81f100 |
test(02-01): RED — pin Blob URL download contract (D-P2-01)
Plan 02-01 Task 1 RED gate. Three failing tests pin D-P2-01
(offscreen-minted Blob URL pipeline) ahead of Plan 02-02 implementation:
1. chrome.downloads.download is called with a blob: URL and NOT a
data:application/zip;base64, URL (closes audit P0-6).
2. A 6 MB archive completes through downloadArchive in under 5 s AND
emits a blob: URL (REQ-archive-export-latency; vi-mocked
remuxSegments short-circuits the muxer for the 6 MB stress path).
3. URL.revokeObjectURL is scheduled with the minted URL after
chrome.downloads.onChanged fires 'complete' (lifecycle hygiene).
RED evidence (vitest 4.1.6 against current HEAD):
× Test 1: chrome.downloads.download was called with
url='data:application/zip;base64,UEsDBAoAAAAAAL1qtFw...'
— D-P2-01 forbids data:application/zip;base64, prefix.
× Test 2: chrome.downloads.download was called with
url='data:application/zip;base64,...' at the 6 MB scale —
D-P2-01 requires blob: prefix.
× Test 3: URL.revokeObjectURL was never called after
chrome.downloads.onChanged 'complete' fired
(chrome.downloads.onChanged._callbacks.length === 0 at probe time).
Implementation notes:
- vitest default env is 'node' (vitest.config.ts); Node 24 ships
URL.createObjectURL + URL.revokeObjectURL + performance as globals,
so no jsdom override is required.
- FileReader is NOT in Node 24; added a minimal FileReader polyfill
(delegates to Blob.arrayBuffer()) so JSZip's Blob ingestion works.
- Test 2 mocks remuxSegments via vi.doMock to bypass muxer monotonic-
timestamp constraints for the synthetic 6 MB payload.
- Tests 1 + 3 drive the SW with the canonical 3-slice raw-3ebml-concat
fixture (same byte offsets as tests/background/webm-remux.test.ts).
- T-02-01-01 mitigation: grep -c '\.skip' returns 0.
Baseline: 155 GREEN preserved (no regressions); this plan adds 3 NEW
RED tests. Plan 02-02 flips them GREEN.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 44ea925e6f |
chore(02): state.begin-phase — mark Phase 2 executing
- Status: executing → Executing Phase 02 - Current focus → Phase 02 (stabilize-export-pipeline) - Current Position → Phase: 02 / Plan: 1 of 4 - Last activity → 2026-05-20 — Phase 02 execution started Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| 6f052c74f8 |
chore(02): resume — consume HANDOFF + sync STATE for Phase 2 execution
- Delete HANDOFF.json (one-shot artifact; resume succeeded) - Update STATE.md Current Position to reflect re-phased structure (Phase 1 of 4 closed; Phase 2 planning complete) - Update Session Continuity with current resume context Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| a440c7d76b |
wip: phase-02 paused — 4 plans validated, ready for execution
Phase 2 (Stabilize export pipeline) planning ceremony complete: - /gsd-discuss-phase 2 → 02-CONTEXT.md ( |
|||
| df8c086ff0 |
docs(02): sync CON-manifest-permissions constraint with DEC-011 Amendment 1
Plan-checker iteration 2 surfaced an informational stale-reference: the
Constraints section's CON-manifest-permissions bullet still listed the
original SPEC §7 5-permission set (`tabCapture`, `activeTab`, `downloads`,
`scripting`, `storage`). This was superseded by:
- Phase 01 DEC-003 Amendment (retired `tabCapture`; added `desktopCapture`
+ `offscreen` + `notifications`)
- Phase 02 DEC-011 Amendment 1 (added `tabs` for D-P2-02 meta.urls feature
at commit
|
|||
| 9dcfcf0793 |
fix(02): revise plans per checker (B1 + 4 flags) — add tabs permission for D-P2-02
- BLOCKER B1: add `tabs` to manifest.json permissions (DEC-011 Amendment 1 cites Phase 2 D-P2-02 meta.urls feature as justification). Honors D-P2-02 "all tabs visible" wording verbatim. Updates manifest-i18n test expected permission list lockstep. - F1: add A28 harness assertion for REQ-archive-layout strict zip-layout verification (5 entries, no extras). - F2: createArchive empty-tracker fallback removed; logs warn + sets urls:[] instead of fake [extension-origin URL]. 02-01 RED test pins empty-tracker → urls:[]. - F3: 02-02 Task 3 prose deliberation struck; typed `blob-url-mint-failed` throw is the resolved-only contract. - F4: 02-02 Task 3 verify block adds full-suite `npm test` after focused test runs. - A27 strict-mode (Plan 02-04): REQUIRES both URLs in meta.urls; FAILS on length < 2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| 0608b22427 |
feat(02): plans 01-04 — Phase 2 export pipeline closure (Blob URL + meta.urls + schema + harness)
Wave structure (4 plans, 3 waves): - 02-01 (Wave 1 RED): 15 RED tests pinning D-P2-01 (blob: URL contract), D-P2-02 (meta.urls schema + dedup + filter), D-P2-03 (strict 8-field validation + schemaVersion '2' cutover marker). - 02-02 (Wave 2): Offscreen-minted Blob URL pipeline — extends PortMessageType with CREATE/REVOKE messages; SW downloadArchive rewrite (data: → blob: via base64-on-wire to offscreen + URL.createObjectURL + chrome.downloads.onChanged revoke lifecycle). Closes audit P0-6; unblocks >2 MB archives. - 02-03 (Wave 2): meta.urls schema migration + tab-url-tracker module (chrome.tabs.onActivated + onUpdated → deduplicated, filtered, first-seen- ordered string[]); SessionMetadata 7→8 fields with schemaVersion + urls; REQUIREMENTS.md REQ-meta-json-schema amendment. Closes P1 #10. - 02-04 (Wave 3): UAT harness A24+A25+A26+A27 — blob: URL prefix, <5s SAVE→zip latency, meta.json 8-field shape, multi-tab dedup; pre-checkpoint bundle gates per saved memory + operator empirical UAT cycle 1. Tier-1 FORBIDDEN_HOOK_STRINGS inventory stays at 12 (no new hook symbols — chrome.* monkey-patches + JSZip + production APIs only). Locked decisions honored (per 02-CONTEXT.md): - D-P2-01: offscreen-minted Blob URL via existing keepalivePort + base64 wire format (reuses D-12 precedent at src/shared/binary.ts). - D-P2-02: meta.json url:string → urls:string[]; URL filter per CONTEXT.md <specifics> (include https://, chrome-extension://; exclude chrome://, about:, devtools://, file://); dedup + first-seen ordering. - D-P2-03: full scope; 8-field strict schema validation with schemaVersion='2' as the 8th field (planner-resolved tentative pick; revisable by plan-checker). Architectural constraints preserved: - Always-on charter (Plan 01-09 Amendment 3): no finally-block in saveArchive; no clearTabUrlsSeen on SAVE. - Tier-1 FORBIDDEN_HOOK_STRINGS = 12 (no new test-hook symbols). - Never await import(...) in src/background/index.ts (Plan 01-11 SUMMARY). - Pre-checkpoint bundle gates per feedback-pre-checkpoint-bundle-gates.md (run in 02-04 Task 4 before operator surface). Plan validation: gsd-sdk frontmatter.validate + verify.plan-structure GREEN for all 4 plans. ROADMAP updated: Phase 2 Plans list + Goal/Success Criteria block annotated with D-P2-02/D-P2-03 amendments + 5th success criterion (Blob URL + revoke lifecycle for >2 MB archives); Progress table 0/TBD → 0/4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| cc042a5583 |
docs(02): capture phase context — discuss-phase complete
Phase 2 (Stabilize export pipeline) discuss-phase landed via inline canonical workflow execution. 02-CONTEXT.md captures 3 locked decisions: - **D-P2-01:** Offscreen-minted Blob URL pipeline replaces base64 data: URL download path (src/background/index.ts:709-710). SW Blob → offscreen URL.createObjectURL → SW chrome.downloads.download → URL.revokeObjectURL on onChanged. Closes audit P0-6. Unblocks real-archive size (>2 MB). - **D-P2-02:** meta.json schema migrates singular `url: string` to plural `urls: string[]` capturing all tabs visible during the 30s recording window. Schema-breaking change requires REQUIREMENTS.md REQ-meta-json-schema amendment + SessionMetadata type update. Closes audit P1 #10 captured-URL bug. - **D-P2-03:** Full Phase 2 scope = Blob URL migration + meta.urls schema migration + strict meta.json schema validation test + UAT harness A24+ <5s latency assertion. ~3-4 plans expected. Decision provenance: - D-P2-01 rationale: user "up to you. If you think we need to migrate — good let's do it." Plus analysis: real archives EXCEED base64 cap. - D-P2-02 rationale: user picked "All tabs' URLs as an array (meta.json.urls)" — highest informational fidelity for multi-tab bug reproduction. Privacy acceptable per "log is internal" v1 charter. - D-P2-03 rationale: user picked "Full scope: bug fixes + schema + harness latency assertion". Canonical references + code context + deferred items captured in CONTEXT.md. Phase boundary explicit: not from-scratch; closes residual gaps after Plans 01-08/01-09/01-10/01-12 substantively shipped REQ-popup-ui + REQ-archive- layout + REQ-screenshot-on-export. Next: /gsd-plan-phase 2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| 6dbed91efd |
docs(roadmap): re-phase milestone — remove Phase 2 (DOM/event-capture privacy)
Per operator charter shift 2026-05-20: "we don't care about privacy hardening.
At least here." Archive flow is internal-only (no external transmission),
which reframes the password-masking P0-5 defect from privacy-regulation
gravity to operator-hygiene polish.
Re-phasing applied across 4 planning artifacts:
ROADMAP.md:
- Original Phase 2 ("Stabilize DOM + event-capture privacy") REMOVED entirely
(summary list + Phase Details section + Progress table row).
- DOM + event-log VERIFICATION (REQ-rrweb-dom-buffer + REQ-user-event-log)
ABSORBED by new Phase 3 (SPEC §10 smoke verification).
- Phase numbering: old 3 → new 2 (export), old 4 → new 3 (smoke), old 5 → new 4
(optional harden). Dependency chains updated accordingly.
- Overview blurb + journey narrative + success criteria refreshed.
- Phase 3 (smoke) explicitly NOT-in-scope: P0-5 password masking dropped.
REQUIREMENTS.md traceability:
- REQ-rrweb-dom-buffer: Phase 2 → Phase 3 (verification scope; UAT harness
A24+ extension planned).
- REQ-user-event-log: Phase 2 → Phase 3 (same context).
- REQ-password-confidentiality: Phase 2 → Out of Scope (v1) — DEFERRED per
charter shift.
- REQ-popup-ui, REQ-screenshot-on-export, REQ-archive-layout,
REQ-meta-json-schema, REQ-archive-export-latency: Phase 3 → Phase 2
(renumbered; substantively shipped via Plans 01-08 + 01-09 + 01-12;
residual gaps in Phase 2).
- Coverage: 10 mapped + 1 out-of-scope (was 11 mapped).
PROJECT.md:
- CON-sensitive-data-masking: DEFERRED 2026-05-20 (preserves audit trail
via strikethrough; rationale documented).
- DEC-004 amendment: rrweb 5000-event cap retained; masking deferred. Cites
rrweb 2.0.0-alpha.4 maskInputSelector→maskInputFn API change.
STATE.md:
- frontmatter total_phases: 5 → 4.
- stopped_at narrative captures the re-phasing event.
CLI bug note: this re-phasing was attempted via `gsd-sdk query phase.remove 2`
+ canonical `/gsd-remove-phase 2` Skill invocation, but BOTH paths produced
corrupted output (cascading rename via reverse-iteration loop at
phase.cjs:670-679 collapsed all subsequent phases to "Phase 2", plus a
mysterious "2026"→"2002" date corruption). Recovery applied as manual edits
in this commit. CLI bug logged as upstream GSD-framework concern; not a
Mokosh-side issue.
Plan: next is `/gsd-discuss-phase 2` (new Phase 2 = export pipeline; narrowed
scope per re-phasing — ~2-3 plans expected since Plans 01-08 + 01-09 + 01-10
+ 01-12 already shipped most surface).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 586836f8a0 |
docs(01): VERIFICATION + Phase 1 closure markers — goal-backward audit GREEN
gsd-verifier goal-backward audit (2026-05-20) returned GREEN verdict on
Phase 1 (Stabilize Video Pipeline + whole-desktop capture + as-automatic-
as-platform-allows recording start):
- 17/17 must-haves verified: 11 REQs/charters + 6 cross-cutting gates
- 14/14 plans complete (01-01..01-09 + 01-11 spike-pivot + 01-12 + 01-13
+ 01-14 + 01-10)
- 5 operator empirical acks: Plan 01-07 (Chrome playback 2026-05-15) +
Plan 01-13 (harness 2026-05-19) + Plan 01-12 (brand-fit 2026-05-20) +
Plan 01-10 cycle-2 ("All good" 2026-05-20) + Plan 01-10 brand-rename
follow-up (2026-05-20)
- Test gates: vitest 153/153 GREEN; UAT harness 24/24 GREEN; Tier-1 grep
gate 12 FORBIDDEN_HOOK_STRINGS; pre-checkpoint bundle gates PASS
- 7 P0 audit defects: 6 closed in-Phase-1-scope; P0 #6 (data-sensitive
masking) properly deferred to Phase 2
Marker flips landed:
- STATE.md status reflects Phase 1 COMPLETE; completed_phases 0 → 1
- ROADMAP.md Phase 1 row [ ] → [x] with closure-arc summary
- REQUIREMENTS.md REQ-video-ring-buffer In-progress → Complete 2026-05-20
- VERIFICATION.md committed (orchestrator-bundle pattern per verifier
protocol)
Forward-looking deferred (NOT gaps):
- Phase 2: REQ-rrweb-dom-buffer + REQ-user-event-log +
REQ-password-confidentiality (audit P0 #6)
- Phase 5 hardening: getDisplayMedia cursor visibility; setimmediate
polyfill new Function pre-existing; tabs permission gap; dark-surface
logo contrast; 2 ffprobe/ffmpeg test flakes
Phase 2 (Stabilize DOM + event-capture privacy) kickoff pending.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| d1ef77a7d1 |
docs(01-10): state + roadmap + requirements — Plan 01-10 closure
State markers sync after Plan 01-10 closure: STATE.md: - progress.completed_plans: 13 → 14 - progress.percent: 93 → 100 (all 14 Phase 1 functional plans complete) - status: executing (Phase 1 final-closure marker flip pending) - stopped_at + Last session timestamps refreshed - Current Position bumped to 14/14 plans complete - Outstanding Phase 1 gates: Plan 01-10 row marked CLOSED; Phase 1 final-closure marker flip listed as remaining work - Plan 01-10 closure section added mirroring existing 01-12/01-13/01-14 patterns: 4 wave commits + 5 inter-cycle debug commits + cycle-2 ack - Performance Metrics: Phase 01 P10 row added (5h, 5 tasks, 14 files) - Decisions: 3 Plan 01-10 architectural decisions added (first-install activation; D-16-toolbar charter preservation; three-pipeline DOM population pattern; startVideoCapture D-01 cleanup gap closure) ROADMAP.md: - Plan 01-10 row flipped to [x] with full closure annotations (commit chain + harness counts + operator ack date) - Plan 01-09 row annotated with closure-cycle follow-up debug commits ( |
|||
| 52dc2e6a6e |
docs(01-10): summary — welcome tab + 5-cycle debug closure + brand polish (153/153 vitest, 24/24 UAT GREEN, ack 2026-05-20)
Plan 01-10 (welcome tab) full SUMMARY landing closure of Phase 1's final
functional plan. Welcome tab landed end-to-end across 4 waves + Wave 4
operator empirical UAT cycle 2 ack "All good" 2026-05-20.
Architecture:
- chrome.runtime.onInstalled('install') + chrome.storage.local
flag-gating (onboarding-completed:true + installed-at:<Date.now()>)
+ chrome.tabs.create + fire-and-forget .catch defense-in-depth.
- Plan 01-12 must_have #9 path-B contract honored: welcome.css opens
with `@import '../shared/tokens.css';` (canonical Lora display +
IBM Plex Sans UI + D-04 Loom palette); NO placeholder
welcome-tokens.css file.
- chrome.i18n.getMessage for welcomeHeroRu + welcomeHeroEn with
`|| <en-const>` fallback (Plan 01-12 fallback pattern preserved).
- Vite `?url` import + auto-WAR idiom bundles canonical
mokosh-mark.svg as inline data URL in welcome chunk
(closure-cycle debug 01-10-welcome-page-missing-mark).
- Three-pipeline DOM population: populateMark walks
[data-mokosh-slot='mark']; populateCopy walks [data-mokosh-key]
from in-file COPY map; populateI18n walks [data-mokosh-i18n-key]
from chrome.i18n.getMessage.
- D-16-toolbar charter preserved: welcome page is informational +
read-only; NO REQUEST_PERMISSIONS / chrome.runtime.sendMessage
start path. CTA copy directs operator at toolbar icon.
Wave structure (4 plan-wave commits):
-
|
|||
| d21ed17310 |
fix(01-12): brand polish — replace stale 'AI Call Recorder' refs with Mokosh (4 files)
Plan 01-12 D-07 (commit |
|||
| a2dfc8cb9b |
fix(01-09): startVideoCapture — remove stale active-tab dependency (D-01 cleanup gap)
The legacy chrome.tabs.query({ active: true, currentWindow: true }) +
"No active tab found" validation inside startVideoCapture were load-
bearing in the pre-D-01 chrome.tabCapture era but became functionally
dead after Plan 01-09's D-01 conversion to getDisplayMedia-in-offscreen.
The only post-D-01 consumer was a log line at index.ts:521.
The dead validation caused an activeTab-permission-scope asymmetry
between callers: chrome.action.onClicked grants activeTab on the click
gesture (so tab.url was readable → toolbar path worked silently) but
chrome.notifications.onClicked does NOT grant activeTab and the extension
has no `tabs` permission, so notifications.onClicked → startVideoCapture
threw "No active tab found" before reaching ensureOffscreen. Operator
2026-05-20 UAT against the new notifStartupCta CTA copy ("Mokosh ready.
Click to start a recording.", commit
|
|||
| 0854baf66c |
fix(01-10): vitest build-test it() timeout — bump to 30s for slower welcome-page build
The build-completes Tier-1 gate at tests/background/no-test-hooks-in-prod-bundle.test.ts:247 was racing vitest's default 5000ms it() ceiling. Plan 01-10 closure shipped the welcome page (commits |
|||
| d48a715da5 |
fix(01-10): welcome page mark — bundle canonical mokosh-mark.svg + replace placeholder
Plan 01-10 must_have #9 path-A swap-in (landed 2026-05-20 per debug session 01-10-welcome-page-missing-mark). Closes the planning-coverage gap where Plan 01-12 path-B (canonical tokens import) ran ahead of 01-10, leaving the welcome hero with a text placeholder 'Mokosh' inside the rec-bg circle instead of the canonical 2×2 woven-square mark from src/shared/brand/mokosh-mark.svg. Why Option B (Vite ?url import) over manual WAR (A) or inline SVG (C): - @crxjs/vite-plugin ^2.0.0-beta.25 auto-WARs transitively-reachable resources from extension pages — no manifest.json edit needed. - Vite default-inlines small SVGs (~600 bytes < 4096 byte default assetsInlineLimit) as data:image/svg+xml URLs in the welcome chunk — no extra HTTP request, no extra WAR entry. - Hashed asset fallback works automatically if the SVG grows past the inline limit in future revisions. - Existing font-bundling precedent (dist/assets/Lora-*.woff2 + IBMPlex*.woff2) proves the Vite + crxjs pipeline. Files modified: - src/welcome/welcome.ts — added markUrl import + populateMark() that walks [data-mokosh-slot='mark'] and injects an <img>. - src/welcome/welcome.html — added explanatory comment block; preserved the data-mokosh-slot wrapper for forward-compat (the placeholder span remains as the JS-fail-gracefully fallback). - src/welcome/welcome.css — added .welcome-hero__mark-img rule (60% sizing inside the existing styled circle wrapper). - src/welcome/copy.ts — added 'welcome.hero.mark.alt' COPY key (Russian per D-03 Sober voice). - globals.d.ts — added *.svg?url ambient module declaration (Vite recommended pattern; keeps tsconfig.json types: ['chrome'] clean by not requiring vite/client triple-slash directives). - tests/uat/extension-page-harness.ts — extended A17 with A17.8 sub-check verifying the canonical mark SVG is bundled into the welcome chunk (data URL OR file URL form) AND that the canonical viewBox='0 0 32 32' is preserved through bundling. Acceptance gates passed: - npx tsc --noEmit exit 0 - npm run build exit 0 - SKIP_BUILD=1 npm test → 150/150 GREEN - npm run test:uat → 24/24 GREEN including A17.8 - Tier-1 hook-string grep gate PASS (no FORBIDDEN_HOOK_STRINGS in production bundle). - Manifest valid JSON; web_accessible_resources auto-bundled. - Pre-checkpoint bundle gates 1/2/3: vendor pre-existing hits (JSZip + ts-ebml) confirmed identical pre-change via git stash baseline; not caused by this fix. Forward-looking deferred (out of scope): - Issue 2 dark-surface contrast (e.g. chrome.notifications icon128 may need a light-stroke variant). The welcome hero's rec-orange BG already provides high contrast with the dark ink stroke — this is correct design. Per the orchestrator's explicit constraint, light-variant mark for dark notification panels is deferred to Phase 5. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| 4bba679e39 |
fix(01-09): notifStartup text split — notifStartupCta for onStartup; notifRecordingStarted for manual-start
Operator UAT 2026-05-20 rejected the build because the OS notification fired
on `chrome.runtime.onStartup` ("Recording started. I'm watching the last 30
seconds.") implied recording had auto-started when in fact recording was
not running. Per Phase 1 always-on charter recording does NOT auto-start;
the notification is the gesture surface that invites the operator to start
one (notifications.onClicked → startVideoCapture, src/background/index.ts:1038).
Root cause: a single i18n key `notifStartup` conflated the pre-recording
CTA-with-gesture path (the only path actually wired today) and a future
post-manual-start confirmation path. The key's own `.description` field
acknowledged the conflation. Operator-facing text leaned toward the
confirmation phrasing.
Fix (key split, no behavior change):
- `notifStartupCta` — EN: "Mokosh ready. Click to start a recording." /
RU: "Mokosh готов. Нажмите, чтобы начать запись." — wired into the
onStartup handler.
- `notifRecordingStarted` — preserves the original text ("Recording
started. I'm watching the last 30 seconds." / "Запись запущена…") for
a future post-manual-start confirmation flow.
- Fallback constant renamed `NOTIF_STARTUP_FALLBACK` →
`NOTIF_STARTUP_CTA_FALLBACK`; value updated to match the new CTA text.
- Inline test comment in tests/background/onstartup-notification.test.ts
refreshed to reference the new key + fallback. Assertion regex
/recording|recor|click/i covers both fallback + resolved locale variants,
no logic change.
Notification behavior preserved: same id prefix `mokosh-startup-`, same
priority, same icon, same onClicked → startVideoCapture wiring. No new
test-mode symbols (FORBIDDEN_HOOK_STRINGS inventory stays at 12).
Files modified:
- _locales/en/messages.json
- _locales/ru/messages.json
- src/background/index.ts
- tests/background/onstartup-notification.test.ts
Verification:
- npx vitest run --exclude tests/build/** --exclude tests/background/no-test-hooks-in-prod-bundle.test.ts: 104/104 GREEN
- npx vitest run tests/i18n/ tests/background/onstartup-notification.test.ts: 18/18 GREEN (locale-parity 4/4 + onstartup-notification 14/14)
- npx tsc --noEmit clean on src/background/index.ts
The 2 build-dependent vitest gates (tests/build/no-remote-fonts.test.ts +
tests/background/no-test-hooks-in-prod-bundle.test.ts) and npm run test:uat
are deferred to orchestrator-level re-verification after the parallel
Plan 01-10 mark-bundling fix also lands (operator-UAT re-spawn coordinated
by orchestrator).
Debug record: .planning/debug/resolved/01-09-startup-notification-misleading-text.md
Operator UAT rejection event: 2026-05-20
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| b112cb7861 |
test(01-10): wave-3 task-4 — harness A15+A16+A17 (onboarding flag observability + no-re-open settle + design-swap-readiness with @import probe); 24/24 GREEN
Plan 01-10 Wave 3: extends the UAT harness with three new page-side
assertions covering the onboarding contract + the canonical-tokens
design-swap-readiness invariant. UAT baseline 21 → 24 GREEN.
tests/uat/extension-page-harness.ts (page-side):
- assertA15 — chrome.storage.local 'onboarding-completed' === true +
'installed-at' is number. Verifies SW's openWelcomeIfFirstInstall
side-effects.
- assertA16 — 2s settle window; chrome.tabs.query welcome-tab count
delta === 0. Verifies flag-gating across SW respawns.
- assertA17 — 7 sub-checks covering: welcome.html parse + .welcome-hero
+ >=7 mokosh-keyed attrs + welcome.css canonical @import literal OR
inlined --mks-* evidence + (zero hex OR canonical resolved) + >=5
var(--mks-*) refs + bundled JS preserves populate plumbing +
getComputedStyle --mks-rec → rgb(178, 84, 61) (canonical D-04 Loom).
- window.__mokoshHarness surface extended with the three new methods;
type declaration + assignment + page-ready status text updated.
tests/uat/lib/harness-page-driver.ts (host-side):
- driveA15, driveA16, driveA17 — standard page.evaluate wrappers
matching driveA14 / driveA18..A22 idiom. driveA16 dominates the
new wall-clock budget (~2.1s for the settle window).
tests/uat/harness.test.ts (orchestrator):
- Drivers array interleaves A15/A16/A17 AFTER A14 + BEFORE A18.
A22's skip-gate no longer triggers (Plan 01-10 lands welcome.html;
A22 now exercises the substantive token-usage path).
- FORBIDDEN_HOOK_STRINGS unchanged at 12 entries (A15-A17 use only
chrome.tabs.query / chrome.storage.local.get / fetch / DOMParser /
getComputedStyle — all production-API surfaces).
DEVIATION (Rule 1 — auto-fix bug in plan-supplied check):
The plan's A17.6 spec used literal substring checks 'COPY[' and
'chrome.i18n.getMessage(' which fail against minified production
output. Vite/Rollup terser renames `COPY` → `f` (local variable
mangling) and welcome.ts's source uses optional chaining
`chrome?.i18n?.getMessage?.(` which doesn't match the verbatim
literal. Replaced with two minification-survivable witnesses:
1. 'welcome.page.title' — literal Object.freeze key (terser
preserves object-literal keys verbatim).
2. 'i18n' + 'getMessage' + 'welcomeHero' substring conjunction —
chrome global + property access + fallback key literal; all
three survive minification regardless of optional-chaining
insertion or rename.
Both witnesses prove the populate plumbing survives the build (the
ground-truth contract A17.6 enforces). The relaxed contract is
semantically equivalent — neither substring is load-bearing on its
own; both witness the same underlying invariant.
Verify (all GREEN):
- npm run test:uat: 24/24 assertions passed (A0 grep gate + A1..A14
+ A15..A17 + A18..A22 + A23).
- npx tsc --noEmit: clean.
- npm run build:test: clean; dist-test/assets/welcome-wB0e_R_n.js
bundled; harness page bundle includes new asserts.
- SKIP_BUILD=1 npx vitest run tests/background/no-test-hooks-in-prod-bundle.test.ts:
13/13 GREEN (Tier-1 grep gate; FORBIDDEN_HOOK_STRINGS at 12).
- Full vitest baseline preserved: 137 ex-grep-gate + 13 grep-gate
= 150 GREEN (Plan 01-10 target).
A17.7 canonical proof: getComputedStyle.color = 'rgb(178, 84, 61)' —
the @import '../shared/tokens.css' directive resolves through to the
canonical D-04 Loom palette --mks-madder-600 = #b2543d at runtime, as
the empirical proof Plan 01-12 must_have #9 path-B contract demands.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 8f329d8b74 |
feat(01-10): wave-2 task-3 — openWelcomeIfFirstInstall helper + onInstalled wiring (D-17-onboarding) — 3 RED → GREEN
Plan 01-10 Wave 2: SW handler extension flips Task 1's 3 RED onboarding
tests GREEN.
src/background/index.ts changes:
1. Three top-level constants added near the badge/notification block:
- ONBOARDING_FLAG = 'onboarding-completed'
- ONBOARDING_INSTALLED_AT = 'installed-at'
- WELCOME_PATH = 'src/welcome/welcome.html'
SCREAMING_SNAKE per project naming standard for true constants.
2. openWelcomeIfFirstInstall helper added below ensureOffscreen
(interfaces §1 placement). JSDoc cites D-17-onboarding (CONTEXT.md
line 537+; SUFFIX disambiguates from D-17-port-lifecycle per
CONTEXT.md lines 540-545). Body:
- Early return on details.reason !== 'install' (subsequent
installs / updates / chrome_update / shared_module_update do
NOT open a welcome tab — Test B's contract).
- chrome.storage.local.get(ONBOARDING_FLAG) read with the EXACT
single-key string (storage-schema cross-version-compat pin;
Test A.3's contract).
- Early return if stored[ONBOARDING_FLAG] === true — Test C's
contract (already-onboarded suppression).
- chrome.tabs.create + chrome.storage.local.set with both the
flag and Date.now() installed-at — Test A.1 + A.2's contract.
- Defense-in-depth try/catch wraps the whole body; any thrown
chrome.* call is logged via logger.warn but does not propagate
(D-16-toolbar start path remains independent).
3. onInstalled listener extended: fire-and-forget call to
openWelcomeIfFirstInstall(details) AFTER initialize(); .catch()
boundary so rejected promises cannot escape the synchronous
listener. The existing IDB cleanup + initialize() call sequence
stays unchanged.
Architectural compliance:
- NO `await import(...)` added (01-11-SUMMARY architectural constraint
preserved; the three matches in lines 14-28 are documentation
comments about Plan 01-11's falsification).
- NO `as any` (chrome.runtime.InstalledDetails ambient typing covers
the parameter).
- NO `continue` (if-else early-return only).
- No new dependencies.
Verify (all GREEN):
- npx vitest run tests/background/onboarding.test.ts: 3 passed (Test
A flipped RED → GREEN; B + C continue passing as load-bearing
guards).
- Full vitest baseline 147 → 150 (137 ex-build-gated + 13 in build-
gated = 150 GREEN total).
- npx tsc --noEmit: clean.
- npm run build: clean; openWelcomeIfFirstInstall + D-17-onboarding
references survive into dist/assets/index.ts-*.js.
- Tier-1 FORBIDDEN_HOOK_STRINGS unchanged at 12 entries; gate GREEN.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 49f087fe40 |
feat(01-10): wave-1 task-2 — welcome page bundle + Vite entries + web_accessible_resources
Plan 01-10 Wave 1: welcome page bundle staged with canonical Plan 01-12
tokens.css @import + chrome.i18n for D-08 tagline (Plan 01-12 path-B
contract).
Files created:
- src/welcome/copy.ts (Russian non-tagline COPY map per D-03 Sober
voice; WELCOME_HERO_RU_FALLBACK + WELCOME_HERO_EN_FALLBACK exported
for the welcome.ts `|| <en-const>` fallback chain).
- src/welcome/welcome.html (lang='ru'; data-mokosh-key + data-mokosh-
i18n-key attribute conventions; SINGLE stylesheet link; D-02 Hero +
body + footer structure; 10 keyed attrs total; <title> populated
via populateCopy).
- src/welcome/welcome.css (FIRST LINE `@import '../shared/tokens.css';`;
ZERO hex literals in source; 65 var(--mks-*) refs; D-02 layout +
--mks-welcome-max-w=720px; --mks-rec madder for recording-related
accents per D-04 Loom palette).
- src/welcome/welcome.ts (vanilla DOM; populateCopy + populateI18n
filter-pipeline form per project rule "no `continue`"; no `as any`;
Logger from src/shared; document.readyState guard; no event
handlers per D-16-toolbar informational charter).
Files modified:
- vite.config.ts: rollupOptions.input gains `welcome:
'src/welcome/welcome.html'`; __VITE_DEV__ + __MOKOSH_UAT__ defines
untouched (Plan 01-12 Wave 5 baseline preserved verbatim).
- vite.test.config.ts: mirror entry in dist-test/; mergeConfig pattern
untouched.
- manifest.json: web_accessible_resources block added after
host_permissions, before background; storage permission preserved
in permissions array; default_locale='en' + __MSG_*__ placeholders
from Plan 01-12 Wave 3 preserved verbatim.
NO src/welcome/welcome-tokens.css file is created — Plan 01-12 must_have
#9 path-B contract: Plan 01-12 landed FIRST (
|
|||
| 89e1e09d60 |
test(01-10): wave-0 task-1 — RED onboarding tests (3 tests pin install/update/flag + storage-key)
Three tests in tests/background/onboarding.test.ts pinning the
Plan 01-10 D-17-onboarding contract:
Test A (RED): first install + empty storage opens exactly ONE welcome
tab whose URL contains 'src/welcome/welcome.html', sets
chrome.storage.local.set({'onboarding-completed':true,
'installed-at':<number>}), AND calls chrome.storage.local.get with
EXACT key 'onboarding-completed' (storage-schema cross-version-compat
pin; preserves I-02 lesson from prior draft).
Test B (vacuous-GREEN, becomes load-bearing post-Task-3): reason='update'
→ chrome.tabs.create NOT called.
Test C (vacuous-GREEN, becomes load-bearing post-Task-3): flag already
true → chrome.tabs.create NOT called.
Tests B and C pass vacuously until Task 3 lands openWelcomeIfFirstInstall;
they remain load-bearing AFTER Task 3 as no-tab-open guards for the
update/already-onboarded branches. Test A flips RED → GREEN at Task 3.
Stub scaffold inherits buildBgStub from onstartup-notification.test.ts;
extended with chrome.tabs.create + chrome.storage.local.{get,set} +
chrome.runtime.onInstalled._callbacks (addListener.mockImplementation
pattern to capture the SW's registered listener).
DEVIATION NOTE: plan's <verify> expected `3 failed` but only Test A
(positive contract) goes RED pre-Task-3; Tests B+C are negative-path
guards that pass trivially when the helper is absent. This is standard
TDD (positive test fails RED; negative tests stay GREEN through GREEN→
REFACTOR). No code change needed — Task 3's GREEN gate is "all 3 GREEN".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 7f58e0ae31 |
fix(01-10): revise plan per 01-12 + 01-14 baselines (vitest 98→147, UAT 15→21, FORBIDDEN 10→12, welcome.css @imports canonical tokens, welcomeHero keys read from chrome.i18n)
Surgical amendment to unexecuted Plan 01-10 absorbing the post-draft landing of Plan 01-12 (canonical src/shared/tokens.css + 16 i18n keys including welcomeHeroRu/welcomeHeroEn; 2026-05-20 operator brand-fit ack) and Plan 01-14 (vitest +2 + UAT +1 + FORBIDDEN_HOOK_STRINGS +2). Baseline shifts: - vitest 98 → 147 GREEN (post Plan 01-12 + 01-14); plan close target 150. - UAT 15 → 21 GREEN (A0-A14 + A18-A22 + A23); plan close target 24 (A0-A14 + A15-A17 + A18-A22 + A23). - FORBIDDEN_HOOK_STRINGS 10 → 12 (Plan 01-14: lastGetDisplayMediaConstraints + get-last-getDisplayMedia-constraints); Plan 01-10 introduces no new test-mode symbols; inventory unchanged at 12. Plan 01-12 must_have #9 path-B contract honored end-to-end (Plan 01-12 landed FIRST, so the welcome page adopts canonical assets directly): - welcome.css opens with `@import '../shared/tokens.css';` (NO placeholder welcome-tokens.css; removed from files_modified). - D-08 hero tagline elements use data-mokosh-i18n-key='welcomeHeroRu' + data-mokosh-i18n-key='welcomeHeroEn'; welcome.ts reads via chrome.i18n.getMessage with `|| <en-const>` fallback per Plan 01-12 fallback pattern. WELCOME_HERO_RU_FALLBACK + WELCOME_HERO_EN_FALLBACK constants exported from copy.ts for the degradation path. - copy.ts COPY map retains non-tagline keys only (page title + explainer lines + CTA + footer privacy; engineering placeholders per D-03). - A17 design-swap-readiness invariant extended with: - A17.5: welcome.css contains canonical @import directive OR inlined `--mks-rec:` evidence; - A17.6: bundled JS contains COPY[ OR chrome.i18n.getMessage('welcomeHero; - A17.7 NEW: getComputedStyle probe on var(--mks-rec) returns non-default value (canonical rgb(178, 84, 61) = #b2543d = --mks-madder-600 per Plan 01-12 Wave 4 D-04 Loom palette adoption). - depends_on extended to [01-09, 01-13, 01-14, 01-12]. Preserved verbatim: 5-task structure, A15/A16 contracts, D-02/D-08/D-09 references, threat model + STRIDE register, operator empirical checkpoint shape, Plan 01-12 default_locale='en' + __MSG_*__ + __VITE_DEV__ + __MOKOSH_UAT__ + src/shared/tokens.css. Validated: gsd-sdk frontmatter.validate + verify.plan-structure both PASS; task_count=5, all tasks complete with files/action/verify/done. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| 66e6f503a4 |
docs(01-12): state + roadmap + requirements — Plan 01-12 closure
Plan 01-12 closure documentation sync per the plan's Wave 7 Task 1 spec. Three docs land together as one atomic closure commit per the Plan 01-13 + 01-14 closure cadence convention. STATE.md changes: - status: verifying → executing (Plan 01-10 welcome tab still pending) - stopped_at: Plan 01-14 → Plan 01-12 closed via Wave 7 brand-fit ack 2026-05-20 'all good'; Plan 01-10 remains as final Phase 1 functional plan - last_updated + last_activity: 2026-05-19 → 2026-05-20 - progress.completed_plans: 12 → 13 (13 plans: 01-01..01-09 + 01-11 spike + 01-12 + 01-13 + 01-14; Plan 01-10 pending) - progress.percent: 86 → 93 - "Plan 01-13 closure" header annotated: brand/design ack subsequently closed via Plan 01-12 Wave 7 2026-05-20 - New "Plan 01-12 closure (2026-05-20)" section: 7-wave execution arc with all 10 commit hashes ( |
|||
| f319c7dc6e |
docs(01-12): summary — design integration landed (147/147 vitest, 21/21 UAT, brand-fit ack 2026-05-20)
Plan 01-12 closure SUMMARY landed at .planning/phases/01-stabilize-
video-pipeline/01-12-SUMMARY.md per the plan's <output> block + 01-13/
01-14 closure cadence. Mirrors the 01-13-SUMMARY frontmatter shape +
body sections (One-Liner / What Landed by Wave / Test Counts /
Deviations / Architectural Notes / Self-Check / Known Limitations /
Bridge to Phase 1 Closure).
Plan 01-12 design integration in one sentence: Lora self-hosted via
R2 designer substitution (Newsreader → Lora for Cyrillic coverage,
2026-05-19); src/shared/tokens.css canonical with 8 local @font-face
rules and zero remote URLs; 16 i18n keys across en + ru with parity;
branded Loom-mark icons replace Bug A placeholders; src/popup +
src/background migrated to chrome.i18n.getMessage with || <const>
fallback; UAT harness extended with A18-A22; pre-checkpoint bundle
gates established per feedback-pre-checkpoint-bundle-gates.md;
operator brand-fit ack received 2026-05-20 verbatim "all good".
Gate evidence (per Wave 7 pre-checkpoint
|
|||
| 865d394ae0 |
docs(01-12): wave-7 pre-checkpoint — log out-of-scope discovery (setimmediate polyfill new Function pre-existing)
Wave 7 pre-checkpoint bundle gates per feedback-pre-checkpoint-bundle-gates.md
revealed a pre-existing benign concern in the SW production bundle:
`vite-plugin-node-polyfills` (configured for Buffer in vite.config.ts)
bundles the upstream `setimmediate` package which contains a fallback
`new Function("" + I)` evaluated when setImmediate is called with a
non-function argument. Production source code does NOT call
setImmediate(string); the construct is dead at the runtime call-graph
level but Rollup conservatively preserves it (behind a runtime
typeof check, not a static dead branch).
Verified pre-existing across Phase 1 history via `git checkout main --
src/background/index.ts vite.config.ts && npm run build` — same
`new Function` count. Plan 01-12 made NO changes to the polyfill
configuration; this is logged for future tightening (Phase 5
hardening or a dedicated MV3 CSP audit plan), NOT for fix in this
plan per the deviation-rule SCOPE BOUNDARY.
All other pre-checkpoint bundle gates PASS:
- Tier-1 forbidden-strings: 13/13 GREEN (no new test-mode symbols)
- SW-bundle-import: 15/15 GREEN
- Node-globals (Buffer.*) in SW chunk: 0
- DOM-globals direct SW calls: none
- Manifest validation: PASS (__MSG_*__ + default_locale='en' +
16 i18n keys per locale; en+ru parity verified)
- Tokens.css MV3 CSP self-host: 0 googleapis / 0 https://fonts in dist/
- Icons rasterized: 8-bit RGBA at 406/784/1952 B
- vitest: 147/147 GREEN
- npm run test:uat: 21/21 GREEN (A1..A14 regression-free + A18..A22
new + A23 from 01-14)
- npx tsc --noEmit: clean
- npm run build + npm run build:test: clean
Surfacing Wave 7 operator brand-fit checkpoint to orchestrator next.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| b909c374cc |
feat(01-12): wave-6 task-1 — harness A18-A22 (font reachability + icon-distinct + manifest-i18n + Lora-resolved + welcome-tokens)
UAT harness extended with 5 new page-side assertions following the 01-13 Approach B pattern (page-side assertA* + host-side driveA* wrapper + harness.test.ts orchestrator entry): A18 — Lora WOFF2 reachable from harness page (font self-host MV3 CSP invariant). Walks document.styleSheets for the first @font-face rule referencing Lora, resolves the rebased asset URL (handles Vite's content-hashing), fetches, asserts byteLength >= 40_000 (subset Lora is ~49 KB) + WOFF2 signature 'wOF2'. 4 checks. A19 — icons rasterized from Loom mark (not Bug A placeholders). Fetches icon128.png, parses IHDR bytes 24-25 (bit-depth + color-type), asserts (8, 6) RGBA vs the placeholder (16, 2) RGB. 2 checks. A20 — manifest:name resolves via chrome i18n. Reads chrome.runtime.getManifest().name; asserts it matches EN extName 'Mokosh — Session Capture' OR RU 'Mokosh — Запись сессии' (robust to whatever locale Chrome uses); explicitly checks no __MSG_ placeholder leaks. 2 checks. A21 — --mks-font-display resolves to Lora stack. Creates transient .mks-display-1 probe div, reads getComputedStyle.fontFamily, asserts the stack starts with 'Lora' or '"Lora"' (accommodates both quoted + unquoted forms across Chrome versions); explicitly checks no Newsreader leak (R2 substitution complete). 2 checks. A22 — welcome page tokens.css adoption (CONDITIONAL on Plan 01-10). Skip-gate on missing welcome.html: catches both HTTP 404 AND network-layer fetch failure (Chrome extensions throw TypeError 'Failed to fetch' for non-web_accessible_resources paths). On reachable: extracts <link rel=stylesheet> hrefs, fetches each, asserts >= 3 var(--mks-*) usages OR tokens.css reference. 1 check. Companion changes: - tests/uat/extension-page-harness.html gains `<link rel="stylesheet" href="../../src/shared/tokens.css">` so A18 + A21 have the @font-face rules + .mks-display-1 class + CSS custom properties resolvable via document.styleSheets + getComputedStyle. Vite's crxjs plugin handles the asset path rebasing at build:test time. - tests/uat/lib/harness-page-driver.ts: driveA18..driveA22 wrappers following the established driveA8 pattern (page.evaluate → window. __mokoshHarness.assertXX). No new host-side fs/ffprobe primitives; all A18-A22 work is page-side. - tests/uat/harness.test.ts: orchestrator drivers list extended with A18-A22 between A14 and A23. FORBIDDEN_HOOK_STRINGS UNCHANGED at 12 entries post-Plan-01-14 (A18-A22 use production chrome.* + fetch + getComputedStyle exclusively; no new test-mode symbols). Verification (this commit): - npm run test:uat: 21/21 GREEN (was 16/16 post-01-14) - SKIP_BUILD=1 npm test: 147/147 GREEN - Tier-1 grep gate: 13/13 GREEN (no FORBIDDEN_HOOK_STRINGS growth) - npx tsc --noEmit: clean - npm run build + npm run build:test: both succeed The chain of A1..A14 + A18..A22 + A23 runs in ~95 seconds end-to-end under Puppeteer headless mode against the bundled Chrome at ~/.cache/puppeteer/chrome/linux-148.0.7778.167. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| e8d2881874 |
feat(01-12): wave-5 task-1 — welcome i18n migration (conditional on 01-10) + __VITE_DEV__ define + scripts/README.md
Plan 01-10 (welcome tab) has NOT yet landed at execute-plan time
(verified: ls src/welcome/welcome.html returns absent). Per Wave 5
branch 2B, src/welcome/* file modifications are DEFERRED — when Plan
01-10 lands, its executor will use src/shared/tokens.css directly
(skipping the placeholder welcome-tokens.css step entirely; the
canonical tokens.css is already import-ready from src/shared/).
Unconditional changes in this wave:
1. vite.config.ts gains __VITE_DEV__ define-token (RESEARCH §12 +
D-09 spirit-satisfaction). Defaults to false; activates iff env
var VITE_DEV=1 is set. Reserved for any future inline smoke-mode
check. Currently smoke.sh lives entirely outside Vite's input set
so the gate is a defensive no-op:
define: { __MOKOSH_UAT__: 'false', __VITE_DEV__: JSON.stringify(...) }
2. vite.test.config.ts inherits __VITE_DEV__ via mergeConfig (the
test config only overrides __MOKOSH_UAT__: 'true'; __VITE_DEV__
from base flows through untouched).
3. scripts/README.md (NEW, ~50 lines): documents the smoke-isolation
invariant — dev-only scripts in scripts/ are NOT bundled by
`npm run build`; the production dist/ contains zero smoke
artifacts (verified by RESEARCH §12 grep gate). Provides usage
example for VITE_DEV env override + cross-references RESEARCH §12
and brand-decisions-v1.md D-09. Index lists subset-fonts.sh,
rasterize-icons.sh, and smoke.sh (if present).
Note on Plan 01-10 deferral: when Plan 01-10 executes after this
plan closes, the welcome page src/welcome/welcome.css can either
@import '../shared/tokens.css' directly OR a thin welcome-tokens.css
re-export — both paths are supported by the canonical tokens.css
landed in Wave 1. Plan 01-10's executor must adopt chrome.i18n.getMessage
for any welcome copy strings using the 16-key matrix in _locales/
(welcomeHeroRu + welcomeHeroEn already defined; additional keys
added per Plan 01-10's own artifact list).
Verification:
- vitest baseline 147/147 GREEN (no change from Wave 4 close)
- npm run build clean (no warnings; __VITE_DEV__ propagates through
define static replacement)
- scripts/README.md exists with the smoke-isolation paragraph
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 468f16d7e7 |
feat(01-12): wave-4 task-1 — adopt tokens.css + chrome.i18n.getMessage in src/popup/ + src/background/ (loom palette + RU i18n + en fallback)
src/popup/style.css:
- Adds @import "../shared/tokens.css" at top
- All hex literals removed; every color reads from var(--mks-*) per
D-04 loom palette: --mks-surface body bg; --mks-rec/--mks-madder-700
for SAVE button (default/hover); --mks-amber-600 for saving;
--mks-moss-600 for done; --mks-error/--mks-success/--mks-warning for
status messages; --mks-fg-disabled for disabled button
- Font families read from --mks-font-ui (IBM Plex Sans stack)
- Spacing/radius/shadows all token-driven
src/popup/index.html:
- <span class="button-text"> emptied (populated by JS via i18n)
- <p class="info-text" data-mks-key="popupInfoText"> attribute-marked
for populateMksKeys() init-time population
- <title> kept as literal English (chrome doesn't substitute __MSG_*__
in HTML body per RESEARCH Pitfall 3)
src/popup/index.ts:
- New `i18n(key, fallback)` helper: chrome.i18n.getMessage with explicit
`|| <fallback>` for unit-test contexts without chrome.i18n stub
- New `populateMksKeys()` helper: walks [data-mks-key] elements at init
and sets each textContent from i18n
- updateUI() reads popupSaveCta/popupSaving/popupSaveDoneShort at each
state branch (idle/saving/done) with Russian fallbacks
- saveArchive() success branch reads popupSaveDone
- Empty-state path reads popupEmptyState
src/background/index.ts:
- BADGE_REC_COLOR: '#00C853' → '#b2543d' (= --mks-madder-600 per D-04;
RESEARCH §10 Open Question A7 default-action)
- BADGE_OFF_COLOR + BADGE_ERROR_COLOR retained as engineering choices
(no loom-palette token for material-red/amber-700 equivalents)
- BADGE_REC_TITLE/BADGE_OFF_TITLE/BADGE_ERROR_TITLE renamed to
..._FALLBACK and only referenced at the chrome.i18n.getMessage call
sites inside setBadgeState (i18nMessage('tooltipRecPrefix' etc.))
- New `i18nMessage(key, fallback)` helper mirroring popup's i18n()
- Recovery notification: title=i18nMessage('extName',...); message=
i18nMessage('notifRecovery',...)
- Startup notification: title=i18nMessage('extName',...); message=
i18nMessage('notifStartup',...)
- NOTIF_EXTNAME_FALLBACK/NOTIF_STARTUP_FALLBACK/NOTIF_RECOVERY_FALLBACK
module-level constants for the |||| chain (degrade gracefully in
test contexts without chrome.i18n stub)
- NO `await import(...)` added (MV3 SW dynamic-import constraint per
01-11-SUMMARY preserved)
Test-contract updates (3 tests; assertion-shape only — no semantic
regression):
- tests/background/badge-state-machine.test.ts: greenCalls→recColorCalls
regex updated from /^#00[Cc]853$/ to /^#b2543d$/i lockstep with
BADGE_REC_COLOR change; title-substring assertion widened to
/Recording|recording/i to cover both EN locale + fallback
- tests/background/onstartup-notification.test.ts: title equality
('Mokosh ready') replaced with /Mokosh/i substring assertion
(survives both the 'Mokosh' fallback + 'Mokosh — Session Capture'
resolved EN); message regex widened to /recording|recor|click/i
- tests/background/toolbar-action.test.ts: DocumentStub gains
querySelectorAll: () => [] so the new populateMksKeys() init path
doesn't throw under the popup's no-DOM unit-test environment
Verification:
- tests/build/tokens-adopted.test.ts: 4/4 GREEN (was 2 RED + 2 GREEN)
- tests/build/no-remote-fonts.test.ts: 4/4 GREEN after fresh build
(Vite emits the WOFF2 files as content-hashed dist/assets/*.woff2;
tokens.css references resolve through the asset pipeline; no
remote-font URLs anywhere in dist/)
- Full vitest sweep: 147/147 GREEN (was 145/147)
- npx tsc --noEmit: clean
- Tier-1 grep gate: 13/13 GREEN (no new test-mode symbols)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
|||
| 110cebc50d |
feat(01-12): wave-3 task-1 — manifest i18n (__MSG_*__ + default_locale='en') + _locales/{en,ru}/messages.json (16 keys; D-07 + D-08 baked in)
manifest.json migrated to chrome i18n placeholders: - name: 'AI Call Recorder' → '__MSG_extName__' - description: 'Запись сессий операторов для диагностики ошибок' → '__MSG_extDesc__' - default_locale: 'en' (new field per RESEARCH §11 + Pitfall 4 fallback chain) - action.default_title: '__MSG_tooltipOff__' (new field per Brief §02 string #1) _locales/en/messages.json + _locales/ru/messages.json each carry the same 16-key matrix per RESEARCH §10 + Brief §02 verbatim + D-07 user override + D-08 tagline: extName, extDesc, tooltipOff, tooltipRecPrefix, tooltipErr, popupSavePrompt, popupSaveCta, popupSaveDone, popupSaving, popupSaveDoneShort, popupEmptyState, popupInfoText, notifStartup, notifRecovery, welcomeHeroRu, welcomeHeroEn Canonical values (per brand-decisions-v1.md + RESEARCH §10 Brief §02): - EN extName = 'Mokosh — Session Capture' (D-07 user override of A) - EN extDesc = 'Thirty seconds ago, always at hand.' (D-08 tagline) - RU extName = 'Mokosh — Запись сессии' - RU extDesc = 'Тридцать секунд назад, всегда под рукой.' NB on key count: the artifact-table 12-key baseline excluded the three Wave-4 deltas (popupSaving, popupSaveDoneShort, popupEmptyState) which are introduced now to avoid a re-locale-parity flap when Wave 4 lands. popupInfoText is present in BOTH locales (the plan-checker flag 1 informational scope-slip is corrected here — see deviation block below). Plan success-criteria reading: ≥12 keys with Wave 4 additive deltas accounted for. Each key carries both `message` and `description` per Chrome i18n schema. EN descriptions are translator-facing; RU descriptions are plain-Russian context for native operators. npm run build emits: - dist/manifest.json carries the i18n shape verbatim (crxjs preserves __MSG_* placeholders; Chrome's manifest loader resolves them at install) - dist/_locales/en/messages.json (3.30 KB) - dist/_locales/ru/messages.json (3.81 KB) Verification: - tests/i18n/manifest-i18n.test.ts: 10/10 GREEN - tests/i18n/locale-parity.test.ts: 4/4 GREEN (en↔ru parity, non-empty messages, 16 keys each) - tests/build/no-remote-fonts.test.ts: 4/4 GREEN (post-build dist/ has zero remote font URLs) - Full vitest sweep: 145/147 GREEN (2 RED remaining are popup/style.css tokens-adopted cases — Wave 4 work) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
|||
| 7732a302cd |
feat(01-12): wave-2 task-1 — rasterize Loom mark to icons/icon{16,48,128}.png (overwrites Bug A placeholders)
scripts/rasterize-icons.sh (80 lines) is the one-off rasterization recipe. It reads src/shared/brand/mokosh-mark.svg and emits the three toolbar icon sizes via rsvg-convert, with assets-spec.md size FLOOR sanity checks embedded. Before: icons/icon16.png 574 B 16-bit/color RGB (Bug A placeholder) icons/icon48.png 1153 B 16-bit/color RGB (Bug A placeholder) icons/icon128.png 2615 B 16-bit/color RGB (Bug A placeholder) After: icons/icon16.png 406 B 8-bit/color RGBA (Loom mark — D-01) icons/icon48.png 784 B 8-bit/color RGBA (Loom mark — D-01) icons/icon128.png 1952 B 8-bit/color RGBA (Loom mark — D-01) All three clear assets-spec.md Chrome imageUtil silent-rejection floors (16≥200B, 48≥500B, 128≥1024B). Sizes match RESEARCH §3 verification. Per D-06 (Neutral mark + dynamic badge): single neutral mark per size; no per-state PNG sets. The dynamic chrome.action.setBadgeBackgroundColor in src/background/index.ts does state communication via colored badge. Per RESEARCH §3 anti-pattern: PNGs are COMMITTED as static artifacts; not regenerated at build time. scripts/rasterize-icons.sh is the documented re-run recipe (for when src/shared/brand/mokosh-mark.svg changes). Verification: - tests/build/icons-present.test.ts: 15/15 GREEN (existence, FLOOR, PNG signature, dimensions, color-type byte === 6 RGBA) - Bug A regression check: file content differs from prior placeholders (verified via git diff binary status); the placeholder fingerprint used by harness A19 (Wave 6) will distinguish on first 32 bytes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |