Last reviewed · Nov 5, 2026
Check contracts before deployment and content at runtime
Build-time consistency checks, structured outputs, runtime schemas, and task-specific validation catch different classes of failure.
Check declarations at build time and actual objects at runtime
Prompt assembly verifies manifest references, expected sections, metric/rubric relationships, and input/output declarations. Freshness tests rebuild generated artifacts and check that committed runtime prompts match their sources. These are application build checks. A successful TypeScript compilation alone cannot establish the truth of future model responses. Schemas describe fields, types, bounds, and required structure. JSON Schema is a standard for expressing that shape; Zod supplies the application-side task definitions and validation. The current gateway asks for JSON-object output, which should not be described as strict enforcement of each task schema by the provider. Returned data still passes through the appropriate local parser. Generated-content validation and grade parsing have different tolerance and failure handling. Parseable JSON alone does not establish either a valid task object or a correct linguistic answer.
A build-time contract concerns the program and authored prompt material that will later produce requests. It can verify that referenced primitives exist, that metrics have rubrics, and that generated artifacts remain fresh. Those checks protect consistency in what the application is prepared to ask, but they cannot inspect a model response that has not yet been generated. Runtime validation sees the actual result. It can check data shape and field constraints on the appropriate path. The distinction matters because a parseable JSON object is only one condition: it may still omit required information, carry an unusable value, or fail the task’s declared object shape.
Apply task checks without overstating what they establish
A generated drill can be rejected for unusable sentence characters, visible template notation, reading-length mismatch, missing target word, or failure to match the requested grammar pattern. Word checks include supported separable forms. These conditions make an exercise usable for its declared task. Target containment alone does not prove the target was necessary, and syllable count does not verify every contextual tone. A valid object can contain unnatural Mandarin. A structurally matching sentence can express the wrong nuance. A bounded score can be a mistaken judgment. Behavioral evaluations and concrete failure reports examine those semantic problems. Validation narrows the failure space rather than certifying teaching effectiveness.
An exercise has requirements beyond being a valid object. A word drill must contain the target in a supported form; a pattern drill needs the requested structure; a reading layer needs usable alignment. Rejecting failures at those checks keeps known classes of unsuitable material out of the served queue. The remaining language question is broader. A structurally matching reference can still express the wrong nuance, and a sentence with matching syllable count can still contain a contextual reading error. Behavioral evaluation and concrete reports address those uncertainties. Describing the boundary explicitly makes validation more credible than presenting it as a universal proof of correctness.