fabro/lib/apps
Bryan Helmkamp de60eb900f
refactor: deduplicate cached-run access and event scans
- Add AppState::cached_run with the standard 500/404 mapping and use it
  everywhere handlers read the shared run-projection cache. This also
  normalizes two inconsistencies: graph-source cache errors now map to
  500 (was 502), and a missing projection in PR create/unlink now maps
  to the canonical 404 (was a bespoke 500).
- Extract an EventScan cursor shared by the four run-event scan loops,
  delegate list_events_from to the paginated variant, and stop the
  stage-event scan once its page is full instead of walking the rest of
  the log.
- Hold Arc<RunProjection> in the local projection cache so opening a run
  no longer deep-copies the projection (copy-on-write via Arc::make_mut),
  and drop the now-unreachable shared-cache branch in last_event_seq.
- Trim hot-path clones: run_files serves the projection Arc directly,
  run-state serializes by reference, artifacts only checks existence, and
  the command-log handler opens a reader only for the CAS-blob branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 09:25:42 -04:00
..
fabro-cli Merge remote-tracking branch 'origin/main' into fix/cancellation-interrupt-lifecycle 2026-07-23 20:55:25 -04:00
fabro-mcp-server refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00
fabro-server refactor: deduplicate cached-run access and event scans 2026-07-24 09:25:42 -04:00
fabro-spa refactor: organize crates into three layers 2026-07-23 17:59:34 -04:00