Commit graph

855 commits

Author SHA1 Message Date
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
Bryan Helmkamp
12e316b785 Finish events-as-source-of-truth follow-ups 2026-04-02 10:02:31 -07:00
Bryan Helmkamp
bf6ed3957b Align event tests and snapshots with stage responses
Update CLI progress test fixtures and log snapshots for the new
stage.completed response field, and add a narrow clippy allow/type alias
cleanup needed to keep the workspace warning-free.
2026-04-02 09:02:06 -07:00
Bryan Helmkamp
7235414e6a Rename FabroSettings to Settings, eliminate FabroSettingsExt
Move storage_dir() from FabroSettingsExt trait in fabro-config into an
inherent method on Settings in fabro-types. Remove the re-export from
fabro-config so callers import directly from fabro_types. Drop the
redundant Fabro prefix since the type already lives in the fabro_types
crate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 07:36:44 -07:00
Bryan Helmkamp
45ddb0b70a Merge remote-tracking branch 'origin/main'
# Conflicts:
#	lib/crates/fabro-server/src/server.rs
#	lib/crates/fabro-server/src/web_auth.rs
2026-04-02 06:48:22 -07:00
Bryan Helmkamp
ddc57d458c Rename SessionConfig to SessionOptions and McpServerConfig to McpServerSettings
Aligns naming with the convention that "Config" is for file-level configuration
while "Options" and "Settings" describe runtime parameters. Also applies
rustfmt formatting fixes in web_auth.rs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 06:47:42 -07:00
Bryan Helmkamp
7f0f014bfb Reduce slatedb timers 2026-04-02 06:43:58 -07:00
Bryan Helmkamp
345d6cd357 Stabilize workspace tests and clean warnings
Make the full workspace nextest run reliable after the run-store migration,
restore legacy test-harness projections needed by workflow integration tests,
and clear the remaining fmt/clippy issues in the touched paths.
2026-04-02 06:33:22 -07:00
Bryan Helmkamp
7464d3e385 Remove legacy run file projection layer 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
9e7005c435 Require store-backed state for run diffs 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
ea4cf7033b Restore rewound run metadata from the store 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
14464776f2 Infer attach store context without run records 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
335bafea47 Recover launcher state without run records 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
c4d1910479 Reuse store-backed run cleanup in system prune 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
656b2a79ea Pass run IDs directly into detached start services 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
f2f187cfbe Load sandbox cleanup metadata from the run store 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
c162f9048c Stop requiring progress files for attach fallback 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
1406997cb6 Project run creation events through the store 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
ba525dbfaa Stop writing rewind status files 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
fc329beb7c Restore start metadata when rehydrating rewound runs 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
d52b53a874 Stop writing legacy run status and conclusion files 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
d2e117d23f Stop writing legacy pull request files 2026-04-01 22:57:27 -07:00