Mark eb2258a880 feat(01-13): wave-1 — promote c647f61 prototype to production paths; A6 GREEN
Move the three load-bearing prototype files from `tests/uat/prototype/`
to their production paths under `tests/uat/`, leaving the architectural
narrative (research findings, BLOCKER citations, falsification table
references) intact. No behavioral changes — A6 still PASSES 5/5 in ~7s
end-to-end from the new paths.

File moves (git mv preserves history):
  - tests/uat/prototype/extension-page-harness.html
      → tests/uat/extension-page-harness.html
  - tests/uat/prototype/extension-page-harness.ts
      → tests/uat/extension-page-harness.ts
  - tests/uat/prototype/a6.test.ts
      → tests/uat/a6.test.ts

The `tests/uat/prototype/` directory is now empty (git does not track
empty directories; will not appear in subsequent `git status`).

Path-reference updates inside the moved files:
  - tests/uat/extension-page-harness.html: `<p>` line referencing the
    chrome-extension:// URL updated to drop `/prototype/`.
  - tests/uat/extension-page-harness.ts: file-header docstring rewritten
    to cite Plan 01-13 / Approach B / inheritance from c647f61. The
    load-bearing architectural-finding comment block (MV3 SW dynamic-
    import block falsification, Approach-B chrome.* surface summary)
    is REWORDED but its semantic content + research citations are
    PRESERVED — every load-bearing fact survives the rename.
  - tests/uat/a6.test.ts:
      * File-header rewritten to position the file as Plan 01-13's
        standalone single-assertion entry point (preserves the future-
        proof rationale: this entry stays around forever for fast TDD
        iteration on A6 even after Wave 3 folds A6 into the orchestrator
        harness.test.ts).
      * REPO_ROOT resolvePath chain corrected from `..,..,..` to `..,..`
        — the file is now two directory levels above the repo root
        instead of three. Without this fix DIST_TEST_DIR would resolve
        to a path one level above the actual repo root and
        assertBundlePresent would throw. **VERIFIED by running the
        driver: build path resolves correctly.**
      * harnessUrl constant updated to drop `/prototype/` from the
        chrome-extension://<id>/tests/uat/extension-page-harness.html
        URL — must match the rollup emission path in dist-test/.
      * Stdout labels updated: 'PROTOTYPE A6 result' → 'A6 result',
        'Plan 01-11 PROTOTYPE — A6 ... feasibility test' → 'Plan 01-13
        — A6 (Bug B canonical) standalone driver'. Inside the docstrings
        the historical 'originally landed as 01-11 prototype' provenance
        is preserved per the plan's contract.

vite.test.config.ts:
  - `rollupOptions.input` renamed `prototype_harness` → `extension_page_harness`
    pointing at the new production path. crxjs emits the harness HTML
    to `dist-test/tests/uat/extension-page-harness.html` (verified by
    `ls dist-test/tests/uat/`).
  - The `modulePreload: { polyfill: false }` line is PRESERVED — this
    is the CRITICAL SW FIX per 01-11-SUMMARY (disabling the polyfill
    is what makes the test bundle's offscreen-side dynamic import work
    without crashing in non-DOM contexts that incorrectly try to call
    document.querySelector).
  - File-header comment §4 and the inline `define.__MOKOSH_UAT__` comment
    are PRESERVED — load-bearing rationale for the dedicated build-time
    token (vs `import.meta.env.MODE === 'test'` which collides with
    vitest).

Verification (all GREEN):
  - `npm run build:test` — exit 0; dist-test/ emits
    `tests/uat/extension-page-harness.html` and `assets/extension_page_harness-*.js`.
  - `npx tsx tests/uat/a6.test.ts` — exits 0 with "A6 result: PASS";
    5/5 checks GREEN (SETUP: badge becomes REC; A6.1 badge==''; A6.2
    popup==''; A6.3 notif delta==0; A6.4 isRecording=false). End-to-end
    runtime ~7s headless on this workstation.
  - `npx tsc --noEmit` — exit 0 (root tsconfig + tests/uat/tsconfig.json).
  - `npx vitest run` — 92/92 GREEN; the moves do not touch any vitest-
    discovered files.
  - `npm run build` — exit 0; Tier-1 grep gate stays GREEN
    (the moves do not touch production code).

