fabro/lib/crates/fabro-util/src
Bryan Helmkamp 9837a08929
refactor(install): share persistence pipeline (#332)
## Summary

Unifies installer persistence so CLI and web install paths share the
same file/env/vault primitives, while preserving the CLI's server-API
secret persistence and auth bootstrap behavior.

## What Changed

- Added shared `fabro-install` config writers for installer-owned tagged
enum tables, replacing `server.listen` and `cli.target` atomically so
stale variant fields cannot survive.
- Added `InstallPersistencePlan` for disk-backed settings, server env,
and vault writes/removals with the existing rollback semantics for
settings and vault failures.
- Refactored `fabro install`, `fabro install github`, and
`/install/finish` to use the shared persistence plan where their disk
behavior overlaps.
- Preserved full-install ordering: settings/env first, workflow-visible
secrets through the server API second, and CLI `auth.json` only after
API secret persistence succeeds.
- Preserved web installer failure response fields for leftover and
removed env keys, plus the post-success finish hook/shutdown behavior.

## Test Plan

- `cargo nextest run -p fabro-install`
- `cargo nextest run -p fabro-cli commands::install::tests`
- `cargo nextest run -p fabro-cli --test it cmd::install`
- `cargo nextest run -p fabro-server --features test-support --test it
api::install`
- `cargo +nightly-2026-04-14 fmt --check --all`
- `git diff --check`

---

[![Compound
Engineering](https://img.shields.io/badge/Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)
🤖 Generated with GPT-5 via [Codex](https://openai.com/codex)
2026-05-21 08:04:04 -04:00
..
backoff.rs refactor(unwrap): clean runtime hotspot call sites 2026-04-19 20:48:44 -04:00
browser.rs refactor(static): centralize env var names 2026-04-24 12:29:51 -04:00
check_report.rs refactor(unwrap): clean runtime hotspot call sites 2026-04-19 20:48:44 -04:00
dev_token.rs refactor(install): share persistence pipeline (#332) 2026-05-21 08:04:04 -04:00
env.rs refactor(static): centralize env var names 2026-04-24 12:29:51 -04:00
error.rs feat(errors): add structured failure diagnostics (#277) 2026-05-16 13:25:07 -04:00
exit.rs feat(cli): suggest fabro auth login on auth-required errors 2026-04-22 10:49:22 -04:00
home.rs feat(auth): store dev tokens in auth store 2026-04-24 16:02:36 -04:00
json.rs refactor: remove remaining event json indirection 2026-04-04 13:24:19 -04:00
lib.rs refactor(workflow): share metadata snapshot helpers 2026-04-29 19:43:30 -04:00
path.rs Improve install command output ordering and path display 2026-04-14 15:16:21 -04:00
printer.rs chore(clippy): require reasons on allow attributes 2026-04-19 20:24:24 -04:00
run_log.rs refactor: simplify per-run logs client and handler 2026-04-26 16:06:23 -04:00
session_secret.rs deps: bump rand 0.8 → 0.9 (#163) 2026-04-17 07:57:10 -04:00
terminal.rs fmt: apply nightly rustfmt after merge 2026-04-11 13:43:30 -04:00
text.rs Enable 7 additional pedantic clippy lints 2026-03-29 13:47:08 -04:00
time.rs refactor(workflow): share metadata snapshot helpers 2026-04-29 19:43:30 -04:00
version.rs Move git SHA/build date from fabro-util to fabro-cli build.rs 2026-03-13 15:03:12 -04:00
warnings.rs chore: fix warnings and test stability 2026-04-04 13:31:04 -04:00