Commit graph

647 commits

Author SHA1 Message Date
Bryan Helmkamp
e543efafb4 test(run): remove unused temp dirs 2026-04-03 15:25:12 -07:00
Bryan Helmkamp
19bbd34184 refactor(run): remove legacy checkpoint and stage dir I/O 2026-04-03 15:23:45 -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
9595cbb6c0 Remove SandboxRecordExt trait (save/load were unused in production)
The trait just wrapped serde_json + std::fs. Tests using it were testing
serialization, not sandbox behavior — deleted those and simplified the
daytona cp test to pass the record directly to reconnect.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 14:58:18 -07:00
Bryan Helmkamp
2ce613204e refactor(run): unify legacy dump projections 2026-04-03 14:50:12 -07:00
Bryan Helmkamp
a4e272bb34 Restore test-used save/load methods; remove file_name(), write_run_status, Conclusion::load, save_json
The prior commit over-removed methods still needed by tests. This restores
save/load/from_context on CheckpointExt, ConclusionExt, RunRecordExt, and
RunStatusRecordExt with inlined serialization (no longer using save_json).

Removed: file_name() from RunRecordExt and StartRecordExt (zero callers),
Conclusion::load (zero callers), write_run_status (zero callers),
save_json helper (replaced by inline serialization).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:51:28 -07:00
Bryan Helmkamp
3fc3daa79d Remove dead .save() methods, write_run_status, save_json, and ConclusionExt
These disk-write methods had no production callers — all data is now
persisted via events in SlateDB. Removes save_json helper, .save() from
RunRecord/StartRecord/Checkpoint traits, the entire ConclusionExt trait,
and the write_run_status function.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:38:27 -07:00
Bryan Helmkamp
9d7d942128 refactor(run): drop workflow.toml run-dir fallback
Remove the run_dir workflow.toml snapshot and the path resolver fallback
that treated a missing workflow.toml as a sibling workflow.fabro. SlateDB
and explicit workflow inputs are now the only supported sources.
2026-04-03 11:27:32 -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
fdf7323948 fix(pull-request): read plan text from run state
Stop PR body generation from depending on run_dir response.md files by
loading plan node responses from RunState instead. This keeps PR body
assembly working after removing stage response file writes and adds a
regression test covering the store-only path.
2026-04-03 11:13:40 -07:00
Bryan Helmkamp
fa7f760e86 Remove redundant run_dir file writes that duplicate event-sourced data
All data in these files is already stored in SlateDB via events and
projected into RunState. No production code reads them from disk.

Removed writes: prompt.md, response.md, stdout.log, stderr.log,
script_invocation.json, script_timing.json, parallel_results.json,
provider_used.json, retro/{prompt,response,status,session}, live.json,
detached_failure.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:04:55 -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
c1f9b519d7 Make workflow state fully derivable from events
Complete the remaining event coverage from the events-as-source-of-truth plan.
Add response and failure-signature snapshots to stage.completed,
enrich retro.started and retro.completed with prompt/response data,
and remove the stale script field from stage.started.

Also update the internal event and run-directory docs so they match
current event payloads and derivation rules.
2026-04-02 08:33:42 -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
b9a09a3e85 Increase polling budgets for server tests that fail under concurrent load
Unit tests used 100×10ms=1s polling, insufficient when 82 tests run
concurrently. Integration tests already used 500×10ms=5s. SSE test
frame timeout was 500ms, too short for stage events to arrive under
CPU contention.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 07:13:51 -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
db3ef7a4da Load pull request diffs from the run store 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
72fb68df5d Use store-only metadata for PR body generation 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
974005f9be Stop reloading run ids after detached execution 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
13f68c6b8b Stop reloading run ids during detached failures 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