Wave 2 (next): build out `tests/uat/lib/{launch,assertions,harness-page-
driver}.ts` around the extension-page architecture; rewrite
`tests/uat/a6.test.ts` to use the shared lib (still PASSES 5/5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 15:01:58 +02:00

AI Call Recorder - Браузерное расширение для записи сессий операторов

Фаза 1 — Локальная запись + экспорт архива

Установка и запуск

Разработка

# Установка зависимостей
npm install

# Сборка для разработки с HMR
npm run dev

# Сборка для продакшена
npm run build

Установка расширения в Chrome

  1. Соберите проект:

    npm run build
    
  2. Откройте Chrome и перейдите по адресу: chrome://extensions/

  3. Включите "Режим разработчика" (Developer mode) в правом верхнем углу

  4. Нажмите кнопку "Загрузить распакованное расширение" (Load unpacked)

  5. Выберите папку dist в корне проекта

  6. Расширение установлено!

Использование

  1. При первом открытии popup расширение запросит разрешение на запись экрана

  2. Разрешение обязательно для работы расширения

  3. Расширение автоматически начнет запись:

    • Видео: последние 30 секунд (кольцевой буфер)
    • DOM-события через rrweb: последние 10 минут
    • Лог действий пользователя: последние 10 минут
  4. Для сохранения отчета об ошибке:

    • Нажмите на иконку расширения
    • Нажмите кнопку "Сохранить отчёт об ошибке"
    • Архив автоматически загрузится в папку "Загрузки"

Структура архива

Архив session_report_YYYY-MM-DD_HH-MM-SS.zip содержит:

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                   # метаданные сессии

Технический стек

  • Тип расширения: Chrome Extension, Manifest V3
  • Service Worker: Background script (Manifest V3)
  • Захват экрана: chrome.tabCapture API
  • Захват DOM: rrweb (npm: rrweb)
  • Лог событий: Content Script
  • Упаковка архива: JSZip (npm: jszip)
  • Сохранение файла: chrome.downloads API
  • Хранение буфера: In-memory (Service Worker + Content Script)
  • Build: Vite + crxjs + TypeScript

Особенности

Маскирование чувствительных данных

  • Пароли (input[type=password]) маскируются автоматически в rrweb и логах
  • Поля с атрибутом data-sensitive="true" также маскируются в rrweb

Записываемые события

Пользовательские события

  • click — клик по любому элементу
  • input — изменение значения поля (без паролей)
  • navigation — переходы по страницам (popstate, hashchange, History API)
  • js_error — JavaScript ошибки (window.onerror, unhandledrejection)
  • network_error — сетевые ошибки (fetch/XHR с кодом ответа >= 400)

Кольцевой буфер

  • Видео: 30 секунд, первый чанк (WebM заголовок) хранится всегда
  • rrweb события: 10 минут, максимум 5000 событий
  • Пользовательские события: 10 минут

Память

  • Ожидаемое потребление: ~5-10 МБ в фоновом режиме

Критерии приёмки Фазы 1

  • Расширение устанавливается в Chrome без ошибок
  • Видеобуфер непрерывно работает на любой вкладке
  • В буфере всегда есть не более 30 секунд видео
  • rrweb пишет DOM-события без ошибок на типовых страницах
  • Лог событий фиксирует клики, навигацию и сетевые ошибки
  • При нажатии кнопки архив скачивается в "Загрузки" за < 5 секунд
  • Архив открывается, last_30sec.webm воспроизводится в браузере
  • Пароли не попадают в лог и rrweb-снимки
  • RAM-потребление расширения не превышает 50 МБ в фоне

Отладка

Console Logs

Расширение пишет подробные логи в консоль:

  • Service Worker: Chrome DevTools → Extensions → Service Worker → Console
  • Content Script: Chrome DevTools на любой странице → Console
  • Popup: Правый клик по popup → Проверить

Структура проекта

ai-call-extension/
├── src/
│   ├── background/          # Service Worker
│   │   └── index.ts
│   ├── content/            # Content Script
│   │   └── index.ts
│   ├── popup/              # Popup UI
│   │   ├── index.html
│   │   ├── index.ts
│   │   └── style.css
│   └── shared/             # Общие типы и утилиты
│       ├── types.ts
│       └── logger.ts
├── icons/                  # Иконки расширения
├── dist/                   # Собранные файлы
├── manifest.json           # Manifest расширения
├── vite.config.ts          # Конфигурация Vite
├── tsconfig.json           # Конфигурация TypeScript
└── package.json

Лицензия

MIT

Контакты

Для вопросов и предложений обращайтесь в support.

Description
No description provided
Readme 8 MiB
Languages
TypeScript 91%
HTML 3.4%
CSS 2.8%
Shell 2%
JavaScript 0.8%