{"schemaVersion":1,"id":"https://lucioduran.com/projects/structured-output-contracts","url":"https://lucioduran.com/projects/structured-output-contracts","title":"Structured Output Contracts","description":"Bounded JSON contracts with strict validation, explicit refusals and limited retries. Separates validity from correctness using two local Qwen models and preserved raw responses.","language":"en","datePublished":"2026-10-22","dateModified":"2026-10-22","contentFormat":"text/markdown","content":"[Projects](<https://lucioduran.com/projects>) / Structured Output Contracts\n\n# Structured Output Contracts\n\nBounded JSON contracts with strict validation, explicit refusals and limited retries. Separates validity from correctness using two local Qwen models and preserved raw responses.\n\nAuthor: [Lucio Durán](<https://lucioduran.com/>) · Python 3.11.13 · License: [MIT](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/LICENSE>)\n\nPage published: 2026-10-22 · Page updated: 2026-10-22\n\n[Repository](<https://github.com/lucioduran/structured-output-contracts>) · [Original evidence](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/manifest.json>) · [Release v0.1.0](<https://github.com/lucioduran/structured-output-contracts/releases/tag/v0.1.0>)\n\n## Problem and relevance to agents\n\nValid JSON can contain a false answer. Truncation, refusal and schema violation are also different failures. Collapsing them into one success rate hides the actual behavior.\n\nThe project implements a boundary between generation and data consumption: classify each attempt, bound retries and preserve invalid responses for inspection.\n\n## Architecture\n\n1. **Bounded schemas.** Nested objects, discriminated unions and string/array limits in a JSON Schema Draft 2020-12 subset. Strict parsing rejects malformed inputs without silent repair.\n2. **Explicit policy.** Accept, recognize an explicit refusal, retry or exhaust the budget. The experiment permits two attempts per task and uses actual finish metadata.\n3. **Separate evaluation.** Revision-pinned Qwen2-0.5B-Instruct and Qwen2.5-0.5B-Instruct generate locally. Semantic correctness is scored separately, without using gold labels to decide retries.\n\n- [Design and methodology](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/design.md>)\n\n## What this demonstrates\n\n- Bounded contracts with explicit refusal and truncation handling.\n- Per-schema accounting of attempts, tokens, time and validity separately from correctness.\n- Preserved raw failures and policy replay against frozen traces.\n\n## Published results\n\nTwelve held-out tasks per model, four per schema family. CPU float32 measurement on Intel Xeon W-3223 with four threads. Qwen2 and Qwen2.5 in the table denote their 0.5B Instruct releases.\n\nArrows compare initial attempts and final outcomes. Validity and correctness use all tasks as their denominator, including expected abstentions. Task latency includes all attempts and excludes model loading.\n\n### Results by model and schema\n\n| Model / schema | Valid: first → final | Correct: first → final | Retries | Median (s) | Maximum (s) |\n| --- | --- | --- | --- | --- | --- |\n| Qwen2 / bounded | 1/4 → 2/4 | 2/4 → 3/4 | 2 | 1.405 | 3.806 |\n| Qwen2 / nested | 0/4 → 0/4 | 0/4 → 0/4 | 1 | 1.336 | 2.155 |\n| Qwen2 / union | 0/4 → 0/4 | 1/4 → 1/4 | 0 | 0.890 | 1.010 |\n| Qwen2.5 / bounded | 0/4 → 0/4 | 0/4 → 1/4 | 4 | 2.005 | 2.745 |\n| Qwen2.5 / nested | 3/4 → 3/4 | 3/4 → 3/4 | 1 | 2.676 | 2.866 |\n| Qwen2.5 / union | 3/4 → 3/4 | 2/4 → 2/4 | 1 | 1.607 | 3.423 |\n\nQwen2 ended with 2/12 schema-valid responses and 4/12 correct outcomes, including two correct abstentions. Qwen2.5 reached 6/12 and 6/12 with one correct abstention. Qwen2.5 also fabricated a zero count that passed the schema: structural validation does not verify facts.\n\nThe 33 real attempts include 12 refusals, seven malformed responses, four schema violations and two truncations. Fourteen injected fixtures are separate policy controls, not additional model samples. [Error analysis](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/error-analysis.md>).\n\n## Reproduce\n\nReplay installs validation dependencies without models. Neural reproduction downloads approximately 1.9 GiB of public snapshots and uses the measured Intel macOS dependency lock.\n\nRun the replay block first to create and activate the environment. Use fresh output directories and one measurement at a time. Original responses are neither repaired nor replaced.\n\n### Replay saved evidence\n\n```\ngit clone https://github.com/lucioduran/structured-output-contracts.git\ncd structured-output-contracts\ngit checkout ac8680a5b15731932da446694b8a0a5ced00d12a\npython3.11 -m venv .venv\n. .venv/bin/activate\npython -m pip install -r requirements-dev.txt\npython -m contracts verify --output results/dev\npython -m contracts verify --output results/eval\n```\n\n### Repeat the local measurement\n\n```\npython -m pip install -r requirements-local.lock\npython -m contracts download\nOMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 python -m contracts run --split dev --output build/reproduced-dev\nOMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 python -m contracts run --split eval --output build/reproduced-eval\npython -m contracts verify --output build/reproduced-dev\npython -m contracts verify --output build/reproduced-eval\npython -m scripts.injected --output build/injected.json\n```\n\n## Scope and limitations\n\n- Two small models in one family and twelve tasks per model do not establish production reliability or a general ranking. No independent human review was performed.\n- Evaluation covers prompted JSON with validation and retries, not grammar-constrained decoding or hosted structured-output products.\n- Exact JSON equality is conservative, not a general factuality metric. Structural bounds do not provide a hard timeout or sandbox.\n- One timing observation per task. Paid API cost: USD 0; electricity, hardware and operator time were not measured.\n\n- [Function calling and agent output contracts](<https://lucioduran.com/blog/llm-function-calling-tool-use-patterns>)\n\n## Sources and revision\n\nValues on this page come from the linked report. They are not live measurements. The report records the executed revision; the reviewed revision includes the subsequent publication of that report.\n\n- Reviewed revision: [` ac8680a5b15731932da446694b8a0a5ced00d12a `](<https://github.com/lucioduran/structured-output-contracts/commit/ac8680a5b15731932da446694b8a0a5ced00d12a>)\n- Revision recorded by the experiment: [` b73bec6fab382a96691e91a8b39af1491f53da0d `](<https://github.com/lucioduran/structured-output-contracts/commit/b73bec6fab382a96691e91a8b39af1491f53da0d>)\n- Report timestamp (UTC): 2026-10-21T22:58:44.050791+00:00\n- Release published: [v0.1.0](<https://github.com/lucioduran/structured-output-contracts/releases/tag/v0.1.0>) · 2026-10-21T23:02:50Z\n\n- [README and usage](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/README.md>)\n- [Original evidence](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/manifest.json>)\n- [Results summary](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/summary.json>)\n- [Original responses and traces](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/trace.jsonl>)\n- [Development evidence](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/dev/manifest.json>)\n- [Design and methodology](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/design.md>)\n- [Error analysis](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/error-analysis.md>)\n- [Data and provenance](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/data/README.md>)\n- [Frozen configuration](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/data/freeze.json>)\n- [Models, revisions and licenses](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/model-notices.md>)\n- [Measured environment dependencies](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/requirements-local.lock>)\n- [MIT license](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/LICENSE>)","headings":[{"level":1,"text":"Structured Output Contracts","url":"https://lucioduran.com/projects/structured-output-contracts#title"},{"level":2,"text":"Problem and relevance to agents","url":"https://lucioduran.com/projects/structured-output-contracts#problem"},{"level":2,"text":"Architecture","url":"https://lucioduran.com/projects/structured-output-contracts#architecture"},{"level":2,"text":"What this demonstrates","url":"https://lucioduran.com/projects/structured-output-contracts#demonstrates"},{"level":2,"text":"Published results","url":"https://lucioduran.com/projects/structured-output-contracts#results"},{"level":3,"text":"Results by model and schema","url":"https://lucioduran.com/projects/structured-output-contracts#results-contracts"},{"level":2,"text":"Reproduce","url":"https://lucioduran.com/projects/structured-output-contracts#reproduce"},{"level":3,"text":"Replay saved evidence","url":"https://lucioduran.com/projects/structured-output-contracts#reproduce-replay"},{"level":3,"text":"Repeat the local measurement","url":"https://lucioduran.com/projects/structured-output-contracts#reproduce-inference"},{"level":2,"text":"Scope and limitations","url":"https://lucioduran.com/projects/structured-output-contracts#scope"},{"level":2,"text":"Sources and revision","url":"https://lucioduran.com/projects/structured-output-contracts#sources"}],"sections":[{"heading":"Structured Output Contracts","level":1,"url":"https://lucioduran.com/projects/structured-output-contracts","content":"[Projects](<https://lucioduran.com/projects>) / Structured Output Contracts"},{"heading":"Structured Output Contracts","level":1,"url":"https://lucioduran.com/projects/structured-output-contracts#title","content":"Bounded JSON contracts with strict validation, explicit refusals and limited retries. Separates validity from correctness using two local Qwen models and preserved raw responses.\n\nAuthor: [Lucio Durán](<https://lucioduran.com/>) · Python 3.11.13 · License: [MIT](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/LICENSE>)\n\nPage published: 2026-10-22 · Page updated: 2026-10-22\n\n[Repository](<https://github.com/lucioduran/structured-output-contracts>) · [Original evidence](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/manifest.json>) · [Release v0.1.0](<https://github.com/lucioduran/structured-output-contracts/releases/tag/v0.1.0>)"},{"heading":"Problem and relevance to agents","level":2,"url":"https://lucioduran.com/projects/structured-output-contracts#problem","content":"Valid JSON can contain a false answer. Truncation, refusal and schema violation are also different failures. Collapsing them into one success rate hides the actual behavior.\n\nThe project implements a boundary between generation and data consumption: classify each attempt, bound retries and preserve invalid responses for inspection."},{"heading":"Architecture","level":2,"url":"https://lucioduran.com/projects/structured-output-contracts#architecture","content":"1. **Bounded schemas.** Nested objects, discriminated unions and string/array limits in a JSON Schema Draft 2020-12 subset. Strict parsing rejects malformed inputs without silent repair.\n2. **Explicit policy.** Accept, recognize an explicit refusal, retry or exhaust the budget. The experiment permits two attempts per task and uses actual finish metadata.\n3. **Separate evaluation.** Revision-pinned Qwen2-0.5B-Instruct and Qwen2.5-0.5B-Instruct generate locally. Semantic correctness is scored separately, without using gold labels to decide retries.\n\n- [Design and methodology](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/design.md>)"},{"heading":"What this demonstrates","level":2,"url":"https://lucioduran.com/projects/structured-output-contracts#demonstrates","content":"- Bounded contracts with explicit refusal and truncation handling.\n- Per-schema accounting of attempts, tokens, time and validity separately from correctness.\n- Preserved raw failures and policy replay against frozen traces."},{"heading":"Published results","level":2,"url":"https://lucioduran.com/projects/structured-output-contracts#results","content":"Twelve held-out tasks per model, four per schema family. CPU float32 measurement on Intel Xeon W-3223 with four threads. Qwen2 and Qwen2.5 in the table denote their 0.5B Instruct releases.\n\nArrows compare initial attempts and final outcomes. Validity and correctness use all tasks as their denominator, including expected abstentions. Task latency includes all attempts and excludes model loading."},{"heading":"Results by model and schema","level":3,"url":"https://lucioduran.com/projects/structured-output-contracts#results-contracts","content":"| Model / schema | Valid: first → final | Correct: first → final | Retries | Median (s) | Maximum (s) |\n| --- | --- | --- | --- | --- | --- |\n| Qwen2 / bounded | 1/4 → 2/4 | 2/4 → 3/4 | 2 | 1.405 | 3.806 |\n| Qwen2 / nested | 0/4 → 0/4 | 0/4 → 0/4 | 1 | 1.336 | 2.155 |\n| Qwen2 / union | 0/4 → 0/4 | 1/4 → 1/4 | 0 | 0.890 | 1.010 |\n| Qwen2.5 / bounded | 0/4 → 0/4 | 0/4 → 1/4 | 4 | 2.005 | 2.745 |\n| Qwen2.5 / nested | 3/4 → 3/4 | 3/4 → 3/4 | 1 | 2.676 | 2.866 |\n| Qwen2.5 / union | 3/4 → 3/4 | 2/4 → 2/4 | 1 | 1.607 | 3.423 |\n\nQwen2 ended with 2/12 schema-valid responses and 4/12 correct outcomes, including two correct abstentions. Qwen2.5 reached 6/12 and 6/12 with one correct abstention. Qwen2.5 also fabricated a zero count that passed the schema: structural validation does not verify facts.\n\nThe 33 real attempts include 12 refusals, seven malformed responses, four schema violations and two truncations. Fourteen injected fixtures are separate policy controls, not additional model samples. [Error analysis](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/error-analysis.md>)."},{"heading":"Reproduce","level":2,"url":"https://lucioduran.com/projects/structured-output-contracts#reproduce","content":"Replay installs validation dependencies without models. Neural reproduction downloads approximately 1.9 GiB of public snapshots and uses the measured Intel macOS dependency lock.\n\nRun the replay block first to create and activate the environment. Use fresh output directories and one measurement at a time. Original responses are neither repaired nor replaced."},{"heading":"Replay saved evidence","level":3,"url":"https://lucioduran.com/projects/structured-output-contracts#reproduce-replay","content":"```\ngit clone https://github.com/lucioduran/structured-output-contracts.git\ncd structured-output-contracts\ngit checkout ac8680a5b15731932da446694b8a0a5ced00d12a\npython3.11 -m venv .venv\n. .venv/bin/activate\npython -m pip install -r requirements-dev.txt\npython -m contracts verify --output results/dev\npython -m contracts verify --output results/eval\n```"},{"heading":"Repeat the local measurement","level":3,"url":"https://lucioduran.com/projects/structured-output-contracts#reproduce-inference","content":"```\npython -m pip install -r requirements-local.lock\npython -m contracts download\nOMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 python -m contracts run --split dev --output build/reproduced-dev\nOMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 python -m contracts run --split eval --output build/reproduced-eval\npython -m contracts verify --output build/reproduced-dev\npython -m contracts verify --output build/reproduced-eval\npython -m scripts.injected --output build/injected.json\n```"},{"heading":"Scope and limitations","level":2,"url":"https://lucioduran.com/projects/structured-output-contracts#scope","content":"- Two small models in one family and twelve tasks per model do not establish production reliability or a general ranking. No independent human review was performed.\n- Evaluation covers prompted JSON with validation and retries, not grammar-constrained decoding or hosted structured-output products.\n- Exact JSON equality is conservative, not a general factuality metric. Structural bounds do not provide a hard timeout or sandbox.\n- One timing observation per task. Paid API cost: USD 0; electricity, hardware and operator time were not measured.\n\n- [Function calling and agent output contracts](<https://lucioduran.com/blog/llm-function-calling-tool-use-patterns>)"},{"heading":"Sources and revision","level":2,"url":"https://lucioduran.com/projects/structured-output-contracts#sources","content":"Values on this page come from the linked report. They are not live measurements. The report records the executed revision; the reviewed revision includes the subsequent publication of that report.\n\n- Reviewed revision: [` ac8680a5b15731932da446694b8a0a5ced00d12a `](<https://github.com/lucioduran/structured-output-contracts/commit/ac8680a5b15731932da446694b8a0a5ced00d12a>)\n- Revision recorded by the experiment: [` b73bec6fab382a96691e91a8b39af1491f53da0d `](<https://github.com/lucioduran/structured-output-contracts/commit/b73bec6fab382a96691e91a8b39af1491f53da0d>)\n- Report timestamp (UTC): 2026-10-21T22:58:44.050791+00:00\n- Release published: [v0.1.0](<https://github.com/lucioduran/structured-output-contracts/releases/tag/v0.1.0>) · 2026-10-21T23:02:50Z\n\n- [README and usage](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/README.md>)\n- [Original evidence](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/manifest.json>)\n- [Results summary](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/summary.json>)\n- [Original responses and traces](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/trace.jsonl>)\n- [Development evidence](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/dev/manifest.json>)\n- [Design and methodology](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/design.md>)\n- [Error analysis](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/error-analysis.md>)\n- [Data and provenance](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/data/README.md>)\n- [Frozen configuration](<https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/data/freeze.json>)\n- [Models, revisions and licenses](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/model-notices.md>)\n- [Measured environment dependencies](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/requirements-local.lock>)\n- [MIT license](<https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/LICENSE>)"}],"links":[{"text":"Projects","url":"https://lucioduran.com/projects"},{"text":"Lucio Durán","url":"https://lucioduran.com/"},{"text":"MIT","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/LICENSE"},{"text":"Repository","url":"https://github.com/lucioduran/structured-output-contracts"},{"text":"Original evidence","url":"https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/manifest.json"},{"text":"Release v0.1.0","url":"https://github.com/lucioduran/structured-output-contracts/releases/tag/v0.1.0"},{"text":"Design and methodology","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/design.md"},{"text":"Results summary","url":"https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/summary.json"},{"text":"Error analysis","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/error-analysis.md"},{"text":"Function calling and agent output contracts","url":"https://lucioduran.com/blog/llm-function-calling-tool-use-patterns"},{"text":"ac8680a5b15731932da446694b8a0a5ced00d12a","url":"https://github.com/lucioduran/structured-output-contracts/commit/ac8680a5b15731932da446694b8a0a5ced00d12a"},{"text":"b73bec6fab382a96691e91a8b39af1491f53da0d","url":"https://github.com/lucioduran/structured-output-contracts/commit/b73bec6fab382a96691e91a8b39af1491f53da0d"},{"text":"v0.1.0","url":"https://github.com/lucioduran/structured-output-contracts/releases/tag/v0.1.0"},{"text":"README and usage","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/README.md"},{"text":"Original responses and traces","url":"https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/trace.jsonl"},{"text":"Development evidence","url":"https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/dev/manifest.json"},{"text":"Data and provenance","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/data/README.md"},{"text":"Frozen configuration","url":"https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/data/freeze.json"},{"text":"Models, revisions and licenses","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/model-notices.md"},{"text":"Measured environment dependencies","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/requirements-local.lock"},{"text":"MIT license","url":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/LICENSE"}],"structuredData":[{"@context":"https://schema.org","@graph":[{"@type":"Person","@id":"https://lucioduran.com/#person","name":"Lucio Durán","url":"https://lucioduran.com/"},{"@type":"WebSite","@id":"https://lucioduran.com/#website","url":"https://lucioduran.com/","name":"Lucio Durán","inLanguage":["en","es"],"publisher":{"@id":"https://lucioduran.com/#person"}},{"@type":"WebPage","@id":"https://lucioduran.com/projects/structured-output-contracts#page","url":"https://lucioduran.com/projects/structured-output-contracts","name":"Structured Output Contracts","description":"Bounded JSON contracts with strict validation, explicit refusals and limited retries. Separates validity from correctness using two local Qwen models and preserved raw responses.","inLanguage":"en","author":{"@id":"https://lucioduran.com/#person"},"publisher":{"@id":"https://lucioduran.com/#person"},"isPartOf":{"@id":"https://lucioduran.com/#website"},"isAccessibleForFree":true,"mainEntity":{"@id":"https://lucioduran.com/projects/structured-output-contracts#software"},"datePublished":"2026-10-22","dateModified":"2026-10-22","breadcrumb":{"@id":"https://lucioduran.com/projects/structured-output-contracts#breadcrumb"}},{"@type":"SoftwareSourceCode","@id":"https://lucioduran.com/projects/structured-output-contracts#software","name":"Structured Output Contracts","description":"Bounded JSON contracts with strict validation, explicit refusals and limited retries. Separates validity from correctness using two local Qwen models and preserved raw responses.","url":"https://lucioduran.com/projects/structured-output-contracts","codeRepository":"https://github.com/lucioduran/structured-output-contracts","programmingLanguage":"Python","runtimePlatform":"Python 3.11.13","license":"https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/LICENSE","version":"v0.1.0","identifier":{"@type":"PropertyValue","propertyID":"git-commit","value":"ac8680a5b15731932da446694b8a0a5ced00d12a"},"author":{"@type":"Person","@id":"https://lucioduran.com/#person","name":"Lucio Durán","url":"https://lucioduran.com"},"isAccessibleForFree":true,"citation":["https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/README.md","https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/manifest.json","https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/summary.json","https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/eval/trace.jsonl","https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/results/dev/manifest.json","https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/design.md","https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/error-analysis.md","https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/data/README.md","https://raw.githubusercontent.com/lucioduran/structured-output-contracts/ac8680a5b15731932da446694b8a0a5ced00d12a/data/freeze.json","https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/docs/model-notices.md","https://github.com/lucioduran/structured-output-contracts/blob/ac8680a5b15731932da446694b8a0a5ced00d12a/requirements-local.lock","https://github.com/lucioduran/structured-output-contracts/releases/tag/v0.1.0"],"publisher":{"@id":"https://lucioduran.com/#person"},"mainEntityOfPage":{"@id":"https://lucioduran.com/projects/structured-output-contracts#page"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Projects","item":"https://lucioduran.com/projects"},{"@type":"ListItem","position":2,"name":"Structured Output Contracts","item":"https://lucioduran.com/projects/structured-output-contracts"}],"@id":"https://lucioduran.com/projects/structured-output-contracts#breadcrumb"}]}],"contentHash":"6d795ae828425f447ef7206fff6b43fe670767d78f857148913aef384ad5136c","provenance":{"method":"Deterministic serialization of the server-rendered main element","source":"https://lucioduran.com/projects/structured-output-contracts","hashAlgorithm":"sha256","hashScope":"JSON document fields before contentHash and provenance","sourceHTMLBytes":48166,"contentBytes":8527}}
