Commit graph

1688 commits

Author SHA1 Message Date
Bryan Helmkamp
eb91f2bcab
Cut over Fabro web app to a server-backed SPA
Replace the old React Router SSR setup with a static SPA build served by
fabro-server, move setup and GitHub auth handling into Rust, and update the
default local web URL and stale Arc-era references to match the Fabro name.
2026-04-01 21:36:01 -07:00
Bryan Helmkamp
e849441833
Simplify: fix buggy JSON sorting, deduplicate event filtering, clean up wait loop
- Replace no-op sort_json_value (IndexMap→IndexMap) in create.rs with
  normalize_json_value (IndexMap→BTreeMap→Map) from event.rs, fixing
  RunCreated events having non-deterministic key order
- Add AgentEvent::is_streaming_noise() to centralize the 6-variant
  streaming filter used in api.rs, retro.rs, and subagent.rs
- Extract load_file_status closure and merge Ok(None)|Err(_) arms in
  wait.rs to remove triple-repeated RunStatusRecord::load expression

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:13:15 -04:00
Bryan Helmkamp
d8ee06276e
Persist run.created events in the run store
Hydrate the durable run store immediately after create-time event emission so
store-backed readers see the initial run.created event instead of only the
on-disk progress log. Add a regression test covering create-time store
visibility and wire in the object_store dependency needed by that test.
2026-04-01 20:13:14 -04:00
Bryan Helmkamp
81fd7aa8e6
Expand workflow event payloads and stabilize CLI logs
Add richer run, stage, prompt, command, retro, and agent session event
metadata so progress output and stored workflow events carry the context
needed by the new plan. Normalize event serialization and update CLI log
handling to prefer progress.jsonl with consistent redaction, and fix the
detached wait/log race covered by the updated integration and snapshot
tests.
2026-04-01 20:13:14 -04:00
Bryan Helmkamp
2178cf16dd
Consolidate unsafe process code into fabro-proc crate
Rename fabro-proctitle to fabro-proc and add safe wrappers for all
process management primitives (signals, pre-exec hooks). This contains
all unsafe proc code behind a safe API so downstream crates no longer
need #[allow(unsafe_code)] or direct libc dependencies.

New modules: signal (process_alive, sigterm, sigkill, sigterm_process_group),
pre_exec (pre_exec_setsid, pre_exec_setpgid, pre_exec_pdeathsig),
title (existing proctitle code). Eliminates three duplicate process_alive
definitions and removes libc as a direct dep of fabro-cli and fabro-sandbox.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:49:29 -04:00
Bryan Helmkamp
6c0eb0efb9
smoke 2026-04-01 17:31:51 -04:00
Bryan Helmkamp
dbf3f063df
Deny unsafe_code workspace-wide, remove unsafe pointer cast from tests
Promote unsafe_code lint from warn to deny so new unsafe code is a
compile error. Add #![allow(unsafe_code)] to the two sleep_inhibitor
modules that were missing it. Replace the unsafe trait-object pointer
cast in CliMockSandbox tests with a shared Arc<Mutex<Vec<String>>>.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 17:17:59 -04:00
Bryan Helmkamp
6331e689d1
docs 2026-04-01 16:25:41 -04:00
Bryan Helmkamp
9cc38efe66
docs 2026-04-01 14:37:06 -04:00
Bryan Helmkamp
e75d8a2fb0
Fix attach hanging on Linux CI when engine exits before attach starts
The attach loop's PID liveness fallback used `last_seq > 0` (store path)
and `!progress_file_is_empty` (file path) to keep the engine "alive" when
no launcher record could be found. These conditions are always true once
events exist, so the loop never exited via the PID path after the launcher
record was cleaned up by start_run or active_launcher_record_for_run.

The store-based terminal status check (the other exit path) only read from
the SlateDB DbReader, which may not see data still in the WAL or not yet
visible via manifest poll. Adding a disk fallback to read status.json
ensures the check works even when the store reader has a stale view.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 14:32:16 -04:00
Bryan Helmkamp
9f5334b21e
docs 2026-04-01 14:31:58 -04:00
Bryan Helmkamp
e6623decba
Replace max_retries=0 with goal_gate=true in smoke workflow
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 11:38:30 -04:00
Bryan Helmkamp
7eb85d5ec9
Fix missing create_app_state import in mTLS e2e tests
The mtls_e2e module is gated with #[cfg(target_os = "linux")], so the
wrong import (create_app_state_with_options instead of create_app_state)
was never caught on macOS. Fixes CI compilation failure on Linux.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 11:38:29 -04:00
Bryan Helmkamp
2bc27d61d8
Fix flaky SSE event stream integration test 2026-04-01 11:11:45 -04:00
Bryan Helmkamp
654c0b49a7
test(devcontainer): disable flaky OCI fetch integration
Temporarily short-circuit fetch_feature_oci_integration unless FABRO_ENABLE_FETCH_FEATURE_OCI_INTEGRATION is set.

