fabro/lib/crates/fabro-cli/tests/it/cmd
Bryan Helmkamp 41ab919959 feat(settings): stage 6.1 consumer migration builds workspace-wide
Extends the stage 6.1 WIP into a compiling state across the workspace.
Most crates and their unit/integration tests now read run.* / cli.* /
server.* v2 layers directly or through targeted bridge helpers.

Key moves in this commit:

fabro-server
- AppState.settings: Arc<RwLock<SettingsFile>> -- all helpers,
  create_app_state_with_* factories, and tests updated.
- api_server_settings bridges SettingsFile -> legacy Settings via the
  transitional bridge so /api/v1/settings still emits the legacy DTO
  shape until Stage 6.6 replaces it with an allow-list DTO.
- get_system_info, get_system_df, get_github_repo, webhook startup, and
  other read sites use the v2 accessors (github_app_id_str,
  server_web, run_sandbox, run_model_*).
- web_auth.rs wraps each oauth / register / setup-status handler in a
  local `bridged` helper that produces a legacy Settings from the v2
  state, so the complex oauth mutation flow keeps working until its
  Stage 6.6 rewrite.
- diagnostics::check_github_app reads via github_*_str accessors;
  check_crypto bridges to the legacy shape inline.
- serve.rs: load_settings returns SettingsFile; apply_serve_overrides /
  apply_runtime_settings mutate v2 subtrees directly; the config poll
  loop and TLS/webhook startup use bridged() for legacy-shape reads.
