fabro/lib/components
Bryan Helmkamp 1ed30db1d6
Keep a live run's replay and view between projector passes
Each projector pass replayed the run whole through `replay_since` to rebuild
the engine and invocation state the derivation needs, so a pass cost the
run's length. The projector now keeps, per live run and behind the run's
pass lock, Petri's `RunReplay` and the view as the last committed pass left
it (`projector/cache.rs`), and a pass advances the replay over the records
past the ones it consumed: it reads and folds only the new records. The
SQLite store answers `read_from` with `seq >= ?`, and the signalling store
forwards it.

The rules hold as before. Records first: the cache moves only after the view
transaction commits, and a pass that commits nothing (a platform record
landed under it, a fault before the transaction) keeps the events it
derived as pending for the next pass. The cache is never checkpointed and
never a source of facts: it is dropped when the run records its finish,
after ten idle minutes, when the stored view moves under it, when the run is
deleted, and with the process; the first pass after that rebuilds it by a
full replay, filtered to the held positions. A torn tail fails the advance,
which leaves the replay where it stood, so the view holds and the pass is
retried. `PassReport::replayed_records` says how many records a pass fed
through the derivation.

Two projection tests: the records of a parallel run land in batches and
every pass replays at most its batch, with the finished run's cache dropped;
a restart and the idle period drop the cache and the next pass replays the
run so far once, then only its new records, and the view equals the rebuild
throughout. `test_support` exposes whether a cache is held and the idle
sweep.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 19:58:03 -04:00
..
fabro-automation Open sandbox provider identity to plugin kinds 2026-09-09 15:17:32 -06:00
fabro-checkpoint Merge remote-tracking branch 'origin/main' into remove/run-metadata-branches 2026-09-12 16:28:01 -06:00
fabro-dump Settle clippy and formatting after the sandbox merge 2026-09-18 18:39:58 -04:00
fabro-environment Open sandbox provider identity to plugin kinds 2026-09-09 15:17:32 -06:00
fabro-github Resolve one Git identity per run and inject it everywhere 2026-09-12 11:35:46 -06:00
fabro-graphviz Delete fabro-validate and fabro-acp; validate on Petri's check 2026-09-18 11:32:04 -04:00
fabro-install Remove the [server.slatedb] settings and the SlateDB prefix probe 2026-09-18 16:00:24 -04:00
fabro-interview refactor: remove duplicated review target rendering and validation 2026-07-28 15:14:23 -04:00
fabro-llm Run agent stages, Ask Fabro, and fabro exec on pebble's CodingAgent 2026-09-11 14:19:15 -06:00
fabro-manifest Delete fabro-validate and fabro-acp; validate on Petri's check 2026-09-18 11:32:04 -04:00
fabro-mcp-store refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-petri Keep a live run's replay and view between projector passes 2026-09-18 19:58:03 -04:00
fabro-sandbox Project a Petri run's sandbox instance from its scope records 2026-09-18 15:57:12 -04:00
fabro-slack Delete fabro-core and the engine half of fabro-workflow 2026-09-18 10:44:41 -04:00
fabro-store Add the artifact, run diff and branch workspace platform records 2026-09-18 16:00:11 -04:00
fabro-tool Serve the run stream as the only run event API 2026-09-18 13:36:00 -04:00
fabro-tracker refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-variable refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-workflow Delete the legacy run event log, its reducer and its types 2026-09-18 14:09:17 -04:00
fabro-workflow-version Delete the legacy run event log, its reducer and its types 2026-09-18 14:09:17 -04:00