The test depends on live oras and ghcr.io access and is timing out under the current nextest ignored-test invocation, so keep it visible but disabled until the root cause is addressed.
2026-04-01 11:11:38 -04:00
Bryan Helmkamp
f9d162c550
Move hook twin coverage to CLI workflow tests
Replace in-process workflow E2E hook tests with fabro-cli workflow
integration tests that run fabro as a subprocess and pass OpenAI twin
env only to the child process. Remove the unsafe env-var mutation helper
from fabro-workflow integration tests.
2026-04-01 11:03:44 -04:00
Bryan Helmkamp
a6e83f551e
Expand OpenAI twin coverage across integration tests
Add shared twin scenario helpers and use them to cover OpenAI-backed
CLI, agent parity, workflow, and exec integration paths. This brings the
worktree implementation back into the main checkout as a single commit.
2026-04-01 11:03:34 -04:00
Bryan Helmkamp
74344f8e9f
Add missing Arc import in mTLS e2e tests
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:38:50 -04:00
Bryan Helmkamp
758d3c911d
Expand smoke workflow into discrete sequential stages
Replace the single prompt-based stage with six command stages:
toolchain, compile-rust, compile-typescript, lint-rust, test-rust,
test-typescript. Each stage fails fast (max_retries=0).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 10:10:57 -04:00
Bryan Helmkamp
fea64a105b
Integrate twin-github for fabro-github tests
Add the stripped twin-github test server to the workspace, wire it through
fabro-test, and cover fabro-github's real HTTP auth and pull-request flows
with twin-backed integration tests. This also refactors the GitHub helper
entry points to take explicit base URLs so tests and callers share the same
request path.
2026-04-01 09:48:33 -04:00
Bryan Helmkamp
a496c243f4
Remove auto dry-run when LLM providers are missing
Previously, workflows silently fell back to dry-run mode when no LLM
providers were configured or client init failed. This caused command-only
workflows to skip execution entirely. Now missing LLM providers produce
a hard error when the graph has LLM nodes, and are ignored when it doesn't.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 00:34:20 -04:00
Bryan Helmkamp
9ebb896242
Suppress unreachable_pub warnings in twin-openai test helpers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 22:41:36 -04:00
Bryan Helmkamp
f0ebf341db
Optimize slow Docker and real CLI tests
- Move real_cli_claude/codex/gemini tests from fabro-workflow to fabro-cli,
  which has a 20s nextest timeout (vs 6s default), and add poll_interval(10ms)
- Reduce DockerSandbox stop_container grace period from 5s to 1s
- Reduce timeout_handling test sleep from 60s to 2s

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 22:19:51 -04:00
Bryan Helmkamp
ddd7550408
Increase nextest timeout for fabro-cli integration tests
These tests invoke the CLI binary and take longer than unit tests,
so flag SLOW at 5s and hard-kill at 20s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:36:48 -04:00
Bryan Helmkamp
6383e7037b
Add twin test mode for OpenAI E2E tests
Integrate twin-openai (fake OpenAI server) into the workspace and wire
it into the e2e_test macro so OpenAI tests can run without real API
credentials. The twin server starts in-process via OnceLock on first use
and provides per-test isolation through bearer-token namespacing.