- Tests in tests/it/{helpers,api/*,scenario/*} rewritten to construct
  SettingsFile via ConfigLayer::parse or v2 struct literals.

fabro-workflow
- Every test fixture in pipeline/{finalize,initialize,pull_request,retro,
  execute,persist}, operations/{create,rebuild_meta,start}, run_lookup,
  runtime_store, handler/manager_loop, and tests/it/{integration,
  daytona_integration}.rs now uses SettingsFile.
- start.rs hooks into the bridge helpers directly via use-imports.
- run_graph / run_graph_from_checkpoint / initialize / finalize /
  pull_request calls are Box::pin'd to stay under clippy's large-future
  threshold after the v2 tree brought RunOptions size up.
- resolve_run_settings writes resolved model/provider back into
  run.model as InterpStrings; tests assert via run_model_*_str().
- preprocess_and_validate pulls vars from run_inputs_as_strings().

fabro-cli
- manifest_builder uses ConfigLayer.combine(...).into() to get a v2
  SettingsFile for the manifest goal resolution path; file-based
  goal_file handling is deferred to 6.6 when the manifest schema catches
  up.
- runner::maybe_build_github_app_credentials and
  tests/it/cmd/{create,runner}.rs read from v2 accessors.
- commands/config/mod.rs::merged_config returns SettingsFile; the
  server-side retrieve_server_settings is bridged via a stopgap
  legacy_settings_to_v2 shim that Stage 6.6 replaces.
- commands/store/dump.rs sample_run_record constructs SettingsFile.

fabro-store, fabro-checkpoint
- Test fixtures constructing RunRecord values updated to SettingsFile.
- fabro-checkpoint/src/author.rs stays (v2 From impl landed in a
  previous additive commit).

fabro-config
- effective_settings.rs rewrite compiles and passes its unit tests.
- project::resolve_working_directory takes &SettingsFile.

Build status: `cargo build --workspace --tests`, `cargo clippy
--workspace -- -D warnings`, and `cargo fmt --check --all` all pass.
`cargo nextest run --workspace` passes 3,749 of 3,764 tests; the 15
remaining failures are fabro-cli integration tests whose snapshot +
TOML fixture shapes still need manual updates:

- cmd::config::* (seven tests): fixture TOML files still use v1
  top-level keys and the snapshot outputs expect the legacy flat JSON
  shape.
- cmd::inspect::* (four tests): run-record JSON snapshots embed the
  flat Settings shape.
- cmd::run::dry_run_persists_event_history_in_store and
  json_run_implies_auto_approve_for_human_gates: check `settings.dry_run
  == Some(true)` directly on the v2 file; should assert
  dry_run_enabled() instead.
- cmd::attach::attach_json_errors_without_prompting_for_human_input:
  unrelated insta snapshot drift caused by the new SettingsFile JSON
  shape leaking into an events-log snapshot.

Follow-up work for this stage also includes:
- Rewriting web_auth.rs register flow to emit v2 TOML directly and to
  re-parse the written file back into state.settings so in-memory
  state doesn't lag the on-disk file.
- Removing the legacy_settings_to_v2 shim in fabro-cli/config once
  the server-side settings endpoint returns v2 shapes (Stage 6.6).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 15:25:59 -04:00
..
artifact_cp.rs perf(cli): reduce slow integration test overhead 2026-04-07 22:57:45 -04:00
artifact_list.rs perf(cli): reduce slow integration test overhead 2026-04-07 22:57:45 -04:00
attach.rs test(migration): land final Stage 4 fixes — 100% workspace tests green 2026-04-09 11:07:18 -04:00
config.rs test(migration): land final Stage 4 fixes — 100% workspace tests green 2026-04-09 11:07:18 -04:00
create.rs feat(settings): stage 6.1 consumer migration builds workspace-wide 2026-04-09 15:25:59 -04:00
diff.rs refactor(scratch): remove store-backed diff and blob cache writes 2026-04-07 22:31:59 -04:00
discord.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
docs.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
doctor.rs perf(cli): reduce slow integration test overhead 2026-04-07 22:57:45 -04:00
exec.rs test(cli): migrate remaining config/exec/create fixtures to v2 2026-04-09 10:11:28 -04:00
fabro.rs fix(cli): restore fabro-cli verification after merge 2026-04-08 16:41:13 -04:00
fork.rs refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
graph.rs refactor(cli): separate local socket and storage defaults 2026-04-06 11:57:14 -04:00
inspect.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
install.rs test(nextest): share one session server by default 2026-04-07 09:44:34 -04:00
json_global.rs test(cli): stabilize ps JSON global flag assertion 2026-04-05 10:34:32 -04:00
logs.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
mod.rs test(cli): add integration tests for fabro uninstall 2026-04-08 16:47:48 -04:00
model.rs test(cli): migrate remaining config/exec/create fixtures to v2 2026-04-09 10:11:28 -04:00
model_list.rs refactor(cli): separate local socket and storage defaults 2026-04-06 11:57:14 -04:00
model_test.rs refactor(cli): separate local socket and storage defaults 2026-04-06 11:57:14 -04:00
parse.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
pr.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
pr_close.rs refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
pr_create.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
pr_list.rs refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
pr_merge.rs refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
pr_view.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
preflight.rs refactor(cli): separate local socket and storage defaults 2026-04-06 11:57:14 -04:00
provider.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
provider_login.rs refactor(cli): separate local socket and storage defaults 2026-04-06 11:57:14 -04:00
ps.rs test(cli): migrate remaining config/exec/create fixtures to v2 2026-04-09 10:11:28 -04:00
repo.rs feat(tests): migrate fabro-cli fixtures and repo fabro.toml to v2 2026-04-09 09:57:30 -04:00
repo_deinit.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
repo_init.rs feat(tests): migrate fabro-cli fixtures and repo fabro.toml to v2 2026-04-09 09:57:30 -04:00
resume.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
rewind.rs refactor(run): store manifests and definitions in global CAS 2026-04-07 22:57:48 -04:00
rm.rs test(cli): migrate remaining config/exec/create fixtures to v2 2026-04-09 10:11:28 -04:00
run.rs test(migration): land final Stage 4 fixes — 100% workspace tests green 2026-04-09 11:07:18 -04:00
runner.rs feat(settings): stage 6.1 consumer migration builds workspace-wide 2026-04-09 15:25:59 -04:00
sandbox_cp.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
sandbox_preview.rs refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
sandbox_ssh.rs refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
secret.rs refactor(cli): separate local socket and storage defaults 2026-04-06 11:57:14 -04:00
secret_list.rs refactor(server): make secrets and operational checks server-canonical 2026-04-05 17:34:01 -04:00
secret_rm.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
secret_set.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
send_analytics.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
send_panic.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
server_start.rs test(migration): land final Stage 4 fixes — 100% workspace tests green 2026-04-09 11:07:18 -04:00
server_status.rs test(nextest): share one session server by default 2026-04-07 09:44:34 -04:00
server_stop.rs test(nextest): share one session server by default 2026-04-07 09:44:34 -04:00
start.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
store.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
store_dump.rs feat(tests): migrate fabro-cli fixtures and repo fabro.toml to v2 2026-04-09 09:57:30 -04:00
support.rs feat(config): switch parser and layering to v2 schema 2026-04-09 09:49:23 -04:00
system.rs feat(system): add server-backed system commands 2026-04-06 16:10:06 -04:00
system_df.rs test(nextest): share one session server by default 2026-04-07 09:44:34 -04:00
system_events.rs test(nextest): share one session server by default 2026-04-07 09:44:34 -04:00
system_info.rs test(nextest): share one session server by default 2026-04-07 09:44:34 -04:00
system_prune.rs test(cli): narrow system prune coverage for speed 2026-04-07 23:42:15 -04:00
test_panic.rs test: speed up slow default-profile tests and tighten nextest thresholds 2026-04-05 13:15:59 -04:00
top_level.rs Move cli.rs and scenario.rs tests into per-subcommand cmd/ files 2026-03-30 11:37:24 -04:00
uninstall.rs test(cli): add integration tests for fabro uninstall 2026-04-08 16:47:48 -04:00
upgrade.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00
validate.rs refactor(cli): separate local socket and storage defaults 2026-04-06 11:57:14 -04:00
wait.rs refactor(scratch): remove stale scratch file refs 2026-04-07 20:40:06 -04:00
workflow.rs feat(tests): migrate fabro-cli fixtures and repo fabro.toml to v2 2026-04-09 09:57:30 -04:00
workflow_create.rs feat(tests): migrate fabro-cli fixtures and repo fabro.toml to v2 2026-04-09 09:57:30 -04:00
workflow_list.rs refactor(cli): deglobalize server and storage target flags 2026-04-05 16:06:42 -04:00