Expand description
Validation — spec §5 (V1-V9) + §5.8 (modes).
validate is the single entry point. Walking the AST
bottom-up, every variant’s V-axiom checks fire; any failure
produces a typed ValidationError. Degenerate-but-defined
compositions emit a ValidationWarning in Permissive mode
and become hard errors in Strict mode.
V4 (per-strategy input-shape contract) fires in two tiers per spec §10.7.8:
- Compile-time best-effort — this module, against the
AST’s static metadata-derived
IndexFn. Fires for every comprehension at parse time; catches shape violations the static estimate can prove. Forcrate::iteration::comprehension::eval_source::EvalClass::Staticsources the static IndexFn equals the runtime IndexFn, so this fire is exact; forContextRequiredsources (Generator without registry recognition, WorkloadParamList) the static estimate may be conservative (usescardinality_hint, orNoneif absent) and the strategy-invocation-time fire below is load-bearing. - Strategy-invocation-time (load-bearing) —
crate::iteration::comprehension::runtime::evaluate_for_iteration’sapply_orderfirescrate::iteration::comprehension::strategies::Strategy::accepts_inputagainst thecrate::iteration::comprehension::eval_source::EvaluatedSource’s actualindex_fnafter source evaluation. This is the definitive V4 check per spec §10.7.8.
Structs§
- Validation
Report - Result of a validation pass.
Enums§
- Mode
- Validation mode per spec §5.8.
- Validation
Error - V-axiom violation. Each variant carries enough context to produce a useful diagnostic at the call site.
- Validation
Warning - Non-blocking warning for degenerate-but-defined compositions per spec §5.8.
Functions§
- validate
- Validate a comprehension AST per spec §5.