Commit graph

326 commits

Author SHA1 Message Date
Bryan Helmkamp
2889d5b2c2 fix(tests): isolate shared-daemon scenario helpers 2026-04-05 03:18:46 -04:00
Bryan Helmkamp
6c99e54049 fix(cli): route shared-test run lookup through server 2026-04-05 03:02:16 -04:00
Bryan Helmkamp
35180b2393 refactor(store): route test helpers through server-owned runs 2026-04-05 02:53:17 -04:00
Bryan Helmkamp
8d8c3e3637 fix(test): reduce shared-daemon cli overhead 2026-04-05 00:56:08 -04:00
Bryan Helmkamp
bf2b6ba701 refactor(cli): route run state through the shared server daemon
Move durable run access and execution control onto the server-backed client,
canonicalize run APIs under /api/v1/runs, and switch CLI integration tests
to a shared test daemon/storage model with shared-state-safe assertions.
2026-04-05 00:15:33 -04:00
Bryan Helmkamp
94467b35cb chore: fix warnings and test stability 2026-04-04 13:31:04 -04:00
Bryan Helmkamp
1f6cff8395 refactor: remove remaining event json indirection 2026-04-04 13:24:19 -04:00
Bryan Helmkamp
ee968f336e Merge remote-tracking branch 'origin/main' 2026-04-04 12:25:28 -04:00
Bryan Helmkamp
9ba093288c refactor: rename EventEmitter to Emitter
The Event prefix is redundant since the type lives in event.rs modules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:24:42 -04:00
Bryan Helmkamp
54103421cb Merge remote-tracking branch 'origin/main' 2026-04-04 12:14:23 -04:00
Bryan Helmkamp
a924b0006d Resolve main merge conflicts 2026-04-04 12:14:05 -04:00
Bryan Helmkamp
a632813a20 cleanup 2026-04-04 12:08:57 -04:00
Bryan Helmkamp
e6e0f76889 refactor: remove dead code and unnecessary clones in run event types
Remove unused RunEventHeader and AssistantUsageProps structs, simplify
identity RunNoticeLevel conversion, and return references from
event_name()/properties() instead of cloning.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:08:38 -04:00
Bryan Helmkamp
cba8de4d94 Refactor assets into blob-backed artifacts 2026-04-04 12:08:15 -04:00
Bryan Helmkamp
ee50eeda79 refactor: rename workflow run events 2026-04-04 11:15:32 -04:00
Bryan Helmkamp
cf304664cc refactor: remove legacy stored event compatibility 2026-04-04 10:51:15 -04:00
Bryan Helmkamp
871bc500e4 refactor: unify workflow stored event model
Add a shared StoredEvent schema in fabro-types and switch workflow,
store, CLI, and server event handling to use it directly.

This removes the writer/reader mismatch around flattened failure data,
updates affected projections and progress rendering, and refreshes the
fixture/snapshot coverage around the canonical event shape.
2026-04-04 10:38:44 -04:00
Bryan Helmkamp
988f267268 refactor: replace artifact values with run blobs
Rename durable artifact values to raw byte blobs keyed by RunBlobId,
add the blob type in fabro-types, switch SlateRunStore to write/read/list
blob APIs, and export blobs from store dumps by UUID.
2026-04-03 23:59:27 -07:00
Bryan Helmkamp
98e93d22fc refactor: remove workflow lifecycle disk checkpoints 2026-04-03 23:49:57 -07:00
Bryan Helmkamp
5c3106e608 refactor: remove legacy node file writes from workflow handlers 2026-04-03 23:12:40 -07:00
Bryan Helmkamp
b40b145424 merge: resolve conflicts from origin/main
Merged origin/main incorporating:
- db_prefix threading in SlateRunStore for run isolation
- matches_run validation in active run cache
- NodeVisitRef type in fabro-store types
- ListRunsQuery parameter for list_runs API
- HashSet dedup in catalog listing
- Updated snapshot tests for new run directory format

