Parser AST semantics and IR
The parser recognizes compact imports such as use <io:output>;, named containers, sections and grouped functions. Material V2 tests in crates/ncc-parser/src/lib.rs cover this surface. A historical test name does not override the grammar that the test actually exercises.
The AST preserves the entities needed by analysis: places, functions, types, visibility, flow, layout contracts and material surfaces. Replacing an existing typed representation with an unstructured string defers errors to later phases.
Semantic analysis checks relationships accepted by the language. Signatures require consistent arity and types; references must resolve to the intended symbols; control operations must satisfy their context. Established diagnostics are observable tool behavior.
The IR carries analyzed meaning into later phases. An AST node alone is insufficient: lowering and transformations must preserve its semantics. Tests should inspect the properties that could be lost at those boundaries.
A surface change should include positive and negative fixtures, plus an IR observation when translation can alter the contract. Native-generation changes also require artifact checks and execution where the environment supports it.
Tests should cover destination resolution, signature compatibility and evaluation order using expectations independent of the implementation. Catalog consistency tests should compare declared symbol sets and reject duplicates rather than relying only on a fixed count.