Commit graph

444 commits

Author SHA1 Message Date
Bryan Helmkamp
58860e5ded Merge remote-tracking branch 'origin/main'
Resolve the artifact lifecycle merge by keeping object-backed upload and sandbox sync behavior alongside durable blob-ref normalization.
2026-04-07 17:52:07 -04:00
Bryan Helmkamp
41c4760cf2 fix(artifacts): harden object-backed upload rollout
Tighten the worker upload path so object-backed runs only fail when an
artifact upload is actually attempted without a token, and update CLI
snapshots for the new artifact storage metadata.

Fold in the workspace test and clippy fixes needed to verify the final
artifact upload implementation cleanly across Rust and web targets.
2026-04-07 17:45:49 -04:00
Bryan Helmkamp
4f88a11daf feat(workflow): persist offloaded context as global blob refs
Store large context payloads in the global CAS and keep durable
checkpoint state as blob://sha256 refs instead of execution-local file
paths. Resolve and materialize blob refs at execution, output, and export
time so resumed and remote runs can read legacy and new artifacts
consistently.
2026-04-07 17:18:28 -04:00
Bryan Helmkamp
2c643e6684 fix(run): terminate active workers on force removal
Active runs deleted through rm --force were removed from server state
without signalling the worker process, which could leave detached
workers orphaned after test cleanup. Terminate the tracked worker
process group before deleting run state and cover it with an
integration regression.
2026-04-07 16:04:26 -04:00
Bryan Helmkamp
d65a4c5f1a Merge remote-tracking branch 'origin/main'
# Conflicts:
#	apps/fabro-web/app/routes/run-overview.tsx
#	apps/fabro-web/app/routes/workflow-detail.tsx
#	apps/fabro-web/app/routes/workflows.tsx
#	lib/crates/fabro-workflow/src/lifecycle/artifact.rs
#	lib/crates/fabro-workflow/src/pipeline/finalize.rs
2026-04-07 15:24:07 -04:00
Bryan Helmkamp
6ca2833e77 refactor(billing): unify the LLM billing domain
Replace the overlapping usage and cost model with canonical billing
primitives centered on ModelRef, ModelHandle, TokenCounts, and
BilledModelUsage. This also renames the public API and web surface from
usage to billing, removes compatibility aliases, and normalizes provider
usage adapters onto the shared billing vocabulary.
2026-04-07 14:33:35 -04:00
Bryan Helmkamp
0eca7d94d6 fix(run): make attach stream terminal-authoritative
Replay persisted run events for attach requests, keep the SSE stream live
only while the run is active, and close on terminal run events instead of
returning 410 for completed runs.

The CLI now treats premature attach EOF as an error, and the affected
integration tests were stabilized around store-backed event ordering and
recovered rewind timelines.
2026-04-07 14:32:23 -04:00
Bryan Helmkamp
0a2fd4b0dc Merge remote-tracking branch 'origin/main' 2026-04-07 13:00:13 -04:00
Bryan Helmkamp
9a5c2406cc feat(run): record run creation provenance
Persist server, client, and subject provenance on run creation so
run state and inspect output can show which Fabro version created a
run, which first-party client submitted it, and how the request was
authenticated.
2026-04-07 12:59:25 -04:00
Bryan Helmkamp
ca616820ec refactor(cli): stream run attach over SSE
Replace the attach polling loop with the existing run attach SSE endpoint.
Seed from stored history once, fetch interview questions only when needed,
and keep completed-run replay behavior intact.
2026-04-07 12:58:37 -04:00
Bryan Helmkamp
f552646b4f Merge remote-tracking branch 'origin/main'
# Conflicts:
#	lib/crates/fabro-cli/tests/it/cmd/support.rs
2026-04-07 11:44:13 -04:00
Bryan Helmkamp
8a6446addb perf(nextest): keep shared test server state in memory
Default test daemons now opt into an in-memory object store and test
helpers carry explicit run ids instead of rediscovering runs from
shared state.

