Repository navigation
Conversation
Structured-output JSON Schema constraints (`response_format` with `type: "json_schema"` on Chat Completions and Completions, `text.format` on Responses, and `output_config.format` on Messages) validate every schema node against a closed keyword allowlist in `validate_schema_nodes` (`helios/src/grammar.rs`), rejecting unsupported keywords such as `deprecated`, `nullable`, and `uniqueItems` with HTTP 400. Previously, `docs/api.md` documented the strict function-tool keyword subset but did not list the accepted keywords or node limits for structured-output JSON schemas, so clients could not determine which keywords are permitted without inspecting `helios/src/grammar.rs`. Documenting the exact allowlist in `docs/api.md` without altering `validate_schema_nodes` preserves the closed allowlist rule while giving API callers an accurate specification. Before this change, the output-constraint section of `docs/api.md` stated that JSON output formats constrain the final answer and include the schema in the system prompt, without specifying the accepted JSON Schema keywords, external `$ref` rejection, or schema size, depth, and node bounds. After this change, `docs/api.md` enumerates all 42 accepted keywords in `validate_schema_nodes`, grouped into 29 structural and constraint keywords (`$ref` with same-document `#` references only, `$defs`, `definitions`, `type`, `const`, `enum`, `anyOf`, `oneOf`, `allOf`, `properties`, `patternProperties`, `additionalProperties`, `required`, `minProperties`, `maxProperties`, `items`, `prefixItems`, `additionalItems`, `minItems`, `maxItems`, `minLength`, `maxLength`, `pattern`, `format`, `minimum`, `maximum`, `exclusiveMinimum`, `exclusiveMaximum`, and `multipleOf`) and 13 metadata and annotation keywords (`$anchor`, `$schema`, `$id`, `id`, `$comment`, `title`, `description`, `default`, `readOnly`, `writeOnly`, `examples`, `contentMediaType`, and `contentEncoding`), and notes that any other keyword (such as `deprecated`, `nullable`, `uniqueItems`, or compiler extensions like `x-guidance`), external `$ref` targets, and schemas exceeding 262,144 bytes, depth 64, or 8,192 nodes return HTTP 400. API callers now have a complete, present-state reference for accepted structured-output JSON Schema keywords and admission bounds, with zero changes to runtime validation, grammar compilation, or model core compatibility. Validation: - Verified programmatic 1:1 set parity between `validate_schema_nodes` in `helios/src/grammar.rs` at `3d1614cc` and the enumerated keywords in `docs/api.md` (42 code keywords == 42 documented keywords: 29 structural and constraint keywords plus 13 metadata and annotation keywords, zero missing, zero extra, zero duplicates). - Verified `MAX_GRAMMAR_BYTES` (262,144), `MAX_SCHEMA_DEPTH` (64), `MAX_SCHEMA_NODES` (8,192), and protocol field wiring in `helios/src/grammar.rs` and `helios/src/server/protocol/decode.rs`. - Ran `git diff --check` (zero whitespace issues) and confirmed `git diff --stat` modifies only `docs/api.md`. - Unrun checks: no Rust, Python, simulator, formal, or GPU test suites were run because this commit modifies documentation only. Refs NVIDIA#449 Signed-off-by: Joshua Cartu <jcartu@users.noreply.github.com> Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
|
A case file has been opened for 704. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Ready To MergeThis is a single 17-line prose addition (
Walkthrough
Merge Risk: Low · up to
|
Refs #449
Structured-output JSON Schema constraints (
response_formatwithtype: "json_schema"on Chat Completions and Completions,text.formaton Responses, andoutput_config.formaton Messages) validate every schema node against a closed keyword allowlist invalidate_schema_nodes(helios/src/grammar.rs), rejecting unsupported keywords such asdeprecated,nullable, anduniqueItemswith HTTP 400. Previously,docs/api.mddocumented the strict function-tool keyword subset but did not list the accepted keywords or admission bounds for structured-output JSON schemas, so API callers could not see which keywords are accepted without readinghelios/src/grammar.rs. Documenting the allowlist indocs/api.mdwithout modifyingvalidate_schema_nodespreserves the closed allowlist rule while resolving the documentation gap noted on #449.Before this change, the output-constraint section in
docs/api.mdstated that JSON output formats constrain the final answer and include the schema in the system prompt, without enumerating the accepted JSON Schema keywords, external$refrejection, or schema size, depth, and node limits. After this change,docs/api.mdadds a concise paragraph in the output-constraint section listing all 42 accepted keywords fromvalidate_schema_nodes:$ref(same-document#references only),$defs,definitions,type,const,enum,anyOf,oneOf,allOf,properties,patternProperties,additionalProperties,required,minProperties,maxProperties,items,prefixItems,additionalItems,minItems,maxItems,minLength,maxLength,pattern,format,minimum,maximum,exclusiveMinimum,exclusiveMaximum, andmultipleOf.$anchor,$schema,$id,id,$comment,title,description,default,readOnly,writeOnly,examples,contentMediaType, andcontentEncoding.deprecated,nullable,uniqueItems, or compiler extensions likex-guidance), external$reftargets, and schemas exceeding 262,144 bytes, depth 64, or 8,192 nodes return HTTP 400.As a result, API callers have a complete, present-state reference for accepted structured-output JSON Schema keywords and admission bounds, with no behavior, runtime, or core-compatibility changes.
Validation:
validate_schema_nodesinhelios/src/grammar.rsat3d1614ccand the documented keyword lists indocs/api.md(42 code keywords == 42 documented keywords: 29 structural and constraint keywords plus 13 metadata and annotation keywords, zero missing, zero extra, zero duplicates).MAX_GRAMMAR_BYTES(262,144),MAX_SCHEMA_DEPTH(64),MAX_SCHEMA_NODES(8,192), and protocol field mapping inhelios/src/grammar.rsandhelios/src/server/protocol/decode.rs.git diff --check(zero whitespace issues) and verifiedgit diff --stattouches onlydocs/api.md.Discord: jcartu