Commit graph

855 commits

Author SHA1 Message Date
Bryan Helmkamp
2668d16799
fix(cli): remove dev-token env auth override 2026-05-01 14:30:05 -04:00
Bryan Helmkamp
5ef4b87878
Merge remote-tracking branch 'origin/main' 2026-05-01 09:34:44 -04:00
Bryan Helmkamp
2f7aeba417
fix(workflow): preserve exec failure diagnostics
Add bounded redacted exec output tails to failure events while keeping tracing log-safe. Centralize tail projection on ExecResult and thread diagnostics through metadata, setup, devcontainer, and CLI install failures.
2026-05-01 08:45:50 -04:00
Bryan Helmkamp
93908de46c
refactor(retro): share run dump hydration
Move RunDump into fabro-dump so CLI export and retro uploads share the same hydrated run layout. Drop the legacy artifact file-ref parser, add best-effort run.log retrieval for retro, and update retro prompts/docs to use events.jsonl and checkpoints.
2026-04-30 23:31:12 -04:00
Bryan Helmkamp
e590610dad
test(cli): read command logs via endpoint 2026-04-30 22:45:38 -04:00
Bryan Helmkamp
46164fcda9
chore(test): extract TestContext::set_http_target helper
Replace 16 inline copies of the `[cli.target] type = "http"` settings TOML across CLI integration tests with a single `set_http_target(&base_url)` method on `TestContext`. Removes a brittle format string that was maintained in ten files but only meaningfully asserted-against in one.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 10:11:47 -04:00
Bryan Helmkamp
015992208a
feat(models): expose configured status
Add configured to the model API contract and server responses so clients can see whether provider credential material exists before testing. Use that signal in bulk model tests to skip unconfigured providers before printing progress and treat post-list skips as race failures.
2026-04-30 09:15:02 -04:00
Bryan Helmkamp
d23e4d5082
refactor(cli): drop metadata snapshot success lines from run progress
The Metadata init/checkpoint/finalize lines added noise to `fabro run`
output. The underlying events still flow into progress.jsonl; only the
live rendering is removed. Failures continue to render as warnings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 08:34:22 -04:00
Bryan Helmkamp
d65c1fa635
refactor(types): remove stage status compatibility 2026-04-30 06:48:47 -04:00
Bryan Helmkamp
78a2f8638b
refactor(api): reuse billing and model domain types 2026-04-30 06:15:18 -04:00
Bryan Helmkamp
f16391485b
refactor(workflow): update stage outcome semantics 2026-04-30 06:06:51 -04:00
Bryan Helmkamp
71ec9fdee6
Merge remote-tracking branch 'origin/main'
# Conflicts:
#	lib/crates/fabro-types/src/lib.rs
2026-04-29 20:43:12 -04:00
Bryan Helmkamp
3e97cae0ae
refactor(api): unify secret metadata types 2026-04-29 20:26:13 -04:00
Bryan Helmkamp
25cd80c072
refactor(api): unify leaf API types 2026-04-29 20:21:23 -04:00
Bryan Helmkamp
07d3890bb8
refactor(workflow): share metadata snapshot helpers
Centralize compatibility notice detection and elapsed-time/error-cause helpers used by metadata snapshot event rendering and emission.
2026-04-29 19:43:30 -04:00
Bryan Helmkamp
4a4f0f8548
feat(workflow): emit metadata snapshot events
Add typed metadata snapshot events around init, checkpoint, and finalize archive writes so run logs expose durable metadata timing and failures. Include snapshot accounting, CLI rendering with compatibility-notice suppression, and event documentation.
2026-04-29 19:31:13 -04:00
Bryan Helmkamp
ef81c1c245
fix(run): enforce validation when create_run is quiet
The bail!("Validation failed") was nested inside `if !quiet`, so
`fabro run --detach` and `fabro run create` (both pass quiet=true)
silently created runs from invalid workflows. Move the bail outside the
gate; only the workflow summary print remains gated on !quiet.

Also simplifies the surrounding preflight code:

- Extract `cyan_spinner` helper in fabro-cli's shared utilities;
  collapse three copy-pasted 13-line spinner setups in preflight.rs,
  doctor.rs, and install.rs.
