fabro/test
Bryan Helmkamp 15ff38fa53
feat(template): resolve template error locations (#333)
## Summary

Fixes `fabro-sh/fabro#330` by making template partials that reference
missing inputs validate structurally with a warning instead of failing
the validate command. The template crate now owns MiniJinja semantic
error classification and source-location mapping, so workflow
diagnostics can consume already-resolved template locations instead of
remapping fragment spans itself.

## What Changed

- Added `TemplateErrorLocation` and `TemplateSourceOrigin` APIs to
report source name, line, column, and span from `fabro-template`.
- Classified wrapped MiniJinja errors by their deepest semantic cause,
preserving the original source chain for renderer context.
- Added fragment-origin rendering paths so attribute fragments embedded
in full workflow source report locations in the original source text.
- Removed workflow-side source span remapping from template diagnostics;
workflow now only adds owner, node/edge, severity, rule, and fix
context.
- Added regression coverage for include/import/from/extends undefined
variables and the CLI `fabro validate` partial fixture.

## Test Plan

- `cargo nextest run -p fabro-template`
- `cargo nextest run -p fabro-workflow transforms::variable_expansion
transforms::file_inlining`
- `cargo nextest run -p fabro-cli --test it cmd::validate`
- `cargo +nightly-2026-04-14 fmt --check --all`
- `cargo +nightly-2026-04-14 clippy -p fabro-template -p fabro-workflow
-p fabro-cli --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 (context not reported, reasoning not reported)
via [Codex](https://openai.com/codex)
2026-05-20 20:15:04 -04:00
..
analysis feat(test): add DuckDB diff query for bench-tests CSVs 2026-04-28 09:27:05 -07:00
attractor refactor(types): remove stage status compatibility 2026-04-30 06:48:47 -04:00
bin feat(release): support prerelease builds 2026-04-14 15:43:00 -04:00
docs chore(demo): move simplify prompt to prompts/ alongside graphs 2026-04-30 08:35:48 -04:00
dot-compatibility fix(graph): support dotted Fabro graph attributes (#324) 2026-05-20 09:31:08 -04:00
templated_inputs fix(validate): pick up sibling workflow.toml inputs for bare .fabro path (#242) 2026-05-12 12:05:21 -04:00
templated_unbound_imported fix(validate): treat undefined template vars in @file prompts as warnings (#290) 2026-05-16 17:31:22 -04:00
templated_unbound_partial feat(template): resolve template error locations (#333) 2026-05-20 20:15:04 -04:00
templates fix(workflow): allow workflow-root template partials (#322) 2026-05-20 09:22:28 -04:00
twin refactor(static): centralize env var names 2026-04-24 12:29:51 -04:00
branching.fabro refactor(types): remove stage status compatibility 2026-04-30 06:48:47 -04:00
conditions.fabro refactor(types): remove stage status compatibility 2026-04-30 06:48:47 -04:00
invalid.fabro Rename .dot files to .fabro and update all references 2026-03-13 22:27:19 -04:00
legacy_tool.fabro Rename .dot files to .fabro and update all references 2026-03-13 22:27:19 -04:00
parallel.fabro Attractor spec hunks 14 & 16: remove error_policy and k_of_n/quorum from parallel handler 2026-03-23 14:59:35 -04:00
simple.fabro Rename .dot files to .fabro and update all references 2026-03-13 22:27:19 -04:00
styled.fabro Rename .dot files to .fabro and update all references 2026-03-13 22:27:19 -04:00
templated_unbound.fabro fix(validate): pick up sibling workflow.toml inputs for bare .fabro path (#242) 2026-05-12 12:05:21 -04:00