Commit graph

2582 commits

Author SHA1 Message Date
Bryan Helmkamp
17c65b4c6c fix(test): stabilize file interviewer claim-release timing
The file interviewer tests were assuming a transient claim file would be
observed within a 2ms window, which flaked under full-workspace load.
Make the observation wait explicit so nextest remains reliable.
2026-04-05 21:22:11 -04:00
Bryan Helmkamp
a1fd66c8a8 refactor(cli): target run and create commands via server connection
Allow run and create to resolve the same explicit or configured server
connection model used by preflight, validate, and graph. This removes the
last local-only submission assumption from the CLI surface while keeping
local storage-backed behavior intact when no remote target is selected.
2026-04-05 21:22:04 -04:00
Bryan Helmkamp
a6aacf255c refactor(workflow): make bundled child workflows authoritative 2026-04-05 20:13:00 -04:00
Bryan Helmkamp
0421705af0 refactor(server): submit runs and preflight via manifests 2026-04-05 20:07:10 -04:00
Bryan Helmkamp
b6dad44c70 fix(test): satisfy clippy import style in lifecycle tests 2026-04-05 17:55:30 -04:00
Bryan Helmkamp
40783c0e9b Merge remote-tracking branch 'origin/main'
Resolve the fabro-server merge conflicts by keeping the settings-aware test
app-state helper from origin/main while preserving the secret-store-aware
AppState construction added locally.
2026-04-05 17:45:57 -04:00
Bryan Helmkamp
9f86eb7d25 refactor(cli): clean legacy server-target and env naming
Tighten pre-manifest cleanup by removing the old dotenv helper, reducing
legacy .env handling to warning-only path detection, and renaming internal
remote target fields from base_url to api_url.

This also updates install/server docs and CLI terminology so the codebase
reflects the current direct-run vs server-interface model more accurately.
2026-04-05 17:43:03 -04:00
Bryan Helmkamp
3233ef529b refactor(server): make secrets and operational checks server-canonical
Move secret storage, diagnostics, and repo/provider validation behind the
server API so credentials live under the server storage dir and take effect
immediately without process env mutation.

This also removes the old .env runtime path, rewires doctor/install/secret/
provider login/repo init around the server contract, and regenerates the
TypeScript client for the new endpoints.
2026-04-05 17:34:01 -04:00
Bryan Helmkamp
819facbb1e refactor(cli): deglobalize server and storage target flags
Move --storage-dir and --server-url off GlobalArgs and onto the
leaf commands that actually honor them.

This aligns help, parser behavior, and env-var wiring with the
current command architecture while preserving the intended model
and exec targeting semantics.
2026-04-05 16:06:42 -04:00
Bryan Helmkamp
388f110ac0 fix(test): disable worktrees in fabro-server integration tests
Server scenario tests were inheriting the default local sandbox
worktree mode, which meant they created git worktrees and branches
before stage execution. Under suite load that setup intermittently
stalled the run long enough for the scenario polling windows to fail.

Disable worktrees in the shared server test settings and let lifecycle
scenarios use the same test-only settings through a settings-aware
registry factory helper.
2026-04-05 15:33:16 -04:00
Bryan Helmkamp
cdddcdeadf refactor(cli): remove global execution mode 2026-04-05 15:20:00 -04:00
Bryan Helmkamp
b25613271f refactor(test): restructure fabro-server it/ into api/ and scenario/ subdirs
Move integration tests from monolithic api.rs into api/ (single-endpoint
contract tests) and scenario/ (multi-API-step flows), mirroring the CLI's
cmd/ vs scenario/ pattern. Move 3 scheduler-dependent unit tests from
server.rs into it/scenario/ where they get the correct nextest timeout
(kind=test override). Deduplicate shared helpers into helpers.rs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 14:58:24 -04:00
Bryan Helmkamp
ab08a16cac Merge remote-tracking branch 'origin/main' 2026-04-05 14:44:35 -04:00
Bryan Helmkamp
a1e0762eb0 refactor(workspace): satisfy clippy all-targets warnings 2026-04-05 14:37:32 -04:00
Bryan Helmkamp
092efcb1a9 refactor(cli): move model CLI out of fabro-llm
Move the model command surface into fabro-cli and delete the dead
fabro-llm CLI module now that prompt/chat/model CLI entrypoints are gone.
This also removes the now-unused fabro-llm CLI-only dependencies.
2026-04-05 14:26:05 -04:00
Bryan Helmkamp
d4b9331d2e refactor(cli): make model commands server-canonical 2026-04-05 14:09:24 -04:00
Bryan Helmkamp
044122e186 fix(test): stop leaked server processes and add test names to temp dirs
Replace subprocess-based server stop (fabro server stop) with direct
SIGTERM/SIGKILL via fabro_proc, eliminating silent failures under
nextest parallelism that left orphaned daemon processes. Use test
function name as temp dir prefix (.ft-<name>-) so leaked processes
are identifiable by test, truncated to 16 chars for Unix socket
path limits.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 14:07:23 -04:00
Bryan Helmkamp
5b43bd7837 fmt 2026-04-05 13:16:14 -04:00
Bryan Helmkamp
63bb494e96 test: speed up slow default-profile tests and tighten nextest thresholds
Remove redundant config_change_after_submission test (1.67s avg) from
fabro-server — already covered by start_run_persists_full_settings_snapshot
and architectural guarantees. Defer reqwest::Client init past validation
in web_search tool so missing-key/missing-query tests skip macOS proxy
discovery (1.56s → 9ms). Move telemetry panic event tests to a CLI IT
via a new cfg(debug_assertions) __test_panic subcommand. Lower default
nextest SLOW threshold from 3s to 1.5s with 2x headroom over the new
worst-case (0.84s).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 13:15:59 -04:00
Bryan Helmkamp
4cf6c144df Merge remote-tracking branch 'origin/main' 2026-04-05 13:05:28 -04:00
Bryan Helmkamp
7952b336a9 test: clean up config-owned fabro daemons 2026-04-05 12:59:20 -04:00
Bryan Helmkamp
48c9db2909 test(server): replace generated mTLS fixtures 2026-04-05 12:24:09 -04:00
Bryan Helmkamp
a9d91dbda2 test: tidy remaining test harness edits 2026-04-05 12:17:35 -04:00
Bryan Helmkamp
0d9ea168af test: standardize no-proxy localhost HTTP clients 2026-04-05 12:17:29 -04:00
Bryan Helmkamp
824fb66d51 refactor(cli): simplify run lifecycle around server ownership
Rename the hidden detached worker command to __runner, remove launcher
bookkeeping, and resolve runs through a shared server-backed lookup.
This leaves attach, resume, logs, and related commands using the server
as the source of truth and updates the integration coverage around the
new lifecycle.
2026-04-05 12:11:55 -04:00
Bryan Helmkamp
3f6db424e5 refactor(server): satisfy clippy in execution result flow
Box the large execution result payload and simplify the startup-state
branch so workspace clippy stays clean after the CLI lifecycle work.
2026-04-05 12:11:40 -04:00
Bryan Helmkamp
a19aef2e3c test(cli): consolidate artifact integration coverage 2026-04-05 11:26:32 -04:00
Bryan Helmkamp
2441e00b24 test(cli): normalize json run snapshot llm defaults 2026-04-05 11:06:13 -04:00
Bryan Helmkamp
d30d8d01d3 test(cli): reduce logs snapshot surface area
Replace the brittle raw NDJSON snapshots in logs tests with direct
assertions on the stable contract: the command succeeds, all events belong
to the requested run, and the expected lifecycle events appear in order.