- Add `SandboxProvider::is_clone_based()`; replace the local
  `is_clone_based_provider` helper and two inline
  `matches!(_, Docker | Daytona)` sites in run_manifest.rs.
- Promote `fabro_sandbox::redact::redact_auth_url` to pub and reuse it;
  delete the duplicate `redact_remote_output` in run_manifest.rs.
- Inline the one-liner `preflight_docker_config` /
  `preflight_daytona_config` helpers and drop their dedicated tests.
- Type the `prepared_and_resolved_for_sandbox` test helper with
  `SandboxProvider` instead of `&str`.
- Drop git ls-remote preflight timeout from 30s to 10s.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 15:45:37 -04:00
Bryan Helmkamp
93034e2ec5
perf(run): skip implicit preflight 2026-04-29 14:47:37 -04:00
Bryan Helmkamp
fa2cb2a839
feat(preflight): show spinner while server runs checks
`fabro preflight` blocks on a single server-side `run_preflight` call.
Without feedback the terminal sits blank until it returns. Mirror the
existing `fabro doctor` spinner (cyan braille, "Running checks...",
80ms tick), gated on `!ctx.json_output()` so JSON and piped callers
stay clean. The network calls run inside an inline async block so the
spinner is `finish_and_clear`ed before any `?`-propagated error
prints.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 14:41:05 -04:00
Bryan Helmkamp
cebdf8dee5
Merge remote-tracking branch 'origin/main' into pr-176
# Conflicts:
#	lib/crates/fabro-cli/src/manifest_builder.rs
#	lib/crates/fabro-server/src/run_manifest.rs
2026-04-29 12:45:33 -04:00
Bryan Helmkamp
786e01c7a7
refactor(manifest): type bundle paths end-to-end
Introduce ManifestPath as the canonical in-memory key for run manifests so CLI-produced bundle keys and workflow/server consumers share the same normalization rules. Validate wire keys at the server boundary and add a CLI-to-server round-trip test for user-global @path references.
2026-04-29 12:26:39 -04:00
Bryan Helmkamp
0719e321b1
chore(lint): satisfy workspace clippy 2026-04-29 11:48:22 -04:00
Bryan Helmkamp
6cb185b858
feat(github): point install errors at the configured app and require creds for docker
GitHubAppCredentials now carries the configured app slug, so the "not
installed" error from the installation lookup links to the specific
app's install page (https://github.com/organizations/{owner}/settings/apps/{slug}/installations)
when known, instead of the generic org installations page. Threaded
through the server, workflow pipeline, and CLI runner.

