Commit graph

657 commits

Author SHA1 Message Date
Bryan Helmkamp
a667fb7472
Rename fabro_core::RunState to ExecutionState
Resolves the name collision with fabro_store::RunState. The core type
represents live in-memory execution state (current node, visits, context),
while the store type is an event-sourced projection of a full run record.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:34:24 -07:00
Bryan Helmkamp
22115a180b
Remove NodeOutcomeRecord alias; embed CatalogRecord in RunSummary
NodeOutcomeRecord was a duplicate alias for Outcome<Option<StageUsage>>
which fabro-workflow already calls Outcome. Inline the type instead.

RunSummary duplicated CatalogRecord's four fields. Use #[serde(flatten)]
to embed CatalogRecord directly, eliminating the duplication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:31:44 -07:00
Bryan Helmkamp
7bc0b5db3a
Merge remote-tracking branch 'origin/main' 2026-04-03 16:25:17 -07:00
Bryan Helmkamp
0844294440
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
0577de38f9
refactor(run): remove vestigial run dir params 2026-04-03 16:16:53 -07:00
Bryan Helmkamp
27f59d3f6c
Fix clippy warnings in fabro-workflow
- run_dump: take &Path instead of PathBuf by value in path helpers
- test_support: remove empty no-op persist_run_artifacts_for_tests
- agent.rs: use u32::try_from instead of as u32 cast
- retro.rs: remove unnecessary let binding
- pull_request.rs: use NodeState::default() instead of Default::default()
- execute/tests.rs: replace bool::then in filter_map with filter+map

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 15:52:49 -07:00
Bryan Helmkamp
5d62a8ba15
lint 2026-04-03 15:41:46 -07:00
Bryan Helmkamp
374b224ac4
refactor(run): remove dead legacy cleanup paths 2026-04-03 15:40:16 -07:00
Bryan Helmkamp
6c2c4ce657
test(run): remove unused temp dirs 2026-04-03 15:25:12 -07:00
Bryan Helmkamp
4d7c9c55a7
refactor(run): remove legacy checkpoint and stage dir I/O 2026-04-03 15:23:45 -07:00
Bryan Helmkamp
336a0eece6
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
a19878e590
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
01b1ce45e0
refactor(run): unify legacy dump projections 2026-04-03 14:50:12 -07:00
Bryan Helmkamp
ef1e831a0e
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
3e9a118420
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
3270136281
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
8d2a3220f7
Simplify: rename internal AggregateUsageTotals to UsageAccumulator, add TODO
Eliminates confusing alias (`ApiAggregateUsageTotals`) by giving the
internal accumulator struct a distinct name. Adds a TODO for removing
the OAS 3.1→3.0 patch when progenitor gains 3.1 support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:24:36 -07:00
Bryan Helmkamp
0e1730a6a3
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
58a1380865
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
679728a1a8
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
a02148aacd
Rename fabro-api-types to fabro-api with progenitor client generation
Replace typify-only type generation with progenitor, which generates both
Rust types (in a `types` module) and a reqwest-based HTTP client from the
OpenAPI spec. Also upgrades reqwest 0.12→0.13 and rmcp 0.15→1.3 to align
dependency versions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 11:17:27 -07:00
Bryan Helmkamp
19543e6558
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
1cc389a485
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
7ba75e4743
Merge remote-tracking branch 'origin/main' 2026-04-03 10:34:48 -07:00
Bryan Helmkamp
2c27582b9c
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
9bfd7f5593
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
5737fcff66
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
9c4923f338
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
23b59a2f01
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
946009dbef
Merge remote-tracking branch 'origin/main' into feat/event-sourced-run-state 2026-04-03 06:44:58 -07:00
Bryan Helmkamp
491f326c12
Collapse store handles onto Slate 2026-04-02 23:16:05 -07:00
Bryan Helmkamp
79cad86ed4
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
9d3a8243c3
Merge remote-tracking branch 'origin/main' 2026-04-02 14:29:31 -07:00
Bryan Helmkamp
9c42d375b2
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
1847357d44
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
57108f7d3c
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
4afe95c575
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
c245c4194d
Make provider metadata event-derived and rewind append-only 2026-04-02 10:26:12 -07:00
Bryan Helmkamp
631d9a96e1
Finish events-as-source-of-truth follow-ups 2026-04-02 10:02:31 -07:00
Bryan Helmkamp
936ebfade1
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
e79f337077
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
28a1fc72f4
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
5f1f47a966
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
3f1c71b541
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
b5f5162c3a
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
f2910c557e
Reduce slatedb timers 2026-04-02 06:43:58 -07:00
Bryan Helmkamp
75b0e0879a
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
93eab71892
Remove legacy run file projection layer 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
ebe7db8e62
Load pull request diffs from the run store 2026-04-01 22:57:27 -07:00
Bryan Helmkamp
81d838f600
Use store-only metadata for PR body generation 2026-04-01 22:57:27 -07:00