Commit graph

855 commits

Author SHA1 Message Date
Bryan Helmkamp
2106aba53b
fix(tests): isolate CLI integration tests from repo project config
Config discovery walks from the workflow file's parent directory, so
tests using fixtures at their repo path (test/simple.fabro) would find
the repo's .fabro/project.toml. This caused settings like preserve=true
to leak into tests and break sandbox cleanup event assertions.

Add TestContext::install_fixture() which copies fixtures into the test's
temp dir. Update all CLI run/attach/start tests to use it. Remove the
now-unused example_fixture() function.

Restore preserve=true in .fabro/project.toml — tests are now isolated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:18:19 -04:00
Bryan Helmkamp
5fa6b6e7a8
fix: resolve test failures and clippy warnings across workspace
- Remove EnvGuard and env-mutating test from fabro-auth (shared mutable state)
- Revert project.toml preserve=true that broke sandbox cleanup event tests
- Fix clippy: use is_some_and, scoped imports for StageStatus and render
- Update snapshot tests for new Run: ULID line and model_test output
- Fix preflight test assertion (name said "allows", asserted failure)
- Update cancel_queued_run test: cancelled runs now appear on board
- Add graph direction query param support to get_graph endpoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:02:20 -04:00
Bryan Helmkamp
e79baeab8e
fix(cli): align Run ID with other run header lines
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 09:20:07 -04:00
Bryan Helmkamp
abfdb9e523
fix(cli): restore Run ID in fabro run output header
Lost during the execute.rs → create.rs refactor in db3231e9.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 09:16:38 -04:00
Bryan Helmkamp
57e0385c98
fix(workflow): use configured providers for default models
Derive configured providers from env and vault when choosing default
models during run creation and materialization, and thread the resolved
run provider through execution handlers instead of recomputing it.

Also return a user-facing error when fabro-agent cannot infer a default
model for the selected provider.
2026-04-15 08:19:04 -04:00
Bryan Helmkamp
a147fecc00
feat(slatedb): add disk_cache setting for S3-backed deployments
When `disk_cache = true` in `[server.slatedb]`, Fabro enables SlateDB's
object-store cache at `<storage_root>/cache/slatedb`, caching raw S3
bytes on local disk to reduce read latency. All cache parameters use
SlateDB defaults (16 GB max, 4 MB parts). A warning is emitted if
enabled with `provider = "local"` since the cache adds overhead when
the object store is already on the local filesystem.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 08:02:46 -04:00
Bryan Helmkamp
d42d175408
feat(secret): accept secret value via stdin or interactive prompt
`fabro secret set` now supports three ways to provide the value: as a
positional arg (existing), piped via --value-stdin, or interactively
when stdin is a TTY (obscured with dialoguer::Password). Diagnostics
remediation messages drop the <value> placeholder to encourage
interactive input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 07:34:33 -04:00
Bryan Helmkamp
696427d10d
fix(doctor): simplify LLM provider detail lines
Drop redundant "connectivity" word from doctor check output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 07:31:15 -04:00
Bryan Helmkamp
ad192fcbed
feat(install): show auth method and dev token in install output
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 07:02:08 -04:00
Bryan Helmkamp
d6b4161bfd
feat(doctor): show server location URL in doctor output
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 06:57:17 -04:00
Bryan Helmkamp
4217d67659
feat(install): add github-only reconfiguration command
Add `fabro install github` for reconfiguring GitHub auth on an
existing install without rerunning full setup.