Also treat docker like daytona for GitHub credential gating: both are
clone-based providers that need an installation token to fetch the repo,
so a docker run now requires credentials when daytona would.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:43:00 -04:00
Bryan Helmkamp
d58c45fe80
fix(auth): clarify dev-token login recovery
Format the dev-token-only login failure as an action block and include the resolved --server value in the recovery command.
2026-04-29 08:20:21 -04:00
Bryan Helmkamp
85c763d511
fix(cli): persist auth login target
When auth login succeeds and no CLI target is configured, write the resolved server target to settings.toml so later CLI commands can reuse it.
2026-04-29 08:02:50 -04:00
Bryan Helmkamp
f676fa779b
fix(ci): clean up clippy warnings and refresh CLI docs
Drop async from validate::run after the preflight refactor removed all
awaits, replace absolute paths and a one-liner helper in
manifest_validation, swap a redundant to_path_buf for clone in a test,
and regenerate cli.mdx so docs check stays green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 01:03:16 -04:00
Bryan Helmkamp
788b389e4c
test(cli): prune slow integration outliers
Some checks are pending
Rust / Format (push) Waiting to run
Rust / Clippy (push) Waiting to run
Rust / Generated Docs (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
Replace remaining expensive CLI lifecycle checks with seeded fixtures or focused unit coverage so the concurrent suite spends less time on duplicate full-process setup.
2026-04-28 19:26:27 -07:00
Bryan Helmkamp
4ce07aac17
test(cli): trim slow integration fixture setup
Seed read-only CLI tests from run-store fixtures, remove duplicate expensive lifecycle coverage, and keep machine-dependent gh tests offline so the suite no longer probes local credentials.
2026-04-28 19:14:56 -07:00
Bryan Helmkamp
4ca8962a02
fix(cli): keep validate off runtime preflight
Add a validation-only API response and route while keeping fabro validate local so it does not start or contact the server for structural workflow checks.
2026-04-28 14:50:04 -07:00
Bryan Helmkamp
2cbd3768b8
fix(cli): prevent manifest git push prompts
Disable terminal prompts for manifest pre-run push attempts and cover the behavior with an offline remote-helper regression test.
2026-04-28 14:36:27 -07:00
Bryan Helmkamp
642e312cca
refactor: unify duplicate API types via with_replacement
Eliminate four parallel-type duplications between fabro-api generated
DTOs and fabro-types canonical types. The wire shape is owned by
OpenAPI; canonical types are reused via fabro-api/build.rs
with_replacement so the adapter functions and silent unwrap_or_default
defaults disappear.

- SecretType moves to fabro-types (was fabro-vault); deletes
  secret_type_from_api adapter.
- DiffLineStats renamed to DiffStats, moved to fabro-types, switched
  u64 -> i64 to match the OpenAPI integer; deletes line_stats_to_api.
- ManifestPreRunPushOutcome rewritten as a oneOf+discriminator
  PreRunPushOutcome over five variant schemas, deleting both
  pre_run_push_outcome_from_manifest and build_manifest_push_outcome.
- ManifestGit and PreRunGitContext unify as GitContext: dirty:
  DirtyStatus replaces clean: bool (preserving the Unknown state
  previously truncated on the wire), sha becomes Option<String>, and
  origin_url/branch fold into the unified context. RunSpec and
  RunCreatedProps flatten three fields (repo_origin_url, base_branch,
  pre_run_git) into a single git: Option<GitContext>.

Each replacement gets a fabro-api parity test (TypeId equality plus
JSON roundtrip) modeled on run_summary_round_trip.rs. TS client
regenerated.

Greenfield app, no production deployments — wire contract changed
directly without backwards-compat shims.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 12:29:37 -07:00
Bryan Helmkamp
20e161bc07
refactor: rename checkpoints_disabled -> in_place
The persisted bool described user intent (\"the user opted into the
in-place execution mode\"), not a literal consequence -- SlateDB and
event-sourced checkpoints flow regardless of the flag, only git
checkpoints are skipped. Renaming aligns the name with intent and
decouples it from any future implementation that allows git
checkpoints in-place.

The fork validator still consults this bool to bail out with a clear
error before searching for git checkpoints that won't exist.
2026-04-28 09:33:59 -07:00
Bryan Helmkamp
3f027be220
refactor: route --in-place through worktree_mode override
Drop --allow-no-checkpoints and the paired ManifestArgs in_place /
allow_no_checkpoints fields. The CLI now translates --in-place into a
single ManifestArgs.worktree_mode = "never" signal that flows through
the existing args→layer pipeline as run.sandbox.local.worktree_mode =
Never. The server computes prepared.in_place from the resolved settings
once, replacing the trio of bail!s and the sandbox-default fixup.
2026-04-28 08:44:54 -07:00
Bryan Helmkamp
b24c67acef
fix: handle non-git local sandbox runs
Skip worktree checkpoint setup when a local sandbox is not backed by a git repository, and keep the API contract aligned with RunSpec serialization for omitted labels.
2026-04-28 08:22:58 -07:00
Bryan Helmkamp
ab9b28875b
fix: close sandbox-native metadata gaps
Ensure local runs use the worktree checkpoint path by default, expose source and sandbox paths in API/web surfaces, and remove dead fork/rewind push controls. Update docs for clone-based sandboxes and durable checkpoint timelines.
2026-04-28 08:05:18 -07:00
Bryan Helmkamp
80aad30f73
fix: close sandbox-native git metadata gaps
Add shared sandbox git validation for checkpoint paths, preserve forked run projection state, and record CLI remote mismatches explicitly. Refresh the API/client docs for durable run-store timeline and structured run specs.
2026-04-28 07:31:01 -07:00
Bryan Helmkamp
cdd46b4fa8
Make git metadata sandbox-native 2026-04-27 21:43:15 -07:00
Bryan Helmkamp
ca854f9033
chore: rename run span field run_id to id
The span name "run" already namespaces the field, so `run{id=...}` reads
cleaner than `run{run_id=...}` in log output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 16:09:54 -07:00
Bryan Helmkamp
50847ebc6f
fix(sandbox): preserve error chains
Introduce typed sandbox errors and carry source causes through workflow events, persisted failure summaries, and API/CLI string boundaries so Docker client failures keep the actionable underlying cause.
2026-04-27 10:41:39 -07:00
Bryan Helmkamp
f0d34f6e87
Make Rust tests independent of SPA assets 2026-04-27 08:17:37 -07:00
Bryan Helmkamp
d2d962f201
Merge remote-tracking branch 'origin/main' 2026-04-27 07:01:53 -07:00
Bryan Helmkamp
44d1d7f5e2
refactor(api): reuse run summary domain type 2026-04-26 23:28:04 -04:00
Bryan Helmkamp
cb0bab233a
refactor(types): use trait conversions directly
Remove redundant as_str/from helper methods on provider, reasoning, model-test, safe URL, and interview types. Migrate call sites to Display, IntoStaticStr, and FromStr while keeping wire-format coverage in tests.
2026-04-26 21:36:24 -04:00
Bryan Helmkamp
498242f4f7
refactor(sandbox): drop dead helpers and tidy clone-based code
- Delete unused `detect_clone_params` and `GitCloneParams` (the clone-based refactor sources clone params from the run spec, not the worker cwd).
- Add `DaytonaSandbox::repo_cloned()` accessor mirroring Docker; replace five inline `OnceCell` reads.
- Inline `sanitize_origin_url` one-liner wrapper in `manifest_builder`.
- Drop unused `pub` on `docker::WORKING_DIRECTORY`.
- Convert `cleanup` early-return to `let-else` and remove a `Some(...).expect(...)` round-trip in `decide_clone`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 19:16:46 -04:00
Bryan Helmkamp
8365a28e7c
test(cli): update attach snapshot for docker defaults 2026-04-26 19:16:02 -04:00
Bryan Helmkamp
3a8e1a0517
refactor(sandbox): make Docker clone-based by default
Switch Docker sandboxes from host bind mounts to per-run clone-based containers with structured run metadata, reconnect validation, archive-based file transfer, and Docker resource defaults.

Extend run config/API surfaces so Docker image and clone settings flow through manifests, server preflight, workflow startup, and generated clients.

Update docs and tests for the new default Docker provider path.
2026-04-26 18:21:02 -04:00
Bryan Helmkamp
583fa1e9d1
refactor(config): share log destination resolution
Move FABRO_LOG_DESTINATION parsing into fabro-config so CLI and server worker startup use the same validation behavior. Worker startup now exports one canonical resolved destination instead of relying on a generic env allowlist path.
2026-04-26 17:47:22 -04:00
Bryan Helmkamp
e6ca9eba87
refactor(cli): rename ServerLogSink to LogSink
The Server prefix is redundant -- the type is used by both Server and
Worker variants of InternalLogSink, and the helper that builds it from a
runtime directory is renamed to log_sink to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 17:36:03 -04:00
Bryan Helmkamp
7abc11adc9
feat(server): route worker logs to the same destination as the parent
Workers are an internal implementation detail; operators should not need
to know about them. When the server runs in stdout mode (FABRO_LOG_DESTINATION=stdout,
e.g. inside containers), workers now also stream their tracing to stdout
so all server-level logs land on the same destination.

The parent propagates its resolved destination to each worker via
FABRO_LOG_DESTINATION and inherits the worker's stdout when the parent is
in stdout mode (so worker stdout flows through to docker logs). The
per-run log at <scratch>/runtime/server.log stays a file regardless --
it is read back by the run UI.

A CLI-side ServerLogSink::{File(PathBuf),Stdout} replaces Option<PathBuf>
so the file/stdout intent is explicit at the type level for both the
Server and Worker sinks. LogDestination gains strum::IntoStaticStr so
the parent can stringify it for the worker env without a hand-written map.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 17:16:03 -04:00
Bryan Helmkamp
3a6ef48e56
Merge remote-tracking branch 'origin/main'
# Conflicts:
#	docs-internal/logging-strategy.md
#	lib/crates/fabro-cli/src/logging.rs
#	lib/crates/fabro-cli/src/main.rs
#	lib/crates/fabro-static/src/env_vars.rs
2026-04-26 16:29:54 -04:00