fabro/lib/apps/fabro-cli/src
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
..
commands Give Ask Fabro sessions their own event log 2026-09-18 12:47:43 -04:00
shared Delete fabro-validate and fabro-acp; validate on Petri's check 2026-09-18 11:32:04 -04:00
sleep_inhibitor refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
args.rs Remove the retry, rewind, fork and timeline endpoints and commands 2026-09-18 10:54:45 -04:00
command_context.rs Implement the lithos CredentialProvider trait directly 2026-09-10 09:16:39 -06:00
gh.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
landing.rs Create CLI runs from immutable workflow intents 2026-09-01 16:14:34 -04:00
local_server.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
logging.rs refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
main.rs Move fabro-mcp's pebble mapping and test client into fabro-cli 2026-09-18 10:57:07 -04:00
manifest_args.rs Simplify the CLI run-intent create path 2026-09-01 16:14:34 -04:00
mcp_servers.rs Move fabro-mcp's pebble mapping and test client into fabro-cli 2026-09-18 10:57:07 -04:00
server_client.rs Remove the engine flag: every run is a Petri run 2026-09-18 09:58:21 -04:00
server_runs.rs Carry usage as lithos-llm's Usage and rename billing to usage 2026-09-14 12:31:34 -06:00
user_config.rs Use async reads during CLI intent preparation 2026-09-02 13:44:33 -04:00