docs(phase-02): complete phase execution — markers flipped to closed

Phase 2 closure tracking:
- STATE.md: status: ready_to_plan (Phase 3 prep awaits); Current Position
  flipped Phase 2 → COMPLETE; progress 14/18 → 18/18; percent 50% reflects
  2/4 phases complete
- ROADMAP.md: Phase 2 plan-count + status updated by gsd-sdk phase.complete
- REQUIREMENTS.md: 5 Phase 2 REQs flipped to Complete with Phase 2 closure
  notes:
    * REQ-screenshot-on-export — A28 archive layout verification
    * REQ-popup-ui — SAVE-only state machine verified by A24 + A25
    * REQ-archive-layout — A28 set-equality on jszip-parsed archive
    * REQ-meta-json-schema — D-P2-02 + D-P2-03 8-field shape verified by
      A26 + A27 + tests/build/strict-meta-json-validation.test.ts (8 tests)
      + tests/background/meta-json-urls-schema.test.ts (5 tests)
    * REQ-archive-export-latency — D-P2-01 Blob URL pipeline closes audit
      P0-6; A25 empirical <5s verification
- REQ-manifest-permissions: amended to reflect DEC-011 Amendment 1 (added
  `tabs` permission for Phase 2 D-P2-02 meta.urls feature) + corrected
  `tabCapture` → `desktopCapture` per D-01 historical evolution

Phase 2 outcome: 4/4 plans landed; UAT harness 24→29 GREEN; vitest 153→171
GREEN; bundle gates 6/6 PASS; verifier verdict PASSED (5/5; T5 override
per user delegation + saved memory feedback-trust-harness-over-manual-uat.md).

Audit closures: P0-6 (base64 data-URL cap → Blob URL pipeline) + P1 #10
(meta.url:string → urls:string[] schema).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 17:43:51 +02:00
parent a499db3ff2
commit a8b4fe567b
2 changed files with 56 additions and 23 deletions

View File

