mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-20 00:11:34 +00:00
## 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` --- [](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>
24 lines
692 B
Rust
24 lines
692 B
Rust
use fabro_graphviz::graph::Graph;
|
|
|
|
use crate::error::Error;
|
|
|
|
/// A transform that modifies the pipeline graph after parsing and before
|
|
/// validation.
|
|
pub trait Transform {
|
|
fn apply(&self, graph: Graph) -> Result<Graph, Error>;
|
|
}
|
|
|
|
mod file_inlining;
|
|
mod import;
|
|
mod model_resolution;
|
|
mod preamble;
|
|
pub mod stylesheet;
|
|
mod stylesheet_application;
|
|
pub mod variable_expansion;
|
|
|
|
pub use file_inlining::{FileInliningTransform, resolve_file_ref};
|
|
pub use import::ImportTransform;
|
|
pub use model_resolution::ModelResolutionTransform;
|
|
pub use preamble::PreambleTransform;
|
|
pub use stylesheet_application::StylesheetApplicationTransform;
|
|
pub use variable_expansion::{RenderMode, TemplateTransform};
|