fabro/docs/public
fabro-sh-0530[bot] 6e36d8350e
Render stage activity from scoped events endpoint (#212)
## Summary
Stage detail now loads activity from a canonical stage-scoped events
endpoint instead of falling back to the first 1000 run-wide events. This
fixes empty panes for late stages in long runs and removes the
presentation-shaped `StageTurn` API from the wire.

### Plan Summary
- Add `GET /runs/{id}/stages/{stageId}/events` with cursor pagination
and server-side `node_id` filtering.
- Replace frontend stage-turn/fallback loading with paginated
stage-events loading and local event-to-activity projection.
- Broaden SSE/SWR invalidation so every activity event consumed by the
reducer refreshes the per-stage cache.
- Remove `StageTurn` schemas/client models and update demo fixtures plus
pagination/handler/reducer tests.

## What changed and why
The store now scans the run event prefix and filters by `node_id` before
applying the `limit + 1` cutoff. That preserves sparse late-stage
matches that would otherwise be dropped if we reused the run-wide
limited scan and filtered afterward. The real-mode handler returns an
empty page for an unknown stage id in an existing run, while preserving
404 for missing runs.

On the frontend, `run-stages` fetches all pages for the selected stage
and feeds them through `eventsToActivity`, keeping `TurnType` as a local
presentation model. Invalidation now targets `runs.stageEvents(runId,
stageId)` for lifecycle and reducer-consumed activity events
(`stage.prompt`, agent messages/tools, and command events), so active
panes refresh from the existing run event subscription.

The OpenAPI document and generated TS client now expose
`listStageEvents` and drop stale `StageTurn` models. Demo mode serves a
`detect-drift` stage-events fixture using the same cursor semantics as
the real endpoint.

## API notes
`/runs/{id}/stages/{stageId}/turns` is removed; clients should use
`/runs/{id}/stages/{stageId}/events?since_seq=&limit=` and project
events locally. The `stageId` path segment for this endpoint is the
workflow node id, not the visit-qualified `node_id@visit` form used by
command logs/artifacts.

⚒️ Generated with [Fabro](https://fabro.sh)

---------

Co-authored-by: Fabro <noreply@fabro.sh>
Co-authored-by: Bryan Helmkamp <bryan@brynary.com>
2026-05-05 09:16:52 -04:00
..
administration docs: sync public docs to recent runtime changes 2026-05-04 11:43:03 -04:00
agents refactor(run-projection): use stage vocabulary 2026-05-01 19:56:22 -04:00
api-reference Render stage activity from scoped events endpoint (#212) 2026-05-05 09:16:52 -04:00
changelog docs(changelog): refresh recent product changes 2026-05-04 11:38:55 -04:00
core-concepts docs: sync public docs to recent runtime changes 2026-05-04 11:43:03 -04:00
examples fix(workflows): pin clippy and fmt to nightly-2026-04-14 2026-05-03 17:32:46 -04:00
execution docs: sync public docs to recent runtime changes 2026-05-04 11:43:03 -04:00
getting-started docs(deployment): split into local vs self-hosted, drop Render/Fly/DO 2026-05-01 09:26:35 -04:00
human-tools docs: sync public docs to recent runtime changes 2026-05-04 11:43:03 -04:00
images refactor(docs): split docs/ into public/ and internal/ 2026-04-27 07:21:13 -07:00
integrations docs: sync public docs to recent runtime changes 2026-05-04 11:43:03 -04:00
languages refactor(docs): split docs/ into public/ and internal/ 2026-04-27 07:21:13 -07:00
logo refactor(docs): split docs/ into public/ and internal/ 2026-04-27 07:21:13 -07:00
reference Model Test Bounded Concurrency Implementation Plan (#204) 2026-05-04 13:46:44 -04:00
tutorials docs: sync public docs to recent runtime changes 2026-04-30 08:35:53 -04:00
workflows docs: sync public docs to recent runtime changes 2026-05-04 11:43:03 -04:00
.mintignore refactor(docs): move .mintignore into docs/public and update skill paths 2026-04-27 07:29:59 -07:00
docs.json docs(changelog): refresh recent product changes 2026-05-04 11:38:55 -04:00
dot-highlight.js refactor(docs): split docs/ into public/ and internal/ 2026-04-27 07:21:13 -07:00
favicon.svg refactor(docs): split docs/ into public/ and internal/ 2026-04-27 07:21:13 -07:00