fabro/lib/foundation
Bryan Helmkamp 34996d630f
Give Ask Fabro sessions their own event log
Step 4 of the legacy executor deletion, second commit. Ask Fabro's
sessions were the last writer of `run_events`: a session's creation, its
turns and their messages, tool calls and endings went into the run's
legacy event log, keyed by the run's sequence. They now have a log of
their own.

- `run_session_events` (migration `2026091802`): one row per session
  event, numbered per session from 1, with the owning run, the turn, the
  event name and its properties. `RunSessionEventStore` appends under the
  write lock, lists a session from a sequence, names a session's owner
  from its creation event, deletes a run's sessions with the run, and
  publishes each committed event to its subscribers.
- `fabro_types::SessionEvent`: `seq`, `session_id`, `run_id`, `ts` and a
  flattened body (`event` naming the kind, `properties` its fields), with
  the same event names and property shapes the legacy events carried,
  so the web app and the CLI read the same JSON. The property structs
  move to `session_event`; `run_event::session` re-exports them under
  their old names until the legacy event log goes.
- The API: `GET /sessions/{id}/events` pages `PaginatedSessionEventList`
  by the session's own sequence, `GET /sessions/{id}/attach` replays and
  streams `SessionEvent` frames (subscribed before the replay, so no
  event falls between the two), the turn stream carries the same frames,
  and an interrupt answers with the recorded event. The session
  projection folds `SessionEvent`s; the legacy `find_session_owner` over
  `run_events` is gone.
- The CLI's `run ask` and the web app's session stream read
  `SessionEvent`; the web runtime no longer accepts the nested legacy
  envelope shape.

The two session resume tests in the server keep failing for a reason
this commit does not touch: Ask Fabro reconnects to the run's sandbox
from the projection's sandbox instance, which the Petri projection does
not carry yet (`VIEWS.md`, the `scope.acquired` gap).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 12:47:43 -04:00
..
build-support refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-api Give Ask Fabro sessions their own event log 2026-09-18 12:47:43 -04:00
fabro-auth Name built-in providers through lithos catalog::builtin 2026-09-10 09:48:37 -06:00
fabro-client Give Ask Fabro sessions their own event log 2026-09-18 12:47:43 -04:00
fabro-config Remove the engine flag: every run is a Petri run 2026-09-18 09:58:21 -04:00
fabro-db Give Ask Fabro sessions their own event log 2026-09-18 12:47:43 -04:00
fabro-dev Delete fabro-hooks and the engine freeze check 2026-09-18 10:47:56 -04:00
fabro-http Depend on lithos-llm and the published twin-openai crate 2026-09-09 17:26:57 -06:00
fabro-macros refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-oauth refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-options-metadata refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-proc Consolidate server Git subprocess ownership 2026-09-11 17:36:40 -06:00
fabro-redact Give the checkout its GitHub credentials through the driver's store 2026-09-11 10:02:01 -06:00
fabro-static Remove the engine flag: every run is a Petri run 2026-09-18 09:58:21 -04:00
fabro-telemetry refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-template Simplify model stylesheet template plumbing 2026-08-25 18:54:06 -04:00
fabro-test Forward the Docker daemon selection and Daytona credentials to Petri workers 2026-09-18 09:10:29 -04:00
fabro-types Give Ask Fabro sessions their own event log 2026-09-18 12:47:43 -04:00
fabro-util Neutralize runtime for_each labels before display 2026-07-28 19:52:59 -04:00
fabro-vault refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00