Preserved from feature branch:
- NodeAsset struct and exports
- StageId-based node references in run state
- make_run_dir as pub for cross-crate access
- Thread-spawn approach in handler test_default for tokio safety
- parse_run_id handles YYYYMMDD-ULID directory format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 20:46:09 -07:00
Bryan Helmkamp
e645c68be5 fix: serialize run.running with workflow lifecycle events
Move run.running emission onto the event emitter path so it cannot race
past sandbox.initialized or run.started via a direct store append. This
keeps event ordering deterministic for CLI consumers and snapshot tests.
2026-04-03 19:35:51 -07:00
Bryan Helmkamp
cd8747b340 refactor: derive durable run paths from run IDs
Move durable run metadata and path derivation onto RunId, simplify the
Slate catalog/index format, and carry the storage-specific run directory
through workflow creation so detached and lookup flows stay aligned.

Also update affected CLI snapshots and test helpers to match the new
run discovery behavior.
2026-04-03 19:15:39 -07:00
Bryan Helmkamp
f495141eae chore: fix cli lint and snapshot drift 2026-04-03 18:11:33 -07:00
Bryan Helmkamp
2d781e419b refactor: introduce StageId 2026-04-03 18:00:29 -07:00
Bryan Helmkamp
541a32f823 Narrow fabro-cli helper visibility 2026-04-03 17:47:51 -07:00
Bryan Helmkamp
b0e6117122 Derive run metadata from RunId 2026-04-03 17:46:44 -07:00
Bryan Helmkamp
d490dbe4fa refactor: simplify run storage and retire sqlite metadata 2026-04-03 17:24:51 -07:00
Bryan Helmkamp
4c4d8482e3 Rename fabro_store::RunState to RunProjection
Clarifies that this type is an event-sourced projection of run history,
distinct from fabro_core::ExecutionState which tracks live execution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:37:19 -07:00
Bryan Helmkamp
0e1798a69f Remove dead code, double-Arc, and back-compat shims
- Remove RunStoreHandle type alias (double-Arc); use SlateRunStore directly
- Remove RunState::list_node_ids (test-only, inline in tests)
- Remove SlateRunStore::list_assets and scan_prefix (test-only)
- Remove RuntimeState::ensure_runtime_dir/ensure_artifact_values_dir (test-only)
- Remove read_dot_source and its 4 tests (reads files no longer written)
- Remove back-compat modules transform/vars/stylesheet; update integration test
- Remove unused InvalidTransition/ParseRunStatusError re-exports
- Fix crate::vars import to crate::transforms::variable_expansion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:24:44 -07:00
Bryan Helmkamp
ffee4688eb Remove InMemoryStore, RunSnapshot, and NodeSnapshot; use RunState directly
InMemoryStore duplicated SlateStore's interface and was unused in
production. RunSnapshot/NodeSnapshot were intermediate projections that
tests consumed — replaced with RunState to eliminate the indirection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 14:59:24 -07:00
Bryan Helmkamp
2ce613204e refactor(run): unify legacy dump projections 2026-04-03 14:50:12 -07:00
Bryan Helmkamp
7b18a11c40 test(run): remove legacy file absence assertions
Keep the coverage focused on current store-backed behavior instead of
asserting that old run_dir debug files are missing.
2026-04-03 11:24:30 -07:00
Bryan Helmkamp
94ed91217c refactor(run): drop debug-only node artifact files
Remove API/CLI request and log artifact writes plus panic.txt now that
run state and events are store-backed. Update the direct tests to assert
returned behavior instead of on-disk debug files.
2026-04-03 11:23:14 -07:00
Bryan Helmkamp
a65941e418 refactor(run): remove file-backed attach fallback
Require attach to use SlateDB-backed run state and events instead of
falling back to progress.jsonl, status.json, and conclusion.json.
Also remove the unused disk progress logger and keep PR body plan text
store-backed so the remaining run_dir file writes can continue shrinking.
2026-04-03 11:19:23 -07:00
Bryan Helmkamp
32ce949d8f Merge remote-tracking branch 'origin/main' 2026-04-03 10:34:48 -07:00
Bryan Helmkamp
e5c2d0e911 Remove non-event put_*/get_* methods from SlateRunStore and fix tests
Follow-up to the prior commit that removed production callers. This commit:
- Removes InMemoryRunStore methods and dead key functions
- Rewrites store/workflow tests to use append_event + state() instead of removed methods
- Updates CLI snapshot tests for new event-projected output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 10:11:30 -07:00
Bryan Helmkamp
563a9eeb49 Remove server feature flag from fabro-cli, always compile server in
The server subcommand and related code were gated behind
cfg(feature = "server"). This removes the feature flag entirely,
making fabro-server a required dependency so the server command
is always available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 10:09:56 -07:00
Bryan Helmkamp
8d935603a8 Fix clippy warnings: remove useless .into(), unnecessary async, large futures, and style lints
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 08:47:16 -07:00
Bryan Helmkamp
404a784422 Update attach snapshot: run.running now emitted before sandbox.initialized
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 07:59:33 -07:00
Bryan Helmkamp
abe0e49688 Gate server test imports behind cfg(feature = "server")
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 07:57:32 -07:00
Bryan Helmkamp
6874d0c76e Merge remote-tracking branch 'origin/main' into feat/event-sourced-run-state 2026-04-03 06:44:58 -07:00
Bryan Helmkamp
180cca046c Collapse store handles onto Slate 2026-04-02 23:16:05 -07:00
Bryan Helmkamp
031d4cdbb6 Require a durable run store throughout execution
Make run lookup fail with RunNotFound instead of returning Option, thread a required RunStore through workflow and retro paths, and update CLI, server, and test callers to match. Also treat null optional event properties as absent during store-backed replay so event-sourced state stays robust.
2026-04-02 15:08:21 -07:00
Bryan Helmkamp
9410ed8fda Merge remote-tracking branch 'origin/main' 2026-04-02 14:29:31 -07:00
Bryan Helmkamp
696f481103 Clean up server integration tests
Remove empty server.rs, redundant comments, redundant server.json
existence check (already covered by status check), unnecessary
String allocation, and unnecessary final filters.clone().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:25:06 -07:00
Bryan Helmkamp
4e84152c39 Add integration tests for server daemon management
- cmd/server_start: help snapshot, start-already-running error
- cmd/server_stop: help snapshot, stop-when-not-running error
- cmd/server_status: help snapshot, status-when-not-running error
- scenario/server_lifecycle: full start → status → status --json → stop cycle
- Remove stale server.rs help test (replaced by per-command files)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:18:05 -07:00
Bryan Helmkamp
e0ac11f1d5 Remove unnecessary comments, use bail! consistently in server start
- Delete WHAT comments that restate the code
- Replace eprintln! + process::exit(1) with bail! in daemon "already running" path for consistency with foreground mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 10:45:37 -07:00
Bryan Helmkamp
af2a1e4f6d Add server daemon management with Unix socket support
Transform `fabro server` from foreground-only TCP into a proper daemon:
- `server start` launches background daemon with flock-based locking
- `server start --foreground` retains current blocking behavior
- `server stop` sends SIGTERM, waits, escalates to SIGKILL
- `server status` reports running/stopped with PID, bind, uptime (--json)
- `--bind` replaces `--host`/`--port`, supporting Unix sockets and TCP
- Default bind is `{storage_dir}/fabro.sock` (Unix socket)
- Hidden `__serve` subcommand for daemon child process lifecycle
- Graceful shutdown via SIGTERM/SIGINT signal handlers

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 10:40:19 -07:00
Bryan Helmkamp
f786f91fe7 Make provider metadata event-derived and rewind append-only 2026-04-02 10:26:12 -07:00