fabro/lib/crates/fabro-cli/src
Bryan Helmkamp 2ba04be181
feat(template): add source-aware diagnostics (#292)
## Summary

Template failures from `fabro run` and structural warnings from `fabro
validate` now preserve source provenance through rendering, workflow
transforms, API serialization, and CLI display. Diagnostics can point at
the actual workflow, import, or prompt file with node/attribute context
instead of surfacing MiniJinja's generic `<string>` source.

## What Changed

- Added named MiniJinja render APIs plus miette-aware `TemplateError`
metadata for source names, source text, spans, and labels.
- Reworked workflow template expansion so inline attributes, imported
workflows, and `@prompt` files render with file and owner context.
- Split strict run behavior from structural validate behavior: run-start
still hard-fails on missing inputs, while validate emits source-aware
warnings and continues linting.
- Extended validation diagnostics through Rust structs, OpenAPI, server
DTO mapping, and CLI rendering with optional source path, line, column,
span, and related metadata.
- Added regression coverage across template rendering, workflow
transforms, CLI output, and the server validate endpoint.

## Verification

- `cargo nextest run -p fabro-template`
- `ulimit -n 4096 && cargo nextest run -p fabro-workflow --no-fail-fast`
- `cargo nextest run -p fabro-cli
bare_fabro_with_unbound_inputs_validates_structurally_with_warning
run_rejects_unbound_template_inputs_before_creating_remote_run`
- `cargo nextest run -p fabro-server
validate_endpoint_returns_template_source_coordinates`
- `cargo build -p fabro-api`
- `cargo +nightly-2026-04-14 fmt --check --all`
- `cargo +nightly-2026-04-14 clippy --workspace --all-targets -- -D
warnings`

---

[![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)

---------

Co-authored-by: Aleksi Asikainen <1086393+salieri@users.noreply.github.com>
2026-05-16 18:47:37 -04:00
..
commands feat(template): add source-aware diagnostics (#292) 2026-05-16 18:47:37 -04:00
shared feat(template): add source-aware diagnostics (#292) 2026-05-16 18:47:37 -04:00
sleep_inhibitor fix sleep_inhibitor lints under --all-features clippy 2026-04-23 22:45:07 -04:00
args.rs feat(session): add server-backed agent sessions (#278) 2026-05-16 17:25:05 -04:00
command_context.rs feat(llm): add catalog controls and speed billing (#249) 2026-05-13 14:12:16 -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(template): add source-aware diagnostics (#292) 2026-05-16 18:47:37 -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: remove compatibility shims (#281) 2026-05-16 15:29:25 -04:00
user_config.rs fix(error): preserve source chains across workspace 2026-05-01 17:30:20 -04:00