Changes:
- Add Twin as default TestMode, replacing Off (gating now via #[ignore])
- Extend #[e2e_test] macro with `twin` requirement for twin-only,
  live-only, and dual-mode (twin + live) test gating
- Add e2e_openai!() macro returning (base_url, api_key)
- Convert openai_complete and openai_gpt_5_3_codex_complete to dual-mode
- Add new openai_server_error twin-only test with scripted 500 error
- Standardize axum 0.8 as workspace dependency across all crates
- Relax twin-openai ResponsesRequest to accept unknown fields via flatten

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:36:48 -04:00
Bryan Helmkamp
b5e5b91d51
Default TestContext::command() working directory to temp_dir
Tests were flaky because command() inherited the real repo as the
working directory. When the repo was clean, detached runs attempted
git worktree creation against it, sometimes failing and injecting
extra warning lines into snapshots.

Now command() defaults to the non-git temp_dir, eliminating this
class of flakiness. Tests needing a specific directory override with
.current_dir(). Also canonicalizes fixture paths and adds a
[FIXTURES] snapshot filter via test_context!() macro.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:36:48 -04:00
Bryan Helmkamp
e95f1a0386
Replace compact_progress_event with raw event snapshots
The compact_progress_event test helper cherry-picked fields and flattened
the properties wrapper, making snapshots misleadingly show a format that
doesn't match the actual fabro attach --json / progress.jsonl output.
Now snapshots show the real RunEventEnvelope structure with volatile
fields (id, ts, run_id, duration_ms) redacted via insta filters.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 20:31:13 -04:00
Bryan Helmkamp
e3ed586691
Prune stale git worktrees before branch creation in WorktreeSandbox
Stale worktree references from deleted temp directories kept branches
locked, causing "cannot force update the branch" errors on subsequent
runs with the same branch name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 13:44:01 -04:00
Bryan Helmkamp
c64639918e
Fix rewind snapshot filtering for short SHAs 2026-03-31 13:34:26 -04:00
Bryan Helmkamp
b9bdc81028
Fix workspace clippy issues in fabro-test 2026-03-31 13:33:20 -04:00
Bryan Helmkamp
0337e5ee96
Rename fabro-openai-oauth to fabro-oauth 2026-03-31 13:23:43 -04:00
Bryan Helmkamp
aa4855ab7d
tweak test timeout again 2026-03-31 13:19:06 -04:00
Bryan Helmkamp
2a250ea079
tighten slow test limit 2026-03-31 13:12:57 -04:00
Bryan Helmkamp
11c3ee8594
Speed up sleep-heavy test suites 2026-03-31 13:12:21 -04:00
Bryan Helmkamp
04ba232961
Fix flaky server tests by using explicit dry_run settings
These tests were racing against pipeline initialization (git worktree
creation, status checks) that runs before discovering no API keys and
falling back to dry-run mode. Using dry_run_settings() skips the
unnecessary git work upfront.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:16:52 -04:00
Bryan Helmkamp
501399cc8f
Fix logs --follow timeout by lowering SlateDB reader manifest poll interval
The default DbReaderOptions::manifest_poll_interval is 10s, which meant
the DbReader couldn't see conclusion/status updates from a detached run
until 10s after they were written. The nextest timeout (6s) fired first,
causing logs_follow_detached_run_streams_until_completion to always fail.
100ms is appropriate for local disk and in-memory object stores.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 10:45:34 -04:00
Bryan Helmkamp
112f80487c
simplify nextest config 2026-03-31 10:01:39 -04:00
Bryan Helmkamp
08f340fc8f
Migrate provider_auth test to #[e2e_test] macro
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:48:20 -04:00
Bryan Helmkamp
a050269a52
Fix lint and test fallout 2026-03-31 09:47:50 -04:00
Bryan Helmkamp
a6829c57a0
Tighten non-interactive JSON mode 2026-03-31 09:47:50 -04:00
Bryan Helmkamp
fb6f0eae1e
Centralize E2E test env var handling 2026-03-31 09:30:38 -04:00
Bryan Helmkamp
7f2d840007
Fix clippy warnings and date-sensitive snapshot tests from --json rollout
Resolve clippy errors (absolute paths in main.rs/preflight.rs, collapsible
if in cli.rs, missing print_stdout allow) and stabilize snapshot tests that
hardcoded a date in dir_name by replacing with a date-prefix filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 09:07:06 -04:00
Bryan Helmkamp
3b26601f8e
Add global JSON output mode 2026-03-31 07:51:19 -04:00
Bryan Helmkamp
fab337fe23
Remove OpenAI-specific params from OAuth authorize URL
Strip non-standard query parameters (id_token_add_organizations,
codex_cli_simplified_flow, originator) from the OAuth authorize URL
to keep it compliant with standard OAuth 2.0 PKCE flow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 22:37:24 -04:00
Bryan Helmkamp
6a3bafccd0
Split agent processing into thinking and executing 2026-03-30 19:56:38 -04:00
Bryan Helmkamp
3a74c51840
Allow GitHub and Slack base URLs to be overridden via env vars
Adds GITHUB_BASE_URL and SLACK_BASE_URL environment variable support
so integration tests can redirect traffic to fake servers instead of
hitting live third-party services.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 19:08:12 -04:00
Bryan Helmkamp
0b576079fb
Format workflow validation fixes 2026-03-30 19:00:06 -04:00
Bryan Helmkamp
d064b6c510
Stabilize merged workspace validation 2026-03-30 18:57:06 -04:00
Bryan Helmkamp
0313a1f4ee
Merge remote-tracking branch 'origin/main'
# Conflicts:
#	lib/crates/fabro-cli/tests/it/cmd/attach.rs
#	lib/crates/fabro-cli/tests/it/cmd/create.rs
#	lib/crates/fabro-cli/tests/it/cmd/resume.rs
#	lib/crates/fabro-cli/tests/it/cmd/start.rs
2026-03-30 18:26:57 -04:00
Bryan Helmkamp
c8a398d527
Add CLI integration test coverage 2026-03-30 18:23:24 -04:00