# Q-31 / Q-32 capstone — real generated schemas round-tripped through OpenAI **Provider:** OpenAI `gpt-4o-mini` · **temperature:** 0. Schemas emitted by the REAL round-4 code (`Fields`, `Nullable`, `toolSchemaFrom({providerStrict})`) and validated by the SAME descriptors. | Case | HTTP | Schema accepted | Tool call | Args valid | Verdict | | --- | --- | --- | --- | --- | --- | | reminder — providerStrict + Nullable optional (the Slice-D headline) | 200 | yes | yes | true | ROUND-TRIP OK | | book — a Fields param with an optional field (non-strict) | 200 | yes | yes | true | ROUND-TRIP OK | | bookStrict — a Fields param, ALL fields required (providerStrict) | 200 | yes | yes | true | ROUND-TRIP OK | | bookStrictOpt — a Fields param with a NULLABLE optional field (providerStrict) — the DEC-069 FIX | 200 | yes | yes | true | ROUND-TRIP OK | ### Detail - **reminder — providerStrict + Nullable optional (the Slice-D headline)** - expectation: accepted under strict; model sends note:null; the Nullable validator ACCEPTS null → no drift - result: ROUND-TRIP OK (HTTP 200) — args={"note":null,"patientId":"3f7c1e94-2a8b-4d6f-9c11-5b0e2a7d8f34"} - **book — a Fields param with an optional field (non-strict)** - expectation: Fields schema accepted; model fills the nested object; the Fields validator accepts it - result: ROUND-TRIP OK (HTTP 200) — args={"slot":{"when":"2026-08-15T09:00:00Z"}} - **bookStrict — a Fields param, ALL fields required (providerStrict)** - expectation: accepted under strict (the nested object is fully closed); validator accepts - result: ROUND-TRIP OK (HTTP 200) — args={"slot":{"duration":30,"when":"2026-08-15T09:00:00Z"}} - **bookStrictOpt — a Fields param with a NULLABLE optional field (providerStrict) — the DEC-069 FIX** - expectation: ROUND-TRIP OK (was the case-4 400 in the prior capstone): strictifyForProvider promotes the nullable optional `label` into the NESTED `required` with its null-union + default, so OpenAI strict accepts it; the model sends `label` as null or a string, and the Fields validator (whose label is Nullable) accepts either — closing the nested boundary DEC-068 had left open. - result: ROUND-TRIP OK (HTTP 200) — args={"slot":{"label":"untitled","when":"2026-08-15T09:00:00Z"}} ## Local negative — the validator is the real guard (no network) - bad nested value `{when:'not-a-datetime'}` → REJECTED @["when"], expected: an RFC 3339 date-time - missing required `when` → REJECTED @["when"], expected: an RFC 3339 date-time - Nullable(NotEmpty()) on `null` → ACCEPTS (as designed — no drift) - Nullable(NotEmpty()) on `""` → REJECTS (still enforces non-empty) - bare optional field under providerStrict → REFUSED at build (toolSchemaFrom({ providerStrict }): 'label' at .properties.slot is optional but not nullable) ## The generated schemas (verbatim, from the real code) ### reminder — providerStrict + Nullable optional (the Slice-D headline) ```json { "title": "scheduleReminder", "description": "Schedule a reminder for a patient, optionally with a free-text note.", "type": "object", "properties": { "note": { "type": [ "string", "null" ], "minLength": 1 }, "patientId": { "type": "string", "format": "uuid" } }, "required": [ "patientId", "note" ], "additionalProperties": false } ``` ### book — a Fields param with an optional field (non-strict) ```json { "title": "book", "description": "Book a slot.", "type": "object", "properties": { "slot": { "type": "object", "properties": { "label": { "type": "string", "minLength": 1 }, "when": { "type": "string", "format": "date-time" } }, "required": [ "when" ], "additionalProperties": false } }, "required": [ "slot" ], "additionalProperties": false } ``` ### bookStrict — a Fields param, ALL fields required (providerStrict) ```json { "title": "bookStrict", "description": "Book a slot with a duration in minutes.", "type": "object", "properties": { "slot": { "type": "object", "properties": { "duration": { "type": "integer" }, "when": { "type": "string", "format": "date-time" } }, "required": [ "when", "duration" ], "additionalProperties": false } }, "required": [ "slot" ], "additionalProperties": false } ``` ### bookStrictOpt — a Fields param with a NULLABLE optional field (providerStrict) — the DEC-069 FIX ```json { "title": "bookStrictOpt", "description": "Book a slot, with an optional label.", "type": "object", "properties": { "slot": { "type": "object", "properties": { "label": { "type": [ "string", "null" ], "minLength": 1, "default": "untitled" }, "when": { "type": "string", "format": "date-time" } }, "required": [ "when", "label" ], "additionalProperties": false } }, "required": [ "slot" ], "additionalProperties": false } ```