docs: bootstrap .planning/ via /gsd-ingest-docs (2 docs) /home/parf/projects/work/repremium/.planning/PROJECT.md /home/parf/projects/work/repremium/.planning/REQUIREMENTS.md /home/parf/projects/work/repremium/.planning/ROADMAP.md /home/parf/projects/work/repremium/.planning/STATE.md /home/parf/projects/work/repremium/.planning/intel /home/parf/projects/work/repremium/.planning/INGEST-CONFLICTS.md /home/parf/projects/work/repremium/.ingest-manifest.yaml
This commit is contained in:
161
.planning/intel/SYNTHESIS.md
Normal file
161
.planning/intel/SYNTHESIS.md
Normal file
@@ -0,0 +1,161 @@
|
||||
# Synthesis Summary
|
||||
|
||||
Entry point for `gsd-roadmapper` and other downstream consumers.
|
||||
|
||||
Mode: `new` (fresh bootstrap — no pre-existing `.planning/` files consulted).
|
||||
Precedence applied: `ADR > SPEC > PRD > DOC` (default).
|
||||
|
||||
---
|
||||
|
||||
## Doc counts by type
|
||||
|
||||
- ADRs: 0
|
||||
- PRDs: 0
|
||||
- SPECs: 1
|
||||
- DOCs: 1
|
||||
- UNKNOWN: 0
|
||||
- **Total docs synthesized:** 2
|
||||
|
||||
Sources:
|
||||
- `/home/parf/projects/work/repremium/Тз расширение фаза1.md` — SPEC (precedence 0)
|
||||
- `/home/parf/projects/work/repremium/README.md` — DOC (precedence 1)
|
||||
|
||||
Cross-ref graph: empty (`cross_refs: []` on both classifications). No cycle
|
||||
detection issues; depth 0 / cap 50.
|
||||
|
||||
---
|
||||
|
||||
## Decisions locked
|
||||
|
||||
- **Formally `locked: true` decisions:** 0
|
||||
- **SPEC-prescribed Accepted decisions (acting as ADR-equivalents for Phase 1
|
||||
per orchestrator instruction):** 12
|
||||
|
||||
Decision IDs (see `decisions.md`):
|
||||
|
||||
- DEC-001 — Chrome Extension Manifest V3
|
||||
- DEC-002 — Service Worker as background coordinator
|
||||
- DEC-003 — Tab video capture via `chrome.tabCapture` (vp9 / 400 kbps / 2000 ms)
|
||||
- DEC-004 — DOM capture via rrweb (with sensitive-input masking + 5 000-event cap)
|
||||
- DEC-005 — Archive packaging via JSZip
|
||||
- DEC-006 — File download via `chrome.downloads`
|
||||
- DEC-007 — In-memory buffers only (no Phase 1 persistence)
|
||||
- DEC-008 — Screenshot via `chrome.tabs.captureVisibleTab`
|
||||
- DEC-009 — WebM header chunk retained indefinitely
|
||||
- DEC-010 — Service Worker keepalive via `chrome.alarms` (20 s cadence)
|
||||
- DEC-011 — Manifest permissions set
|
||||
- DEC-012 — Vite + crxjs + TypeScript build toolchain (DOC-level)
|
||||
|
||||
All 12 are `Accepted` / `locked: false`. None of them are formally LOCKED ADRs,
|
||||
so any future ADR can revise them; today they are the authoritative baseline.
|
||||
|
||||
Source: `/home/parf/projects/work/repremium/.planning/intel/decisions.md`
|
||||
|
||||
---
|
||||
|
||||
## Requirements extracted
|
||||
|
||||
- **Count:** 11 functional requirements + 1 verbatim Phase 1 acceptance-criteria
|
||||
list (cross-referenced from the REQs).
|
||||
|
||||
Requirement IDs (see `requirements.md`):
|
||||
|
||||
- REQ-video-ring-buffer
|
||||
- REQ-rrweb-dom-buffer
|
||||
- REQ-user-event-log
|
||||
- REQ-screenshot-on-export
|
||||
- REQ-popup-ui
|
||||
- REQ-archive-layout
|
||||
- REQ-meta-json-schema
|
||||
- REQ-manifest-permissions
|
||||
- REQ-archive-export-latency
|
||||
- REQ-password-confidentiality
|
||||
- REQ-install-clean
|
||||
|
||||
Source: `/home/parf/projects/work/repremium/.planning/intel/requirements.md`
|
||||
|
||||
---
|
||||
|
||||
## Constraints
|
||||
|
||||
- **Count:** 15 constraint entries.
|
||||
- **Type breakdown:**
|
||||
- `nfr`: 7 (CON-ram-ceiling, CON-archive-export-latency, CON-video-window,
|
||||
CON-rrweb-window, CON-event-log-window, CON-sensitive-data-masking,
|
||||
CON-buffer-storage, CON-no-server-upload) — note: two of these
|
||||
(CON-sensitive-data-masking, CON-buffer-storage, CON-no-server-upload) are
|
||||
cross-categorized; primary type listed
|
||||
- `protocol`: 3 (CON-video-codec, CON-webm-header-retention, plus protocol
|
||||
aspects of CON-video-window / CON-rrweb-window / CON-event-log-window)
|
||||
- `api-contract`: 3 (CON-tab-capture-binding, CON-service-worker-keepalive,
|
||||
CON-manifest-permissions)
|
||||
- `schema`: 3 (CON-archive-layout, CON-meta-json-schema, CON-event-log-schema)
|
||||
|
||||
Constraint IDs (see `constraints.md`):
|
||||
|
||||
- CON-ram-ceiling (50 MB background ceiling)
|
||||
- CON-archive-export-latency (< 5 s)
|
||||
- CON-video-window (30 s)
|
||||
- CON-rrweb-window (10 min / 5 000 events)
|
||||
- CON-event-log-window (10 min)
|
||||
- CON-video-codec (vp9 / 400 kbps / 2 s chunks)
|
||||
- CON-webm-header-retention
|
||||
- CON-tab-capture-binding
|
||||
- CON-service-worker-keepalive (20 s alarm)
|
||||
- CON-manifest-permissions (verbatim manifest fragment)
|
||||
- CON-sensitive-data-masking
|
||||
- CON-archive-layout (verbatim ZIP layout)
|
||||
- CON-meta-json-schema (verbatim)
|
||||
- CON-event-log-schema (verbatim)
|
||||
- CON-buffer-storage (in-memory only)
|
||||
- CON-no-server-upload (Phase 1 scope boundary)
|
||||
|
||||
Source: `/home/parf/projects/work/repremium/.planning/intel/constraints.md`
|
||||
|
||||
---
|
||||
|
||||
## Context topics
|
||||
|
||||
- **Count:** 6 topics.
|
||||
|
||||
Topics (see `context.md`):
|
||||
|
||||
- Project goal (SPEC §1)
|
||||
- Phase 1 scope (what is in)
|
||||
- Phase 1 non-goals (Phase 2 work — server upload, AI diagnostics, ticketing,
|
||||
dashboard, audio)
|
||||
- Developer workflow (DOC-only — install, build, Chrome load, debug, layout)
|
||||
- User-facing flow
|
||||
- Licensing and support (MIT)
|
||||
- Russian-source provenance (UI strings preserved verbatim)
|
||||
|
||||
Source: `/home/parf/projects/work/repremium/.planning/intel/context.md`
|
||||
|
||||
---
|
||||
|
||||
## Conflicts
|
||||
|
||||
- **Blockers:** 0
|
||||
- **Competing variants:** 0
|
||||
- **Auto-resolved (INFO):** 1
|
||||
- SPEC > DOC on extension RAM footprint — SPEC's 50 MB ceiling wins; README's
|
||||
5–10 MB figure preserved as informational target alongside
|
||||
CON-ram-ceiling.
|
||||
|
||||
Full report: `/home/parf/projects/work/repremium/.planning/INGEST-CONFLICTS.md`
|
||||
|
||||
---
|
||||
|
||||
## Pointers
|
||||
|
||||
- Decisions: `/home/parf/projects/work/repremium/.planning/intel/decisions.md`
|
||||
- Requirements: `/home/parf/projects/work/repremium/.planning/intel/requirements.md`
|
||||
- Constraints: `/home/parf/projects/work/repremium/.planning/intel/constraints.md`
|
||||
- Context: `/home/parf/projects/work/repremium/.planning/intel/context.md`
|
||||
- Conflicts report: `/home/parf/projects/work/repremium/.planning/INGEST-CONFLICTS.md`
|
||||
- Classifications consumed:
|
||||
- `/home/parf/projects/work/repremium/.planning/intel/classifications/tz-rasshirenie-faza1-3a5e9b41.json`
|
||||
- `/home/parf/projects/work/repremium/.planning/intel/classifications/README-a1b2c3d4.json`
|
||||
|
||||
Status for routing: **READY** — no blockers, no awaiting-user variants, safe to
|
||||
hand off to `gsd-roadmapper`.
|
||||
28
.planning/intel/classifications/README-a1b2c3d4.json
Normal file
28
.planning/intel/classifications/README-a1b2c3d4.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"source_path": "/home/parf/projects/work/repremium/README.md",
|
||||
"type": "DOC",
|
||||
"confidence": "high",
|
||||
"manifest_override": true,
|
||||
"title": "AI Call Recorder - Браузерное расширение для записи сессий операторов",
|
||||
"summary": "Developer-facing README covering installation, usage, technical stack, and Phase 1 acceptance criteria for a Chrome extension that records operator sessions locally and exports a ZIP archive.",
|
||||
"scope": [
|
||||
"Chrome Extension Manifest V3",
|
||||
"Service Worker",
|
||||
"Content Script",
|
||||
"Popup UI",
|
||||
"chrome.tabCapture video buffer",
|
||||
"rrweb DOM capture",
|
||||
"user event logging",
|
||||
"JSZip archive packaging",
|
||||
"chrome.downloads",
|
||||
"Vite + crxjs + TypeScript build",
|
||||
"ring buffer (video 30s, rrweb 10min, events 10min)",
|
||||
"sensitive data masking",
|
||||
"Phase 1 acceptance criteria",
|
||||
"memory consumption targets"
|
||||
],
|
||||
"cross_refs": [],
|
||||
"locked": false,
|
||||
"precedence": 1,
|
||||
"notes": "Manifest declared type=DOC and precedence=1, treated as authoritative. POTENTIAL CONFLICT WITH SPEC: line 106 states expected memory '~5-10 МБ in background mode', while line 118 acceptance criterion states ceiling 'не превышает 50 МБ' — synthesizer should reconcile against the SPEC's 50 МБ ceiling. INTERNAL INCONSISTENCY: README presents both an expected-value (5-10 МБ) and a ceiling (50 МБ) for the same memory metric without explicit relationship. Other claims to cross-check against SPEC: video buffer = 30s, rrweb buffer = 10min/5000 events, user event buffer = 10min, archive delivery < 5s, sensitive data masking via input[type=password] and data-sensitive='true'."
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"source_path": "/home/parf/projects/work/repremium/Тз расширение фаза1.md",
|
||||
"type": "SPEC",
|
||||
"confidence": "high",
|
||||
"manifest_override": true,
|
||||
"title": "Техническое задание: Браузерное расширение для записи сессий операторов — Фаза 1 (Локальная запись + экспорт архива)",
|
||||
"summary": "Technical specification for Phase 1 of a Chrome Manifest V3 browser extension that continuously records operator session video, DOM snapshots, and event logs locally and exports them as a ZIP archive on demand.",
|
||||
"scope": [
|
||||
"Chrome Extension Manifest V3",
|
||||
"Service Worker / Background Script",
|
||||
"Tab video capture (chrome.tabCapture)",
|
||||
"DOM recording via rrweb",
|
||||
"User event logging (Content Script)",
|
||||
"ZIP archive packaging (JSZip)",
|
||||
"File download via chrome.downloads",
|
||||
"Popup UI for archive export",
|
||||
"Screenshot capture (chrome.tabs.captureVisibleTab)",
|
||||
"Ring buffer video (last 30 seconds)",
|
||||
"DOM/event buffer (last 10 minutes)",
|
||||
"Sensitive data masking (passwords, data-sensitive)",
|
||||
"Manifest permissions configuration",
|
||||
"Phase 1 acceptance criteria"
|
||||
],
|
||||
"cross_refs": [],
|
||||
"locked": false,
|
||||
"precedence": 0,
|
||||
"notes": "Manifest-declared SPEC; document contains explicit technical contracts (codec/bitrate, API surface, manifest permissions, archive layout, meta.json schema, event log JSON schema), engineering constraints (WebM header retention, Service Worker keepalive, rrweb buffer cap of 5000 events, 50MB RAM ceiling), and Phase 1 acceptance criteria. Explicit Phase 1 vs Phase 2 scope boundary documented in section 9. Russian-language source; scope translated to English while preserving technical identifiers."
|
||||
}
|
||||
204
.planning/intel/constraints.md
Normal file
204
.planning/intel/constraints.md
Normal file
@@ -0,0 +1,204 @@
|
||||
# Constraints (synthesized from SPEC)
|
||||
|
||||
All constraints below are sourced from `Тз расширение фаза1.md` (the SPEC,
|
||||
precedence 0). The DOC (`README.md`, precedence 1) is a confirming source where
|
||||
noted; where it diverges, the SPEC takes precedence per the
|
||||
`ADR > SPEC > PRD > DOC` rule.
|
||||
|
||||
Type taxonomy:
|
||||
- `nfr` — non-functional requirement (performance, memory, latency, security)
|
||||
- `protocol` — wire/file format or sequence contract
|
||||
- `schema` — data structure contract
|
||||
- `api-contract` — external API binding (Chrome extension APIs)
|
||||
|
||||
---
|
||||
|
||||
## CON-ram-ceiling
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §10 (acceptance criterion 9)
|
||||
- Type: nfr
|
||||
- Constraint: The extension's RAM footprint MUST NOT exceed **50 MB** while
|
||||
running in the background.
|
||||
- Component-level expected breakdown (SPEC §4, informative, not binding):
|
||||
- Video ring buffer: ~1.5–2 MB steady
|
||||
- rrweb buffer: ~1–3 MB
|
||||
- Event log: ~100–300 KB
|
||||
- Total steady-state expected component sum: ~2.6–5.3 MB
|
||||
- DOC confirming source: `README.md` §"Критерии приёмки Фазы 1" — restates the
|
||||
50 MB ceiling identically.
|
||||
- DOC informational target: `README.md` §"Память" reports an expected
|
||||
steady-state of ~5–10 MB. This is a non-binding **estimate**, not a
|
||||
contradicting requirement; the binding ceiling remains 50 MB. See
|
||||
`INGEST-CONFLICTS.md` for the auto-resolved INFO entry.
|
||||
|
||||
---
|
||||
|
||||
## CON-archive-export-latency
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §10 (acceptance criterion 6)
|
||||
- Type: nfr
|
||||
- Constraint: From click to file landing in the Downloads folder MUST be
|
||||
**< 5 seconds**.
|
||||
- DOC confirming source: `README.md` §"Критерии приёмки Фазы 1".
|
||||
|
||||
---
|
||||
|
||||
## CON-video-window
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.1
|
||||
- Type: nfr / protocol
|
||||
- Constraint: The video ring buffer MUST hold **exactly the most recent 30
|
||||
seconds** of footage; older chunks are evicted after each new chunk arrives.
|
||||
- Exception (DEC-009): the first chunk (WebM header) is exempt from eviction.
|
||||
|
||||
---
|
||||
|
||||
## CON-rrweb-window
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.2, §8
|
||||
- Type: nfr / protocol
|
||||
- Constraint: rrweb events MUST be retained for **at most 10 minutes** AND **at
|
||||
most 5 000 events**, whichever is tighter. Eviction sweep runs every 60 s on
|
||||
the time dimension; the 5 000-event cap is enforced on insert (oldest first
|
||||
out).
|
||||
|
||||
---
|
||||
|
||||
## CON-event-log-window
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.3
|
||||
- Type: nfr / protocol
|
||||
- Constraint: The user event log MUST be retained for **at most 10 minutes**.
|
||||
|
||||
---
|
||||
|
||||
## CON-video-codec
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.1
|
||||
- Type: protocol
|
||||
- Constraint: Video chunks MUST be encoded as `video/webm; codecs=vp9` at a
|
||||
target bitrate of `400 000 bps` (~3 MB/min raw). Chunk cadence (MediaRecorder
|
||||
timeslice) is `2000 ms`.
|
||||
|
||||
---
|
||||
|
||||
## CON-webm-header-retention
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.1, §8
|
||||
- Type: protocol
|
||||
- Constraint: The first MediaRecorder chunk (WebM container header) MUST be
|
||||
retained in the buffer indefinitely; the assembled `last_30sec.webm` MUST
|
||||
remain playable in a browser.
|
||||
|
||||
---
|
||||
|
||||
## CON-tab-capture-binding
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §8
|
||||
- Type: api-contract
|
||||
- Constraint: `chrome.tabCapture` operates only on the active tab. On tab
|
||||
activation change, the recorder MUST re-attach to the new active tab. First
|
||||
invocation requires a user gesture.
|
||||
|
||||
---
|
||||
|
||||
## CON-service-worker-keepalive
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §8
|
||||
- Type: api-contract
|
||||
- Constraint: MV3 Service Workers unload after ~30 s of inactivity. The
|
||||
extension MUST keep the worker alive via a `chrome.alarms` alarm firing every
|
||||
**20 seconds**.
|
||||
|
||||
---
|
||||
|
||||
## CON-manifest-permissions
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §7
|
||||
- Type: api-contract / schema
|
||||
- Constraint: `manifest.json` MUST declare exactly:
|
||||
```json
|
||||
{
|
||||
"permissions": [
|
||||
"tabCapture",
|
||||
"activeTab",
|
||||
"downloads",
|
||||
"scripting",
|
||||
"storage"
|
||||
],
|
||||
"host_permissions": [
|
||||
"<all_urls>"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## CON-sensitive-data-masking
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.2, §8
|
||||
- Type: nfr (security / privacy)
|
||||
- Constraint: Sensitive input fields MUST be masked in both rrweb snapshots and
|
||||
the event log. Specifically:
|
||||
- `input[type=password]` — value NEVER recorded; element MUST be masked in
|
||||
rrweb via `maskInputSelector`.
|
||||
- Any element with `data-sensitive="true"` — masked in rrweb via
|
||||
`maskInputSelector`.
|
||||
- The event logger MUST filter `input` events to drop password field values.
|
||||
|
||||
---
|
||||
|
||||
## CON-archive-layout
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §6
|
||||
- Type: schema (file layout)
|
||||
- Constraint: The exported ZIP MUST follow the layout in REQ-archive-layout
|
||||
(verbatim, four top-level entries: `video/`, `rrweb/`, `logs/`,
|
||||
`screenshot.png`, `meta.json`). Filename pattern:
|
||||
`session_report_YYYY-MM-DD_HH-MM-SS.zip`.
|
||||
|
||||
---
|
||||
|
||||
## CON-meta-json-schema
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §6
|
||||
- Type: schema
|
||||
- Constraint: `meta.json` MUST conform to the verbatim schema in
|
||||
REQ-meta-json-schema. All listed fields are required.
|
||||
|
||||
---
|
||||
|
||||
## CON-event-log-schema
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.3
|
||||
- Type: schema
|
||||
- Constraint: Each entry in `events.json` MUST conform to:
|
||||
```json
|
||||
{
|
||||
"timestamp": <epoch_ms>,
|
||||
"type": "click | input | navigation | error | network",
|
||||
"target": "<css_selector>",
|
||||
"value": "<value_or_masked>",
|
||||
"url": "<page_url>",
|
||||
"meta": {}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## CON-buffer-storage
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2
|
||||
- Type: nfr
|
||||
- Constraint: All Phase 1 buffers MUST live in memory only (Service Worker for
|
||||
video, Content Script for rrweb + event log). `chrome.storage` is permitted
|
||||
but MUST NOT be used to persist the rolling buffers.
|
||||
|
||||
---
|
||||
|
||||
## CON-no-server-upload
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §9
|
||||
- Type: nfr (scope boundary)
|
||||
- Constraint: Phase 1 MUST NOT transmit any captured data to a remote server.
|
||||
All export is local-only via `chrome.downloads`.
|
||||
126
.planning/intel/context.md
Normal file
126
.planning/intel/context.md
Normal file
@@ -0,0 +1,126 @@
|
||||
# Context (synthesized from SPEC §1, §9 and DOC)
|
||||
|
||||
Background, stakeholders, scope boundaries, and developer-facing operational
|
||||
context. Functional requirements are in `requirements.md`; technical decisions
|
||||
are in `decisions.md`; non-functional constraints are in `constraints.md`.
|
||||
|
||||
---
|
||||
|
||||
## Topic: Project goal
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §1 (Контекст и цель)
|
||||
- Notes:
|
||||
- Operators work inside a browser and periodically make mistakes that are
|
||||
hard to diagnose after the fact.
|
||||
- The goal of Phase 1 is to silently and continuously record an operator's
|
||||
session so that, on a button press, a self-contained archive of the
|
||||
session can be exported to the "Downloads" folder for handoff to support.
|
||||
- Phase 1 is local-only; no server, no AI, no auto-ticketing.
|
||||
|
||||
---
|
||||
|
||||
## Topic: Phase 1 scope (what is in)
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4, §5, §6, §7, §10; `README.md` §"Особенности"
|
||||
- Notes:
|
||||
- Continuous in-memory recording of:
|
||||
- Last 30 s of active-tab video (`chrome.tabCapture` + MediaRecorder)
|
||||
- Last 10 min of DOM events via rrweb (cap 5 000 events)
|
||||
- Last 10 min of user/runtime events (click, input, navigation, js_error,
|
||||
network_error)
|
||||
- One-shot screenshot at export time (`chrome.tabs.captureVisibleTab`).
|
||||
- Local ZIP packaging via JSZip and delivery via `chrome.downloads`.
|
||||
- Sensitive-data masking for passwords and `[data-sensitive="true"]` fields.
|
||||
- Single-button popup UI with idle / saving / done state machine.
|
||||
|
||||
---
|
||||
|
||||
## Topic: Phase 1 non-goals (Phase 2 work)
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §9 (Что НЕ входит в Фазу 1)
|
||||
- Notes — explicitly excluded from Phase 1 and reserved for Phase 2:
|
||||
- Sending data to a server
|
||||
- AI-driven diagnostics
|
||||
- Automatic ticket creation
|
||||
- Analytics dashboard
|
||||
- Audio recording
|
||||
|
||||
---
|
||||
|
||||
## Topic: Developer workflow (install, build, debug)
|
||||
|
||||
- Source: `README.md` §"Установка и запуск", §"Отладка", §"Структура проекта"
|
||||
- Provenance: This topic is DOC-only — the SPEC does not specify a build
|
||||
toolchain. Per precedence `SPEC > DOC`, any future SPEC/ADR that prescribes a
|
||||
different toolchain auto-overrides what is recorded here.
|
||||
- Notes:
|
||||
- **Install deps:** `npm install`
|
||||
- **Dev build with HMR:** `npm run dev`
|
||||
- **Prod build:** `npm run build`
|
||||
- **Load in Chrome:**
|
||||
1. `npm run build`
|
||||
2. Open `chrome://extensions/`
|
||||
3. Enable Developer mode
|
||||
4. "Load unpacked"
|
||||
5. Select the `dist/` folder
|
||||
- **Debugging entry points:**
|
||||
- Service Worker: Chrome DevTools → Extensions → Service Worker → Console
|
||||
- Content Script: Chrome DevTools on the page → Console
|
||||
- Popup: right-click popup → "Inspect"
|
||||
- **Project layout (DOC-described, may be stale relative to actual repo):**
|
||||
```
|
||||
ai-call-extension/
|
||||
├── src/
|
||||
│ ├── background/ # Service Worker
|
||||
│ │ └── index.ts
|
||||
│ ├── content/ # Content Script
|
||||
│ │ └── index.ts
|
||||
│ ├── popup/ # Popup UI
|
||||
│ │ ├── index.html
|
||||
│ │ ├── index.ts
|
||||
│ │ └── style.css
|
||||
│ └── shared/ # Common types + utilities
|
||||
│ ├── types.ts
|
||||
│ └── logger.ts
|
||||
├── icons/
|
||||
├── dist/
|
||||
├── manifest.json
|
||||
├── vite.config.ts
|
||||
├── tsconfig.json
|
||||
└── package.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Topic: User-facing flow
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §5; `README.md` §"Использование"
|
||||
- Notes:
|
||||
1. First popup open requests screen-recording permission (mandatory).
|
||||
2. Recording starts automatically once granted.
|
||||
3. To file an error report:
|
||||
- Click the extension icon.
|
||||
- Click "Сохранить отчёт об ошибке".
|
||||
- Archive lands in the user's "Downloads" folder automatically.
|
||||
4. Button state cycle: `idle` → "Сохраняю..." → "Готово! ✓" → `idle`
|
||||
(3 s revert).
|
||||
|
||||
---
|
||||
|
||||
## Topic: Licensing and support
|
||||
|
||||
- Source: `README.md` §"Лицензия", §"Контакты"
|
||||
- Notes:
|
||||
- License: **MIT**
|
||||
- Support contact: addressed to "support" (no concrete channel listed in
|
||||
DOC).
|
||||
|
||||
---
|
||||
|
||||
## Topic: Russian-source provenance
|
||||
|
||||
- Source: both documents (`Тз расширение фаза1.md`, `README.md`)
|
||||
- Notes: Both source documents are authored in Russian. UI strings ("Сохранить
|
||||
отчёт об ошибке", "Последние 30 сек видео + 10 мин лога", "Сохраняю...",
|
||||
"Готово! ✓") are part of the user-facing contract and MUST be preserved
|
||||
verbatim. Section identifiers and technical names use Latin script.
|
||||
180
.planning/intel/decisions.md
Normal file
180
.planning/intel/decisions.md
Normal file
@@ -0,0 +1,180 @@
|
||||
# Architectural Decisions (synthesized from SPEC)
|
||||
|
||||
The SPEC `Тз расширение фаза1.md` does not formally label itself as ADR-set, but
|
||||
sections 2 ("Стек"), 7 ("Разрешения в manifest.json"), and 8 ("Важные
|
||||
ограничения и решения") encode binding technical choices that act as
|
||||
architectural decisions for Phase 1. Each decision below is reproduced from the
|
||||
SPEC verbatim where possible and tagged with its origin.
|
||||
|
||||
Status legend (synthesized, since SPEC has no formal ADR status field):
|
||||
- `Accepted` — SPEC §2/§7/§8 prescribed, no contradicting source
|
||||
- `locked: false` everywhere — SPEC is `locked: false` in classification, so
|
||||
these decisions can still be revised by a future ADR; today they are the
|
||||
authoritative baseline.
|
||||
|
||||
---
|
||||
|
||||
## DEC-001: Chrome Extension Manifest V3
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2 (Стек), §7 (Разрешения)
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Extension platform / packaging
|
||||
- Decision: The extension MUST be implemented as a Chrome Extension targeting
|
||||
Manifest V3 (Service Worker background, no persistent background page).
|
||||
- Rationale (from SPEC): Required for modern Chrome compatibility; implied by
|
||||
every API used (`chrome.tabCapture`, `chrome.downloads`, `chrome.tabs`,
|
||||
`chrome.alarms`).
|
||||
- Confirming source: `README.md` §"Технический стек" — "Chrome Extension,
|
||||
Manifest V3".
|
||||
|
||||
---
|
||||
|
||||
## DEC-002: Service Worker as Background Coordinator
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2, §3 (Структура расширения), §8
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Background execution model
|
||||
- Decision: Background logic runs in a Manifest V3 Service Worker
|
||||
(`background/service-worker.js`) that coordinates the video buffer and
|
||||
archive packaging.
|
||||
- Constraint binding: Service Worker is unloaded after ~30 s idle; keepalive
|
||||
MUST be maintained via `chrome.alarms` firing every 20 seconds (SPEC §8).
|
||||
- Confirming source: `README.md` §"Технический стек".
|
||||
|
||||
---
|
||||
|
||||
## DEC-003: Tab Video Capture via `chrome.tabCapture`
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2, §4.1, §7
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Video acquisition
|
||||
- Decision: Active-tab video is captured via `chrome.tabCapture.capture()`.
|
||||
- Codec/bitrate binding: `video/webm; codecs=vp9` at `400 000 bps`.
|
||||
- `MediaRecorder` chunk cadence: 2000 ms.
|
||||
- Activation constraint: `tabCapture` is tied to the active tab and requires a
|
||||
user gesture on first invocation; on tab switch the capture re-attaches.
|
||||
- Confirming source: `README.md` §"Технический стек".
|
||||
|
||||
---
|
||||
|
||||
## DEC-004: DOM Capture via rrweb
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2, §4.2
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: DOM recording
|
||||
- Decision: DOM events are captured via the `rrweb` npm library
|
||||
(`rrweb.record()`), running in the Content Script, with events forwarded to
|
||||
the Service Worker on archive-export request.
|
||||
- Sensitive-data binding: rrweb is configured with `maskInputSelector` to mask
|
||||
`input[type=password]` and `[data-sensitive="true"]`.
|
||||
- Buffer cap binding: 5 000 rrweb events maximum; oldest dropped on overflow
|
||||
(SPEC §8).
|
||||
- Confirming source: `README.md` §"Технический стек", §"Особенности".
|
||||
|
||||
---
|
||||
|
||||
## DEC-005: Archive Packaging via JSZip
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2, §3, §6
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Archive assembly
|
||||
- Decision: ZIP packaging uses the `jszip` npm library bundled as
|
||||
`libs/jszip.min.js` (or the Vite-bundled equivalent).
|
||||
- Archive layout binding: see REQ-archive-layout in `requirements.md`.
|
||||
- Confirming source: `README.md` §"Технический стек".
|
||||
|
||||
---
|
||||
|
||||
## DEC-006: File Download via `chrome.downloads`
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2, §5, §7
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: File delivery
|
||||
- Decision: The assembled ZIP is delivered to the user's "Downloads" folder via
|
||||
`chrome.downloads.download()`. No server upload in Phase 1.
|
||||
- Confirming source: `README.md` §"Технический стек".
|
||||
|
||||
---
|
||||
|
||||
## DEC-007: In-Memory Buffers in Service Worker + Content Script
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §2, §4.1, §4.2, §4.3
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Storage strategy
|
||||
- Decision: All recorded data (video chunks, rrweb events, user-event log) is
|
||||
held in memory only — video chunks in the Service Worker, rrweb events and
|
||||
user-event log in the Content Script. No `chrome.storage` / IndexedDB
|
||||
persistence for the rolling buffers in Phase 1.
|
||||
- Confirming source: `README.md` §"Технический стек" — "In-memory (Service
|
||||
Worker + Content Script)".
|
||||
|
||||
---
|
||||
|
||||
## DEC-008: Screenshot via `chrome.tabs.captureVisibleTab`
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.4, §5
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Screenshot capture
|
||||
- Decision: A single PNG screenshot is captured via
|
||||
`chrome.tabs.captureVisibleTab()` at the moment the user clicks "Save
|
||||
archive". The screenshot is bundled as `screenshot.png` inside the ZIP.
|
||||
|
||||
---
|
||||
|
||||
## DEC-009: WebM Header Retention
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.1, §8
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Video container integrity
|
||||
- Decision: The first chunk emitted by `MediaRecorder` (which contains the WebM
|
||||
container header) MUST be retained in the ring buffer indefinitely; only
|
||||
subsequent chunks rotate out by the 30-second TTL rule.
|
||||
- Rationale (from SPEC §8): WebM without its header is not playable.
|
||||
|
||||
---
|
||||
|
||||
## DEC-010: Service Worker Keepalive via `chrome.alarms`
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §8
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Service Worker lifecycle
|
||||
- Decision: To prevent the 30 s idle unload of MV3 Service Workers, a
|
||||
`chrome.alarms` alarm fires every 20 seconds to keep the worker alive.
|
||||
|
||||
---
|
||||
|
||||
## DEC-011: Manifest Permissions Set
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §7
|
||||
- Status: Accepted
|
||||
- Locked: false
|
||||
- Scope: Manifest configuration
|
||||
- Decision: `manifest.json` requests exactly:
|
||||
- `permissions`: `tabCapture`, `activeTab`, `downloads`, `scripting`,
|
||||
`storage`
|
||||
- `host_permissions`: `<all_urls>`
|
||||
- Note: `tabCapture` requires explicit user gesture on first activation.
|
||||
|
||||
---
|
||||
|
||||
## DEC-012: Vite + crxjs + TypeScript Build Toolchain
|
||||
|
||||
- Source: `README.md` §"Технический стек"
|
||||
- Status: Accepted (DOC-level — not asserted by SPEC)
|
||||
- Locked: false
|
||||
- Scope: Build tooling
|
||||
- Decision: The extension is built with Vite + the `crxjs` plugin in
|
||||
TypeScript. The SPEC does not prescribe a build tool, so this is a
|
||||
DOC-level decision not contradicted by any higher-precedence source.
|
||||
- Provenance caveat: If a future ADR/SPEC selects a different toolchain, this
|
||||
DEC is auto-overridden.
|
||||
227
.planning/intel/requirements.md
Normal file
227
.planning/intel/requirements.md
Normal file
@@ -0,0 +1,227 @@
|
||||
# Functional Requirements (synthesized from SPEC §4–§7, acceptance §10)
|
||||
|
||||
The SPEC `Тз расширение фаза1.md` does not formally label itself as a PRD set,
|
||||
but sections 4–7 describe user-visible / functional behavior and §10 lists
|
||||
acceptance criteria. Per the orchestrator's instruction, these are extracted
|
||||
here as requirements with IDs derived `REQ-{slug}`.
|
||||
|
||||
Source key:
|
||||
- `SPEC §X` → `Тз расширение фаза1.md`, section X
|
||||
- `DOC` → `README.md`
|
||||
|
||||
All requirements below are sourced from the SPEC; the DOC is a confirming
|
||||
source unless noted otherwise.
|
||||
|
||||
---
|
||||
|
||||
## REQ-video-ring-buffer
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.1
|
||||
- Scope: Continuous video capture of the active tab
|
||||
- Description: The extension MUST maintain an in-memory ring buffer containing
|
||||
the most recent 30 seconds of video from the currently active browser tab.
|
||||
- Acceptance criteria (from SPEC §10):
|
||||
- Video buffer runs continuously on any tab.
|
||||
- The buffer never holds more than 30 seconds of footage.
|
||||
- The bundled `last_30sec.webm` from the exported archive plays back in a
|
||||
browser.
|
||||
- Technical bindings (see decisions.md):
|
||||
- DEC-003 — `chrome.tabCapture.capture()` for acquisition
|
||||
- DEC-003 — `video/webm; codecs=vp9` @ 400 000 bps, 2000 ms chunks
|
||||
- DEC-009 — header chunk retained indefinitely
|
||||
- Confirming source: `README.md` §"Использование" and §"Кольцевой буфер".
|
||||
|
||||
---
|
||||
|
||||
## REQ-rrweb-dom-buffer
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.2
|
||||
- Scope: DOM event recording
|
||||
- Description: The extension MUST record DOM events via rrweb over a rolling
|
||||
10-minute window from the active page, capped at 5 000 events.
|
||||
- Acceptance criteria (from SPEC §10):
|
||||
- rrweb records DOM events without errors on typical pages (forms, tables,
|
||||
modal windows).
|
||||
- Technical bindings:
|
||||
- DEC-004 — rrweb library
|
||||
- DEC-004 — `maskInputSelector` for `input[type=password]` and
|
||||
`[data-sensitive="true"]`
|
||||
- SPEC §8 — 5 000-event cap; oldest dropped on overflow
|
||||
- SPEC §4.2 — 10-minute TTL purge every 60 s
|
||||
- Confirming source: `README.md` §"Кольцевой буфер".
|
||||
|
||||
---
|
||||
|
||||
## REQ-user-event-log
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.3
|
||||
- Scope: User and runtime event logging
|
||||
- Description: The extension MUST log user and runtime events over a rolling
|
||||
10-minute window.
|
||||
- Captured event types (SPEC §4.3):
|
||||
- `click` — click on any element; records `target` selector and element text
|
||||
- `input` — field value change (passwords excluded)
|
||||
- `navigation` — `popstate`, `hashchange`, page transitions
|
||||
- `js_error` — `window.onerror`, `window.onunhandledrejection`
|
||||
- `network_error` — `fetch` / `XMLHttpRequest` with response code `>= 400`
|
||||
- Log entry schema (SPEC §4.3, verbatim):
|
||||
```json
|
||||
{
|
||||
"timestamp": 1716800000000,
|
||||
"type": "click | input | navigation | error | network",
|
||||
"target": "CSS-селектор элемента",
|
||||
"value": "текст/значение (маскируется для паролей)",
|
||||
"url": "текущий URL",
|
||||
"meta": {}
|
||||
}
|
||||
```
|
||||
- Acceptance criteria (from SPEC §10):
|
||||
- Event log captures clicks, navigation, and network errors.
|
||||
- Passwords do not appear in either the event log or rrweb snapshots.
|
||||
- Confirming source: `README.md` §"Записываемые события".
|
||||
|
||||
---
|
||||
|
||||
## REQ-screenshot-on-export
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.4, §5
|
||||
- Scope: One-shot visual capture
|
||||
- Description: At the moment the user clicks "Save archive", the extension MUST
|
||||
capture a PNG screenshot of the active tab via `chrome.tabs.captureVisibleTab`
|
||||
and include it as `screenshot.png` in the archive.
|
||||
- Technical binding: DEC-008.
|
||||
|
||||
---
|
||||
|
||||
## REQ-popup-ui
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §5
|
||||
- Scope: User-facing trigger
|
||||
- Description: The extension MUST expose a minimal popup with a single button
|
||||
labeled "Сохранить отчёт об ошибке" and a sub-label "Последние 30 сек видео
|
||||
+ 10 мин лога".
|
||||
- Button state machine (SPEC §5):
|
||||
- `idle` → `Сохраняю...` → `Готово! ✓` → `idle` (after 3 s)
|
||||
- On-click behavior (SPEC §5):
|
||||
1. Capture screenshot of active tab.
|
||||
2. Request video buffer + event log from Service Worker.
|
||||
3. Request rrweb snapshots from Content Script.
|
||||
4. Assemble archive (see REQ-archive-layout).
|
||||
5. Trigger download via `chrome.downloads.download()`.
|
||||
6. Display "Готово! ✓" status.
|
||||
- Confirming source: `README.md` §"Использование".
|
||||
|
||||
---
|
||||
|
||||
## REQ-archive-layout
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §6
|
||||
- Scope: ZIP archive structure
|
||||
- Description: The archive MUST be named
|
||||
`session_report_YYYY-MM-DD_HH-MM-SS.zip` and contain exactly:
|
||||
```
|
||||
session_report_2025-05-15_14-32-10.zip
|
||||
├── video/
|
||||
│ └── last_30sec.webm # склеенные чанки видеобуфера
|
||||
├── rrweb/
|
||||
│ └── session.json # массив DOM-событий rrweb
|
||||
├── logs/
|
||||
│ └── events.json # лог действий пользователя
|
||||
├── screenshot.png # скриншот в момент сохранения
|
||||
└── meta.json # метаданные сессии
|
||||
```
|
||||
- Acceptance criteria (from SPEC §10):
|
||||
- Archive opens cleanly.
|
||||
- `last_30sec.webm` plays back in a browser.
|
||||
- Confirming source: `README.md` §"Структура архива" (byte-identical layout).
|
||||
|
||||
---
|
||||
|
||||
## REQ-meta-json-schema
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §6
|
||||
- Scope: Archive metadata
|
||||
- Description: `meta.json` inside the archive MUST conform to the schema:
|
||||
```json
|
||||
{
|
||||
"timestamp": "2025-05-15T14:32:10Z",
|
||||
"url": "https://...",
|
||||
"userAgent": "Chrome/...",
|
||||
"extensionVersion": "1.0.0",
|
||||
"videoBufferSeconds": 30,
|
||||
"logDurationMinutes": 10,
|
||||
"totalEvents": 143
|
||||
}
|
||||
```
|
||||
- Fields are required (SPEC does not mark any optional).
|
||||
|
||||
---
|
||||
|
||||
## REQ-manifest-permissions
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §7
|
||||
- Scope: Browser permission surface
|
||||
- Description: The extension MUST declare exactly the permission set in DEC-011
|
||||
and MUST request user gesture for `tabCapture` on first activation.
|
||||
- Acceptance criteria (from SPEC §10):
|
||||
- Extension installs in Chrome without errors.
|
||||
|
||||
---
|
||||
|
||||
## REQ-archive-export-latency
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §10 (acceptance)
|
||||
- Scope: Performance — archive delivery
|
||||
- Description: From the moment the user clicks the export button, the ZIP
|
||||
archive MUST land in the "Downloads" folder in under 5 seconds.
|
||||
- Confirming source: `README.md` §"Критерии приёмки Фазы 1".
|
||||
|
||||
---
|
||||
|
||||
## REQ-password-confidentiality
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §4.2, §4.3, §8, §10
|
||||
- Scope: Sensitive data handling
|
||||
- Description: Passwords MUST NOT appear in either rrweb snapshots or the user
|
||||
event log. Masking MUST be enforced by:
|
||||
- rrweb `maskInputSelector` covering `input[type=password]` and
|
||||
`[data-sensitive="true"]`
|
||||
- the event logger explicitly filtering value capture for password fields
|
||||
- Acceptance criteria (from SPEC §10):
|
||||
- Passwords do not leak into either output stream.
|
||||
- Confirming source: `README.md` §"Маскирование чувствительных данных".
|
||||
|
||||
---
|
||||
|
||||
## REQ-install-clean
|
||||
|
||||
- Source: `Тз расширение фаза1.md` §10
|
||||
- Scope: Installability
|
||||
- Description: The extension MUST install in Chrome without errors via the
|
||||
unpacked-extension load flow.
|
||||
- Confirming source: `README.md` §"Установка расширения в Chrome".
|
||||
|
||||
---
|
||||
|
||||
## Phase 1 Acceptance Criteria (full list, SPEC §10 verbatim)
|
||||
|
||||
For traceability, all SPEC §10 acceptance criteria are listed here once. Each
|
||||
is also referenced from one or more REQ-* entries above.
|
||||
|
||||
1. The extension installs in Chrome without errors. → REQ-install-clean,
|
||||
REQ-manifest-permissions
|
||||
2. The video buffer runs continuously on any tab. → REQ-video-ring-buffer
|
||||
3. The buffer always contains no more than 30 seconds of video. →
|
||||
REQ-video-ring-buffer
|
||||
4. rrweb records DOM events without errors on typical pages (forms, tables,
|
||||
modal windows). → REQ-rrweb-dom-buffer
|
||||
5. The event log captures clicks, navigation, and network errors. →
|
||||
REQ-user-event-log
|
||||
6. On button press, the archive is downloaded to "Downloads" in < 5 seconds. →
|
||||
REQ-archive-export-latency
|
||||
7. The archive opens; `last_30sec.webm` plays back in a browser. →
|
||||
REQ-archive-layout, REQ-video-ring-buffer
|
||||
8. Passwords do not appear in the log or rrweb snapshots. →
|
||||
REQ-password-confidentiality
|
||||
9. Extension RAM consumption does not exceed 50 MB in the background. → see
|
||||
`constraints.md` CON-ram-ceiling (NFR, not a functional REQ).
|
||||
Reference in New Issue
Block a user