08 — AI Consumption & Integration

Validation Layer


AI-generated IDL output MUST be validated against the compiler before being accepted into a design system. The validation layer provides a lightweight schema-only validation mode suitable for CI integration. It performs schema structural validation and token tier reference checking without executing the full Transform phase. It is a mandatory prerequisite, not an optional quality gate.

Validation Layer vs. Full Compilation

CheckValidation LayerFull Compilation
JSON schema structural validityYesYes
Token tier reference rulesYesYes
Alias chain resolution and depthYesYes
Slot graph acyclicityNo — requires full ASTYes
State machine completenessNo — requires full ASTYes
Composition rule complianceNo — requires full ASTYes
Platform emitter compatibilityNoYes (per target)

Validation Layer in CI/CD

The validation layer is designed to run in CI/CD pipelines on AI-generated output before that output is committed to the IDL source tree or submitted for full compilation. It exits with code 0 on valid output, 2 on invalid output. JSON-format error reporting is available via --reporter json. The validation layer is distributed as a separate package from the full compiler to minimize CI dependency weight.

Acceptance Criteria

AI-generated output passes the validation layer MUST then pass full compilation before it is accepted into the design system. Passing the validation layer does not constitute acceptance — it is a necessary but not sufficient condition. The full compiler's conformance evaluation is the final acceptance gate. No AI-generated output bypasses full compilation under any operational condition.