Make structured LLM responses fail with precise, auditable contract diagnostics
and remove drift between the response schema sent to a provider, the published
JSON Schema and runtime validation. Start with the experimental semantic
reranker because ticket-005 measured three different provider violations on a
tracked repository.
Executable implementation belongs in src/, regression coverage in test/
and optional live reproducers in scripts/research/. This ticket directory is
limited to governance, decisions, logs and captured evidence.
Acceptance criteria
AC-01: One canonical structural definition supplies or verifies the
provider response schema, published JSON Schema and TypeScript-facing shape.
AC-02: Runtime validation reports the exact failing property and response
identity without persisting source payloads or secrets.
Decision: approved to investigate and continue subsequent todo2code
tickets
Evidence: current user instruction
Date: 2026-07-31
The agent deliberately does not materialize that decision as a human-authored
participant file. A human or trusted intake boundary must do so.
Conclusion
The conformance hardening is retained; semantic production enablement remains
rejected. The provider schema, runtime validator and TypeScript shape now share
one internal definition, while full verification checks it against the
published result schema. Diagnostics identify the exact property plus provider,
resolved model and response ID without retaining the raw response.
Neither tested route met the contract. qwen/qwen3.7-plus produced three
different envelope/type violations in ticket-005.
qwen/qwen3.7-flash added the forbidden property
response.decisions[0].decision. Both failed before graph mutation. No
reranker was exported or enabled.