Structured output and validation 00:00:01 Forty-two fits the form Nora's checker sees a positive amount and a valid currency code. It turns green. The receipt total below it is twenty-four dollars, yet the proposed refund says forty-two. Which part of the checker should have noticed the transposition? A structured response passes through several gates. The decoder produces text or constrained tokens, the parser constructs a value, and validators check field types and cross-field invariants. A final evidence or business check tests whether this particular value is correct for this particular record. Put the typed amount beside its cited source region. Check the value and the currency against the receipt before accepting the object. Business authorization is one further question if anyone plans to change a ledger. 00:00:54 A schema checks the shape The model returns an object in the requested shape. Syntax is only the first boundary. Types and permitted currencies pass. Domain rules can also reject negative amounts or invalid combinations. Compare the extracted value with the referenced receipt. A schema-valid result is withheld or corrected when the source disagrees. 00:01:16 Find the receipt beneath the number Jay son mode targets parseable Jay son. Schema-constrained output further restricts the shapes and values the generator may return. Parsing and schema validation still cannot verify truth or authorization. A valid amount of 42 is an error if the receipt says 24. The object {"amount":42,"currency":"USD"} can pass syntax and schema checks while failing a comparison to a 24-dollar receipt. A Pydantic model describes fields and validates a decoded object, with configurable coercion and strictness. Express domain invariants as validators where appropriate. Test a string amount, a missing currency and a negative refund explicitly so you know which cases the model rejects and which it normalizes. Test a field constrained to 1 through 5 using 0, 1 and 6. Then test the string “3” under strict and coercing settings. Classify failures before retrying. Invalid syntax, a missing fact and an upstream timeout require different responses. A targeted repair may fix syntax. an absent fact needs a null value or review. Record attempts under one operation ID and apply a finite retry budget. A blank due-date field remains blank after a retry. Treat it as missing evidence rather than spending the entire retry budget seeking a date. A system that accepts perfectly shaped but incorrect amounts is still unsafe to automate. Give extraction, validation and evidence mismatches distinct outcomes so recovery can target the actual cause. 00:03:02 What does a valid object prove? The amount is a valid positive number. Can a successful schema check prove it is the receipt total? Validation can establish a legal shape or range. The relationship between this value and this receipt is an independent evidence check. The form kept an impossible type out. The receipt comparison caught a possible but false value. Record which check failed so a retry fixes the thing that actually went wrong.