4 Commits

Author SHA1 Message Date
f3baa3a9a8 docs(04-06): re-plan iter-2 — real inline-SVG coverage + corrected 184/184 baseline
Re-plan-checker iter-1 (commit deb68df) flagged 2 BLOCKERs against the
iter-1 re-plan (b59bd24). Both fixed below; 3 advisories fixed; iter-1
verified-correct items preserved. EVERY test-infrastructure claim
re-verified against actual code this session before being written into
the plan — extension-page-harness.ts, harness-page-driver.ts, launch.ts,
harness.test.ts, vitest.config.ts, vite.config.ts, vite.test.config.ts,
full vitest run. No third false premise.

BLOCKER 1 — fictitious A17.8 live-DOM delegation. The iter-1 re-plan
claimed live-DOM injection + currentColor cascade was "delegated to
A17.8 in real Chrome". Verified false: assertA17 reaches welcome.html
only via fetch + DETACHED DOMParser string-parse; A17.8 is 100%
string-grep on jsText; the harness opens exactly two pages (victimPage
file://, harnessPage extension-page-harness.html — launch.ts:473-542);
populateMark() never runs in the harness. Fixed: a NEW host-side
harness assertion A35 is added (Task 3, modeled on driveA32/33/34) —
opens welcome.html via browser.newPage() + page.goto, lets
populateMark() run at DOMContentLoaded, then querySelector
'.welcome-hero__mark svg' + getComputedStyle().stroke proves the
LIVE currentColor cascade. welcome.html is a real web-accessible
extension page (builds to dist-test/src/welcome/welcome.html);
launchHarnessBrowser returns browser + extensionId so the new tab is
cheaply reachable. A35 is genuine new harness work (new driver +
drivers-array entry + banner-string update + import). A17.8 is
narrowed honestly to a source-bundling check only. No fictitious
delegation.

BLOCKER 2 — DEFECT 3 named the wrong failing test. The iter-1 re-plan
claimed strict-meta-json-validation.test.ts "fails on a clean tree" and
hard-coded a Task 2 gate "failure set EXACTLY == {strict-meta-json}".
Verified false this session: strict-meta-json in isolation = 8/8 GREEN;
a full vitest run reproduced 183 passed / 1 failed where the RED was
tests/background/webm-remux.test.ts (ffprobe -count_frames, timeout) —
NOT strict-meta-json. webm-remux in isolation = 5/5 GREEN. The "1
failed" is a non-deterministic ffprobe/parallel-vitest timeout flake —
exactly 04-CONTEXT #9 + #10. Fixed: baseline corrected to 184/184 GREEN
when the flake doesn't fire; target after Plan 04-06 = 188/188 GREEN
(+4 new tests). Task 2 gate now: 188/188 -> pass; 1 RED that passes on
isolation re-run -> tolerate as the known flake; reproducible RED or
2+ RED -> regression. No test filename hard-coded. deferred-items.md
mis-diagnosis corrected (Task 3 Edit 5).

Advisories (all fixed):
- A1: Task 3 action and verify both use SKIP_PROD_REBUILD=0 (intentional
  — harness must rebuild dist-test against Task 2 source edits).
- A2: requirements:[] kept (Phase 4 has no new REQ-* per ROADMAP);
  charter linkage via the `charter-d-p4-03` tag — non-blocking.
- A3: Task 1 acceptance criterion reworded to grep only import
  statements + the @vitest-environment directive, so the file's header
  prose explaining "no DOM-emulation library" doesn't trip it.

Preserved (iter-1 verified-correct):
- DEFECT 2 back-patch line classification (22/47/82/135/205 flip;
  40/89/109/110 leave).
- welcome.css drop from files_modified (bare class selector matches
  <svg>; color is inherited).
- Thesis: currentColor Option A + cursor verification-only +
  operator-empirical Task 4 + PNG icons untouched.
- FORBIDDEN_HOOK_STRINGS stays at 12 (no new __MOKOSH_UAT__ symbols).
- Frontmatter shape (phase:04 / slug / plan:06 / type:execute / wave:5
  / autonomous:false / depends_on:[01..05]). files_modified extended by
  3 new entries (harness-page-driver.ts + harness.test.ts + the
  corrected deferred-items.md).

Validation:
- gsd-sdk frontmatter.validate --schema plan: valid:true (all 8
  required fields present).
- gsd-sdk verify.plan-structure: valid:true, 0 errors, 0 warnings,
  4 tasks each with Files+Action+Verify+Done; Task 4 is
  checkpoint:human-verify per autonomous:false.

Orchestrator: run the re-plan checker again on this iter-2 commit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 17:24:17 +02:00
b59bd24354 docs(04-06): re-plan — correct false jsdom premise + stale back-patch lines + baseline
Full re-plan via /gsd-plan-phase ceremony. The prior 04-06-PLAN.md hit a
blocking checkpoint (plan-assumption defect). Three defects corrected;
thesis preserved (dark-logo currentColor Option A + cursor verification-only
+ A17.8 + operator-empirical Task 4).

DEFECT 1 — false jsdom premise: prior Task 1 assumed vitest configures a
jsdom environment. FALSE — vitest.config.ts:18 sets environment:'node' and
no DOM-emulation library is in node_modules. Resolution: STRATEGY (a) —
reframe tests/welcome/inline-svg.test.ts as a node-env source-contract test
(the canonical tests/i18n/manifest-i18n.test.ts file-read + string-assert
pattern); delegate live-DOM injection + currentColor cascade verification to
the A17.8 harness sub-check in real Chrome. Rejected (b) jsdom devDependency
(deviates from a twice-reaffirmed no-DOM-library stance) and (c) manual
DOMParser stub (fragile for SVG-namespace fidelity).

DEFECT 2 — stale back-patch line numbers: verified the genuine stale
'deferred to Phase 5' lines in 01-07-SUMMARY.md are 22/47/82/135/205;
historical commit-description lines 40/89/109/110 left unchanged.

DEFECT 3 — wrong vitest baseline: real baseline is 183 GREEN / 1 pre-existing
RED (strict-meta-json-validation.test.ts, logged to deferred-items.md, routed
to /gsd-debug). Test-count target reframed to 187 GREEN / 1 pre-existing RED.

revision_history block added. files_modified updated (welcome.css dropped —
the bare class selector matches <svg> identically; no CSS edit needed).
must_haves truths/artifacts/key_links updated to match the corrected plan.
frontmatter.validate + verify.plan-structure both green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 16:22:04 +02:00
76fffb35b9 fix(04): revise plans per checker iter-1 — 2 BLOCKERS + 2 WARNINGS fixed
Plan-checker iter-1 found 2 BLOCKERS + 4 WARNINGS. Iter-2 revision applies
surgical fixes to 4 plans + VALIDATION:

BLOCKER 1 (Plan 04-06 Task 4): wrong SW chunk glob `dist/assets/index*-bg.js`
matched zero files → Gates 2/3/4 silently PASSED. Replaced with canonical
`dist/assets/index.ts-*.js` (verified empirically: index.ts-8LkXuqac.js
on disk; RESEARCH Q1). Added glob-existence pre-gate `ls | wc -l >= 1`
to fail-loudly on future Vite chunk-naming shift.

BLOCKER 2 (Plan 04-04 Task 1): spike called non-existent
__mokoshHarness.dispatchSaveArchive (verified: harness surface is
assertA1..A31 + getManifestVersion only). Applied Option B — spike
+ driveA33 now dispatch SAVE_ARCHIVE via chrome.runtime.sendMessage
inline in page.evaluate (matches 9 existing assertA* methods:
A5/A11/A12/A13/A26/A28/A29/A30/A31). No new harness helper introduced.

WARNING 1 (Plan 04-02 Task 2): verify omitted UAT harness run. Added
`HEADLESS=1 SKIP_PROD_REBUILD=0 npm run test:uat 2>&1 | grep -c 'UAT
harness: 33/33 assertions passed'` to verify command (stdout format
confirmed at tests/uat/harness.test.ts:537).

WARNING 4 (Plan 04-07 Task 1): weak operator-ack gate (placeholder would
pass). Added `grep -cE 'approved|All good|APPROVED|approved by|operator
ack|all good' 04-VERIFICATION.md` to verify command. Covers both
canonical Plan 04-06 resume-signal ("approved" lowercase) AND prior-art
Plan 01-10 cycle-2 ack ("All good" titlecase).

WARNINGS 2 + 3 left as-is (truly advisory: scope-sanity threshold +
conservative dependency without file overlap).

04-VALIDATION.md per-task map rows updated for the 5 revised task entries
(04-02 T2 + 04-04 T1 + 04-04 T2 + 04-06 T4 + 04-07 T1). Frontmatter
adds `revised: 2026-05-21` + iter-2 notes block.

3 plans unchanged on disk (04-01, 04-03, 04-05).

Empirical confirmations used in revision:
- Harness surface: grep extension-page-harness.ts:4018 confirms
  __mokoshHarness.{assertA1..A31, getManifestVersion}; no dispatchSaveArchive
- SW chunk filename: ls dist/assets/ shows index.ts-8LkXuqac.js;
  no index*-bg.js matches
- SAVE_ARCHIVE precedent count: 9 existing assertA* methods use the
  chrome.runtime.sendMessage pattern
- UAT harness stdout format: harness.test.ts:537 emits canonical
  "UAT harness: N/N assertions passed"

Ready for plan-checker iter-3 re-verification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 10:00:07 +02:00
526ac78046 docs(04): create phase plan — 7 plans for Phase 4 hardening (audit P1 polish + flake stabilization + SW persistence + visual polish + closure)
Wave structure:
- W1 (parallel): 04-01 (Audit P1 polish #11/#14/#15 TDD) + 04-02 (build/CSP hygiene: setimmediate polyfill + dead-code + generate-icons.cjs)
- W2: 04-03 (A29 cs-injection-world rewrite; closes flake)
- W3: 04-04 (A33 SW state persistence; spike-first + CDP worker.close())
- W4: 04-05 (A34 fetch+XHR network_error; ROADMAP SC #2 + validates Plan 04-01 P1 #11 end-to-end)
- W5: 04-06 (dark-logo currentColor + cursor verification + 01-07-SUMMARY back-patch; operator empirical)
- W6: 04-07 (04-VERIFICATION.md aggregator + ROADMAP backfill + v1 close prep)

Honors locked decisions D-P4-01..05 (full Phase 4 + all 3 P1 polish + both visual items + alpha-independent + ROADMAP backfill).
Implements RESEARCH Q1 (setimmediate option a), Q2 (spike-first SW persistence), Q3 (A29 cs-injection-world), Finding 4 (cursor already shipped — verification only).
UI-SPEC dark-logo currentColor strategy with inline-SVG injection landed per UI-SPEC §"Implementation amendment".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 09:30:49 +02:00