package check¶
Package check runs the compile-time checks over a parsed stack: reference and type resolution, literal constraint evaluation, and @for-each nesting. The compiler runs every check; a factory binary's validate command re-runs the reference check on demand. Construction builds the stack's dependency graph once, and the graph is shared with whoever goes on to execute the stack.
Types¶
type Checker¶
Checker runs the compile-time checks over parsed, validated factory source. Construction builds the dependency graph and the scope tables for every composite call site once; each check method walks them and returns its own diagnostics. The graph is exposed so callers executing the factory share the structure the checks ran against.
func NewSyntax¶
NewSyntax builds the check state from a typed factory or composite body.
func (*Checker) DAG¶
DAG returns the stack's dependency graph.
func (*Checker) ForEachNesting¶
ForEachNesting reports any node declaring @for-each whose enclosing composite chain already iterates: no fan-out exists for an iteration nested inside another, and a body that never reads @each would otherwise quietly plan a single instance where several were declared. The compile command runs this with every composite body the stack reaches expanded, so the factory binary never holds the construct.
func (*Checker) LiteralConstraints¶
LiteralConstraints reports cross-field constraint violations that are decidable at compile time. It evaluates each library node's fields with no inputs or upstream outputs in scope, applies literal defaults, and checks constraints whose referenced roots are known and valid at compile time. Optional absent fields read as null; missing required roots are left to the required-presence diagnostics. Only Go libraries declare constraints, so a composite call site has none of its own; the nodes inside a composite body are checked against the libraries the body imports.
func (*Checker) References¶
References reports references that cannot resolve to an input binding, node address, or active for-each binding, along with the type errors the resolved schemas expose. A non-nil observe receives every inferred expression with its type; the residual-Unknown harness reads the stream.