Ensure app/token switches replace stale settings and secrets, and
cover the new flow with CLI and integration tests.
2026-04-14 23:23:06 -04:00
Bryan Helmkamp
62a9d9438d
fix(install): restart the server after install
Restart the local server at the end of fabro install so new config and
server.env values take effect immediately. Skip fabro doctor when the
restart fails, and keep targeted unit coverage around the restart and
secret-persistence lifecycle.
2026-04-14 21:45:49 -04:00
Bryan Helmkamp
bf9f4f9353
feat(cli): add ls alias for list subcommands
Adds `#[command(alias = "ls")]` to workflow, pr, and artifact list
subcommands for consistency with secret list which already had it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 21:19:18 -04:00
Bryan Helmkamp
d863b54ac0
fix(server): embed git SHA and build date in server binary
The server used option_env!() for FABRO_GIT_SHA and FABRO_BUILD_DATE,
but no build.rs set them — so `fabro version` always showed "unknown".
Add a build.rs to fabro-server (matching fabro-cli's) and remove the
Sandbox line from `fabro system info`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 20:08:45 -04:00
Bryan Helmkamp
a3320809ab
feat(install): prompt for GitHub token when gh CLI is unavailable
When the gh CLI is not installed or not authenticated, the install
wizard now shows "Personal Access Token" (without the gh reference)
and prompts the user to enter their token directly instead of failing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 19:32:05 -04:00
Bryan Helmkamp
1ab1327f96
fix(ci): stabilize graphviz Rust checks
Some checks are pending
Rust / Format (push) Waiting to run
Rust / Clippy (push) Waiting to run
Rust / Test (Linux) (push) Waiting to run
Rust / Test (macOS) (push) Waiting to run
TypeScript / Typecheck (push) Waiting to run
TypeScript / Test (push) Waiting to run
TypeScript / Build (push) Waiting to run
Keep the render-graph CLI integration test explicitly documented for
synchronous stdio subprocess usage, and make the garbage-stdout server
test drain stdin before returning invalid output so the Linux test path
stays deterministic.
2026-04-14 19:31:01 -04:00
Bryan Helmkamp
3e9683b6a0 refactor(graphviz): extract graphviz-sys into fabro-sh/graphviz-sys
Move the vendored Graphviz FFI crate to its own repo so it can be
reused independently and reduce this repo's footprint (~250 C/H files).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 19:03:01 -04:00
Bryan Helmkamp
8c361afc51 Merge remote-tracking branch 'origin/main' 2026-04-14 18:38:49 -04:00
Bryan Helmkamp
286eee7efa fix(graphviz): isolate rendering in a subprocess
Run Graphviz through an internal fabro subprocess so renderer failures no
longer share process fate with the server. Keep expected DOT parse failures
on the 400 path via an explicit stdout protocol, and treat child crashes or
protocol violations as 500s.
2026-04-14 18:15:23 -04:00
Bryan Helmkamp
fa73407b35 feat(cli): add fabro version command
Add a server-targeted `fabro version` command for checking client and
server build identity without reading local storage directly.

This also removes version data from `/health`, moves doctor parity checks
to diagnostics, and updates the API spec, docs, generated client, and
coverage for the new contract.
2026-04-14 16:30:53 -04:00
Bryan Helmkamp
bf5da76678 Merge remote-tracking branch 'origin/main' 2026-04-14 15:45:01 -04:00
Bryan Helmkamp
ce26f66846 feat(release): support prerelease builds
Add prerelease-aware release automation and keep default install and upgrade
paths pinned to the latest stable tag unless an explicit prerelease version is
requested.
2026-04-14 15:43:00 -04:00
Bryan Helmkamp
09dc823e15 Fix clippy absolute_paths warnings in install command
Import fabro_util::path and use path::contract_tilde instead of
fully-qualified fabro_util::path::contract_tilde calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:37:06 -04:00
Bryan Helmkamp
e366e4e761 Remove "Generating secrets and auth material..." status line
Secret generation is fast enough that the progress message is unnecessary.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:16:49 -04:00
Bryan Helmkamp
2ba84be748 Improve install command output ordering and path display
Reorder output so file-write confirmations appear immediately after
secret generation, move "To start Fabro" call-to-action to the end,
collapse duplicate blank line, shorten home-dir paths with ~, and
style the `fabro server start` command with bold cyan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:16:21 -04:00
Bryan Helmkamp
4f521b96a6 Run doctor in non-verbose mode after install
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:15:00 -04:00
Bryan Helmkamp
635b11b39a Use ~ for home directory paths in doctor output
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 15:11:58 -04:00
Bryan Helmkamp
26f5c8f4a0 Format install command imports 2026-04-14 13:12:56 -04:00
Bryan Helmkamp
74dfb9f652 Restructure local object store layout 2026-04-14 13:08:07 -04:00
Bryan Helmkamp
2047e490d8 Merge remote-tracking branch 'origin/main' 2026-04-14 12:30:40 -04:00
Bryan Helmkamp
05c7fedd31 refactor(server): remove implicit dry-run fallback
Remove the server startup path that inferred dry-run from provider
availability and let run.execution.mode inherit normally from
settings.

Model tests now return skip for unconfigured providers at request
time, completions use the real error path, and the CLI/docs/tests are
updated for the removed server --dry-run flag.
2026-04-14 12:28:55 -04:00
Bryan Helmkamp
99ce9a66c4 refactor(cli): route global args through settings layer
Resolve CLI settings once from user config plus process-local overrides
and pass the resolved view through command dispatch and CommandContext.

This keeps config-driven cli.output, cli.updates, and cli.logging
behavior working while preserving commands that only reject explicit
--json overrides. It also removes the implicit auto-approve coupling
from JSON run output.
2026-04-14 12:27:59 -04:00
Bryan Helmkamp
c7461c31dc fix(doctor): omit absent legacy env check 2026-04-14 11:54:25 -04:00
Bryan Helmkamp
e199dea33a test(cli): refresh list output expectations
Update stale fabro-cli secret and workflow list tests to match the
intentional cli_table-rendered output introduced by the list-output
standardization refactor.
2026-04-14 11:30:34 -04:00
Bryan Helmkamp
b486d3125e Merge remote-tracking branch 'origin/main' 2026-04-14 08:12:06 -04:00
Bryan Helmkamp
5a7a42ede5 refactor(cli): standardize list command output with cli_table
Migrate secret list, artifact list, pr list, workflow list, and run
output artifacts from manual format-string tables to cli_table with
bold headers, no borders/separators, and color support — matching the
convention used by model list, runs list, and system df. Also improve
secret list timestamps to show relative ages (e.g. "8h ago").

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 08:11:22 -04:00
Bryan Helmkamp
5acfa46ddd fix(lint): use if-let instead of single-arm match in server start
Fixes clippy::single_match_else warning that was blocking CI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 07:54:21 -04:00
Bryan Helmkamp
3389f1d551 chore: remove dead system dependency check infrastructure
Now that Graphviz is vendored, remove the DepSpec/probe_system_deps/
check_system_deps infrastructure from doctor.rs (empty since the
vendoring), the no-op pre-flight check from install.rs, and the
stale hardcoded "dot" check from demo diagnostics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 07:30:32 -04:00
Bryan Helmkamp
829f2ae1d2 Merge remote-tracking branch 'origin/main' 2026-04-13 23:54:13 -04:00
Bryan Helmkamp
d22be78575 fix(server): honor server.listen when bind is omitted 2026-04-13 23:54:08 -04:00
Bryan Helmkamp
b3ae342a55 Merge branch 'vendor-graphviz-sys' 2026-04-13 23:42:45 -04:00
Bryan Helmkamp
ee5cd96f52 fix(tests): disable proxy discovery in install test 2026-04-13 23:34:59 -04:00
Bryan Helmkamp
15cf4d8640 refactor: wire vendored Graphviz into fabro-graphviz, remove dot dependency
Replace the Command::new("dot") shell-out in render_dot() with a direct
FFI call to the vendored Graphviz library. Drop PNG support (SVG only).
Remove GraphFormat enum, dot_is_available() helpers, dot-related
diagnostics/doctor checks, and the graphviz install prompt. Update
OpenAPI spec to remove png format and 502 responses. Update CLI help
text, snapshot tests, and documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:46:29 -04:00
Bryan Helmkamp
4cff947b87 fix(test): update snapshot placeholder [HOME] -> [HOME_DIR]
The test framework now replaces home directory paths with [HOME_DIR],
but this snapshot still used the old [HOME] placeholder.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 22:30:38 -04:00
Bryan Helmkamp
01b1fd13bd Merge origin/main into local main
Resolve conflicts in install.rs: apply gh_cli→token rename from local
to new non-interactive App support and pending_github_settings pattern
from origin/main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 21:38:54 -04:00
Bryan Helmkamp
67819457ad fix(install): harden GitHub app bootstrap
Replace the install-time OpenSSL Ed25519 shell-out with Rust-native key
material generation, drop the stale OpenSSL doctor requirement, and make
GitHub App setup persist valid auth settings and secrets together.

This also fixes the live non-interactive app install path by enabling
GitHub auth, populating allowed usernames, and avoiding half-written
settings when later persistence fails.
2026-04-13 21:20:10 -04:00
Bryan Helmkamp
f91923892c refactor(github): rename gh_cli strategy to token, GITHUB_CLI_TOKEN to GITHUB_TOKEN
The gh_cli strategy was named after its bootstrap mechanism, not what it
actually is at runtime: a stored token. This rename makes the abstraction
honest and decouples runtime behavior from the gh CLI.

- Rename GithubIntegrationStrategy::GhCli to Token (serialized as "token")
- Rename vault/env secret from GITHUB_CLI_TOKEN to GITHUB_TOKEN
- Accept GH_TOKEN as a fallback in both CLI and server
- CLI no longer shells out to `gh auth token` at runtime; reads from
  vault/env like the server already did
- fabro install still bootstraps from `gh auth token` as a one-time op

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 20:46:11 -04:00
Bryan Helmkamp
72c7147d73 chore(lint): fix fabro-cli clippy warnings 2026-04-13 19:45:26 -04:00
Bryan Helmkamp
f04e59f83f feat(install): support non-interactive github app setup 2026-04-13 19:42:03 -04:00
Bryan Helmkamp
f4bae6e9bc refactor(setup): remove browser-based GitHub app bootstrap
Make fabro install the only supported GitHub App setup path. This removes
HTTP endpoints and browser routes that mutated local server config, rewrites
/setup as an operator instructions page, and aligns the installer manifest
with the live GitHub OAuth callback and setup URLs.
2026-04-13 18:25:29 -04:00