@@ -73,12 +73,16 @@ Requirements for the Phase 1 SPEC. Each maps to one phase in ROADMAP.md.
### Export
- [ ] **REQ-screenshot-on-export**: On "Save archive" click, the extension
- [x] **REQ-screenshot-on-export**: On "Save archive" click, the extension
captures a PNG screenshot of the active tab via
`chrome.tabs.captureVisibleTab()` and includes it as `screenshot.png` in the
archive. Binding: DEC-008.
COMPLETED Phase 2 (2026-05-20): `captureScreenshot()` in src/background/index.ts
invoked at SAVE entry; archive layout A28 set-equality verifies `screenshot.png`
presence in the zip (UAT harness 29/29 GREEN). Shipped in Phase 1 via Plan
01-09 SAVE flow; Phase 2 closure verifies layout contract.
- [ ] **REQ-popup-ui**: The extension exposes a minimal popup with a single
- [x] **REQ-popup-ui**: The extension exposes a minimal popup with a single
button labeled "Сохранить отчёт об ошибке" and a sub-label "Последние 30 сек
видео + 10 мин лога". Button state machine:
`idle → "Сохраняю..." → "Готово! ✓" → idle` (3 s revert). On click:
@@ -86,8 +90,13 @@ Requirements for the Phase 1 SPEC. Each maps to one phase in ROADMAP.md.
(3) request rrweb snapshots from Content Script, (4) assemble archive,
(5) trigger download, (6) display "Готово! ✓". Russian strings are part of
the contract and preserved verbatim.
COMPLETED Phase 2 (2026-05-20): SAVE-only popup state machine shipped end-to-end
via Plan 01-09 (state machine + Russian i18n strings via chrome.i18n.getMessage
with `|| <en-const>` fallback per Plan 01-12 pattern). Phase 2 verifies the
end-to-end SAVE → assembly → Blob URL download path via UAT harness A24 + A25
(Puppeteer-driven). 171/171 vitest GREEN.
- [ ] **REQ-archive-layout**: The archive is named
- [x] **REQ-archive-layout**: The archive is named
`session_report_YYYY-MM-DD_HH-MM-SS.zip` and contains exactly:
```
session_report_2025-05-15_14-32-10.zip
@@ -102,8 +111,11 @@ Requirements for the Phase 1 SPEC. Each maps to one phase in ROADMAP.md.
```
Binding: CON-archive-layout.
- SPEC §10 acceptance criteria: #7.
COMPLETED Phase 2 (2026-05-20): archive assembly shipped Phase 1 via Plan 01-08
(webm-remux + JSZip); Phase 2 verifies the 5-entry layout via UAT harness A28
set-equality (jszip-parsed; not order-dependent). 29/29 UAT GREEN.
- [ ] **REQ-meta-json-schema**: `meta.json` inside the archive conforms to the
- [x] **REQ-meta-json-schema**: `meta.json` inside the archive conforms to the
verbatim schema (D-P2-02 + D-P2-03 cutover; replaces the 7-field
`url: string` shape per audit P1 #10 amendment 2026-05-20):
```json
@@ -135,13 +147,26 @@ Requirements for the Phase 1 SPEC. Each maps to one phase in ROADMAP.md.
Binding: CON-meta-json-schema (this REQ-text supersedes the original
CON-meta-json-schema 7-field shape — the original is preserved in the
SPEC for provenance; this REQ documents the Phase 2 cutover).
COMPLETED Phase 2 (2026-05-20): SessionMetadata in src/shared/types.ts has the
8-field shape with `urls: string[]` + `schemaVersion: string` (no `url` field);
src/background/tab-url-tracker.ts (246 LOC) dedupes/filters tab URLs with first-seen
ordering; createArchive in src/background/index.ts emits all 8 fields with
`schemaVersion: '2'`. Verified by UAT harness A26 (8-field strict) + A27 (multi-tab
urls[] strict mode with tabs permission) + tests/build/strict-meta-json-validation.test.ts
(8 tests) + tests/background/meta-json-urls-schema.test.ts (5 tests).
### Manifest & Install
- [x] **REQ-manifest-permissions**: `manifest.json` declares exactly the
permission set in DEC-011 (`tabCapture`, `activeTab`, `downloads`, `scripting`,
`storage`; `host_permissions: ["<all_urls>"]`) and requests a user gesture
for `tabCapture` on first activation. Binding: DEC-011, CON-manifest-permissions.
permission set in DEC-011 + Amendment 1 (`desktopCapture` per D-01,
`activeTab`, `tabs` per Amendment 1, `downloads`, `scripting`, `storage`,
`offscreen`, `notifications`; `host_permissions: ["<all_urls>"]`) and requests
a user gesture for `desktopCapture` via getDisplayMedia on activation.
Binding: DEC-011 + Amendment 1 (added `tabs` per Phase 2 D-P2-02 meta.urls
requirement 2026-05-20), CON-manifest-permissions.
Phase 2 verification (2026-05-20): manifest.json permissions array intact incl.
`tabs` entry (tests/i18n/manifest-i18n.test.ts pin); permissions validation passes
in pre-checkpoint bundle gates (5/5 PASS).
COMPLETED Phase 1 Plan 01-12 (2026-05-20): manifest:name + :description +
:action.default_title migrated to `__MSG_*__` placeholders + default_locale='en';
manifest validation PASS in pre-checkpoint bundle gates (`tests/i18n/manifest-i18n.test.ts`
@@ -162,10 +187,17 @@ Requirements for the Phase 1 SPEC. Each maps to one phase in ROADMAP.md.
### Performance & Security
- [ ] **REQ-archive-export-latency**: From the moment the user clicks the
- [x] **REQ-archive-export-latency**: From the moment the user clicks the
export button, the ZIP archive lands in the "Downloads" folder in under
5 seconds. Binding: CON-archive-export-latency.
- SPEC §10 acceptance criteria: #6.
COMPLETED Phase 2 (2026-05-20): Plan 02-02 migrated download from base64 data:
URL (which exceeded Chrome's ~2 MB data-URL cap for real payloads) to
offscreen-minted Blob URL (`blob:chrome-extension://...`) via
`URL.createObjectURL` per D-P2-01 (closes audit P0-6). chrome.downloads.onChanged
listener revokes the URL on state.current==='complete' | 'interrupted'.
Verified empirically by UAT harness A25 — Puppeteer-driven real-Chrome <5s
SAVE→zip latency assertion (29/29 UAT GREEN).
- [ ] **REQ-password-confidentiality**: Passwords do not appear in rrweb
snapshots OR the user event log. Masking is enforced via rrweb v2