fabro/lib/crates/fabro-cli/src
Bryan Helmkamp 6297b200f7
refactor(run): add rich failure contract (#256)
## Summary

Terminal run failures now use a first-class `RunFailure` contract so
downstream consumers receive structured diagnostics instead of flat
`error` / `causes` / `reason` fields. The wire shape keeps concise
public messages, source-chain causes, classification, optional
actor/signature data, and redacted exec output tail in one nested value.

Refs fabro-sh/fabro#198

## What Changed

- Added `fabro_types::RunFailure` and changed `run.failed` to emit
`properties.failure` with `final_git_commit_sha` for failed-run commit
state.
- Replaced `Conclusion.failure_reason` with `Conclusion.failure` while
leaving stage-level `StageCompletion.failure_reason` untouched.
- Updated workflow internals to preserve owned error source chains until
terminal event projection, then convert them into `RunFailure.causes`.
- Updated store, server, CLI, OpenAPI, and generated TypeScript client
consumers to use the nested failure object.
- Added serialization, OpenAPI replacement, projection, and lifecycle
coverage for the new contract.

## Validation

- `cargo nextest run -p fabro-api -p fabro-types -p fabro-workflow -p
fabro-store -p fabro-server -p fabro-cli`
- `cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D
warnings`
- `cargo +nightly-2026-04-14 fmt --check --all`
- `cd apps/fabro-web && bun run typecheck`
- `cd apps/fabro-web && bun test`
- `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-13 12:32:28 -04:00
..
commands refactor(run): add rich failure contract (#256) 2026-05-13 12:32:28 -04:00
shared feat(cli): add Fabro MCP server (#236) 2026-05-11 18:20:50 -04:00
sleep_inhibitor fix sleep_inhibitor lints under --all-features clippy 2026-04-23 22:45:07 -04:00
args.rs feat(cli): add Fabro MCP server (#236) 2026-05-11 18:20:50 -04:00
command_context.rs feat(cli): add Fabro MCP server (#236) 2026-05-11 18:20:50 -04:00
gh.rs test(cli): trim slow integration fixture setup 2026-04-28 19:14:56 -07:00
landing.rs feat(cli): split run events and raw logs 2026-05-06 13:29:35 -04:00
local_server.rs fix(error): preserve source chains across workspace 2026-05-01 17:30:20 -04:00
logging.rs fix(cli): keep run logs free of ANSI 2026-05-07 07:28:25 -07:00
main.rs feat(cli): add Fabro MCP server (#236) 2026-05-11 18:20:50 -04:00
manifest_args.rs feat(cli): add Fabro MCP server (#236) 2026-05-11 18:20:50 -04:00
server_client.rs fix(cli): bound server readiness probes 2026-05-02 20:13:18 -04:00
server_runs.rs refactor(types): remove legacy run summary shape 2026-05-10 23:29:41 -04:00
user_config.rs fix(error): preserve source chains across workspace 2026-05-01 17:30:20 -04:00