This also disables the disk-backed store dump integration tests until
store dump is routed through the server's live store handles.
2026-04-07 11:39:40 -04:00
Bryan Helmkamp
0cf80cdcfb refactor(store): share run projection with cli
Make fabro-store::RunProjection the single projection type used by the
server, CLI, and CLI test helpers. This removes the duplicated CLI-side
mirrors and adds serde coverage for the store-owned projection.
2026-04-07 11:36:22 -04:00
Bryan Helmkamp
d19e724c2c fix(run): propagate worker cancellation into command stages
Pass a real cancel signal from __run-worker through the workflow engine
into sandbox command execution so cancelled runs reap gated shell loops
instead of leaking slow.gate waiters.
2026-04-07 10:09:30 -04:00
Bryan Helmkamp
330b7ef5e8 test(nextest): share one session server by default
Eagerly start one shared test server per nextest session and point default
TestContext commands at that session socket instead of leaking per-test
daemons keyed by FABRO_STORAGE_DIR. Add isolated_server() for tests that
need an explicit separate daemon, and tighten the ps filtering test so it
still proves the contract without timing out under full-suite load.
2026-04-07 09:44:34 -04:00
Bryan Helmkamp
ba02af2f88 feat(run): harden server-supervised worker lifecycle
Move subprocess workers fully behind the server-owned run store by
switching worker/server coordination to HTTP-backed run events and
control state. Reconcile stale in-flight runs on boot, terminate live
workers during shutdown, and update process titles to reflect server and
worker lifecycle phases.
2026-04-07 07:59:35 -04:00
Bryan Helmkamp
c9c9cd01bd chore: remove skill install command and GET /runs/{id}/verification endpoint
Dead feature cleanup: `skill install` was hidden/experimental and never
graduated; the run verification endpoint was only implemented in demo mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 16:38:03 -04:00
Bryan Helmkamp
38a2306e2e feat(system): add server-backed system commands 2026-04-06 16:10:06 -04:00
Bryan Helmkamp
e9aecf9a17 fix(testing): stabilize artifact fixture under load
Increase the artifact scenario timeout so the retry fixture still forces one timeout without spuriously creating a third retry under full-workspace nextest load. Also import the generated ServerSettings type directly so workspace clippy stays clean.
2026-04-06 14:09:32 -04:00
Bryan Helmkamp
e862581fc8 refactor(settings): make settings command server-backed
Default `fabro settings` now resolves effective runtime settings against the
selected server, while `--local` preserves local-only inspection. This also
extracts shared settings resolution logic so CLI output, manifest preparation,
and the `/api/v1/settings` contract stay aligned.
2026-04-06 13:34:28 -04:00
Bryan Helmkamp
23231eb1ae refactor(cli): separate local socket and storage defaults
Keep local server targeting based on explicit server targets instead of
implicitly deriving a socket from storage_dir. This makes ~/.fabro/fabro.sock
the default local socket again, keeps storage under ~/.fabro/storage, threads
FABRO_CONFIG through server autostart paths, and updates the CLI test harness
for the new split.
2026-04-06 11:57:14 -04:00
Bryan Helmkamp
bd8f0fe5ee refactor(storage): unify scratch paths and key schema
- centralize FABRO_HOME and storage path resolution in fabro-config
- rename store types, extract ArtifactStore, and simplify run key layout
- switch run scratch to scratch/, remove RuntimeState, and refresh docs/clients
2026-04-06 10:13:37 -04:00
Bryan Helmkamp
9c61608d96 refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
Bryan Helmkamp
6d94f93e44 refactor(config): unify machine config as settings.toml
Consolidate CLI and server machine defaults under settings.toml,
including loader renames, writer preservation fixes, same-machine
manifest handling, and docs/test updates for the new config model.
2026-04-05 23:55:28 -04:00
Bryan Helmkamp
f9f7f0baea refactor(cli): make core run lifecycle server-only 2026-04-05 21:57:27 -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
0421705af0 refactor(server): submit runs and preflight via manifests 2026-04-05 20:07:10 -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
cdddcdeadf refactor(cli): remove global execution mode 2026-04-05 15:20:00 -04:00
Bryan Helmkamp
a1e0762eb0 refactor(workspace): satisfy clippy all-targets warnings 2026-04-05 14:37:32 -04:00
Bryan Helmkamp
d4b9331d2e refactor(cli): make model commands server-canonical 2026-04-05 14:09:24 -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
a9d91dbda2 test: tidy remaining test harness edits 2026-04-05 12:17:35 -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
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
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
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
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
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