peppa/openspec/changes/archive/2026-11-14-pep-33-agent-steps/design.md
Асель 4a80d9dc6b PEP-32/33/37: story page tabs, live agent step feed, SSE live updates instead of 5 s polling
- PEP-37: change hub (runner/live.ts) woken by notify() (new 'web' subscriber) and
  PRAGMA data_version; per-scope fingerprints; GET /api/live SSE (no-transform, ping 15 s);
  LiveRefresh replaces AutoRefresh with a connection indicator and polling fallback
- PEP-33: async PostToolUse/PostToolUseFailure hook -> 'step' events (last 200 per
  session), AgentSteps live feed on the story page and runner panel, tasks.md progress
  on board cards and the story header
- PEP-32: story page header + tabs Proposal/Design/Specs/Tasks/Comments/Tests/Merge
  request/Activity, safe Markdown renderer, PM comments visible in get_task, edit
  title/description/epic, accept-and-merge (acceptStory)
- OpenSpec changes archived; specs live-updates, agent-steps, story-page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 05:59:15 +05:00

16 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Decisions
- **Шаг = строка `events` (`type = 'step'`)**, без новой таблицы: у событий уже есть проект,
стори и сессия, индекс по сессии; размер держим удалением всего, что старше 200 последних
шагов сессии (на каждой вставке, одним DELETE по id).
- **Асинхронный хук.** `PostToolUse` с `async: true`: Claude не ждёт процесс `peppa-hook`, цена —
один `node` на вызов инструмента в фоне. Поколение (`PEPPA_GENERATION`) проверяется как у
остальных хуков.
- **Текст шага** — короткий: команда (первая строка, 200 символов), путь файла относительно
рабочей копии, паттерн поиска, URL; для `mcp__peppa__*` — имя инструмента.
- **Прогресс из tasks.md рабочей копии**: агент отмечает пункты `- [x]` по ходу работы
(правила OpenSpec), отдельного учёта не нужно. Нет change или файла — прогресса нет.
- **Лента живёт в браузере**: SSE `steps:<sessionId>` присылает `step` с данными, компонент
дописывает их сверху без `router.refresh()`; новые шаги не меняют отпечаток стори, чтобы
страница не перерисовывалась на каждый вызов инструмента.