Thom Pham
Built at Built with Opus 4.7: a Claude Code hackathon · Apr 21, 2026 · Remote

Modern AI systems can produce outputs that are perfectly structured—and completely wrong. This demo highlights a failure mode where models prioritize schema compliance over input fidelity. When a constraint is violated—such as requesting twelve tickets when the schema allows a maximum of four—the model often adjusts the input to fit, rather than rejecting it. The result is valid JSON that appears correct but is not grounded in the original request. This is not a reasoning failure. It is a constraint handling failure. The demo was originally designed as a retry loop, but I shifted toward robustness under messy input once Opus 4.7 handled most clean cases in a single pass. ValidJson uses a minimal stack: five rules, one system prompt, and a JSON Schema validator. Instead of always producing an answer, it enforces refusal when constraints cannot be satisfied. Valid JSON guarantees structure—not truth. Refuse > Invent.