This keeps coverage on logs behavior while avoiding churn from unrelated
run.created payload details like default model configuration.
2026-04-05 10:47:41 -04:00
Bryan Helmkamp
3df499c45f fix(server): persist cancelled terminal state and align status tests
Persist a cancelled terminal record when a live run is interrupted by the
server-side cancel signal, and abort pending web interview questions so
human-gated runs can unwind instead of hanging in a non-terminal durable
state.

Also align server tests with the current succeeded status contract and poll
aggregate usage until the in-memory accumulator converges with the store-
backed run status.
2026-04-05 10:42:22 -04:00
Bryan Helmkamp
ebbc8f4f93 test(cli): stabilize ps JSON global flag assertion
Scope the ps listing to the current test case and compare a normalized
projection instead of exact live run payload equality. This avoids flakes
from parallel tests and in-flight status transitions while preserving the
CLI contract under test.
2026-04-05 10:34:32 -04:00
Bryan Helmkamp
f4068ac0a8 fix(server): persist cancelled run status in store
Keep durable run summaries aligned with in-memory cancellation state,
including runs cancelled before startup completes, and update server
coverage to assert the durable cancelled reason.
2026-04-05 10:30:17 -04:00
Bryan Helmkamp
33ae0338a5 test(cli): remove flaky workflow-name start assertion 2026-04-05 10:15:10 -04:00
Bryan Helmkamp
2b6ba07f36 fix(cli): restore green server-backed test checkpoint 2026-04-05 03:41:10 -04:00
Bryan Helmkamp
443c9f735b fix(cli): remove remaining local test store access 2026-04-05 03:34:26 -04:00
Bryan Helmkamp
dcbc104c99 fix(store): keep shared slatedb open across run handles
After the single-DB refactor, closing one SlateRunStore could close the
shared SlateDB for every run in the process. Under shared-daemon test
load that surfaced as 500 responses with \"db is closed\" on later state,
event, and delete requests.

Make run-handle close a no-op so the shared DB lifetime stays owned by
the store/process rather than individual run handles.
2026-04-05 03:22:41 -04:00
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
3642858c46 Merge remote-tracking branch 'origin/main' 2026-04-05 00:20:53 -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
65f1efd507 test(workflow): fix watchdog event assertion
The test captures Debug output from RunEvent, which renders the event body variant name rather than the canonical envelope string. Assert on StallWatchdogTimeout so the check matches the collected output.
2026-04-04 21:42:12 -04:00
Bryan Helmkamp
8a2d00591b fix(test): remove hidden HTTP client startup overhead
Disable proxy discovery for the hot test HTTP clients so nextest no longer
pays macOS system proxy lookup on repeated reqwest client creation.

Also keep the approved OAuth loopback cleanup and replace GitHub test key
generation with a checked-in PEM fixture.
2026-04-04 21:25:51 -04:00
Bryan Helmkamp
582c78096b refactor: add run store HTTP endpoints
Define the new run-store contract in the OpenAPI spec, regenerate the
Rust and TypeScript clients, and implement the matching store and
server support for run state, event access, blobs, and stage artifacts.
2026-04-04 15:37:43 -04:00
Bryan Helmkamp
aa5047c509 Merge remote-tracking branch 'origin/main' 2026-04-04 13:33:32 -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
3c99e98903 refactor: split POST /runs into create + start, remove context endpoint
Align the HTTP API with the CLI's existing `fabro create` / `fabro start`
separation. POST /api/v1/runs now creates a run in `submitted` status
without queuing it. A new POST /api/v1/runs/{id}/start transitions to
`queued` and notifies the scheduler. Also removes the unused
/api/v1/runs/{id}/context endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 13:02:08 -04:00
Bryan Helmkamp
1189cddd25 refactor: simplify run event representation 2026-04-04 12:59:42 -04:00