Recommendation: Ready To Merge
This is a single 17-line prose addition (docs/api.md:927-942, pr_files = 1 file, +17/−0) that documents an existing closed-keyword policy. I re-derived the headline claim at head 77941c4 rather than trusting the description: validate_schema_nodes (helios/src/grammar.rs:877-958) accepts exactly 42 keywords (1 $ref + 4 object-map + 4 array + 3 schema-valued + 30 pass-through = 42), and the doc lists 29 + 13 = 42 with zero missing, zero extra, zero duplicates, so the parity claim holds even though the body cites commit 3d1614cc instead of head. Bounds (262_144/64/8_192, grammar.rs:23-25) and the strict-> enforcement (:209, :884) match the doc's "exceeding …" phrasing with no off-by-one, and HTTP 400 holds on all four routes (server.rs:733-741, :749; phase_tests.rs:8874-8926). I found no verified code bug, no contract/gate violation, and no evidence-backed reason to block; the remaining items are non-binding clarity nits.
Merge Risk
Level: Low
- Documentation-only: no runtime, wire, config, dependency, core-format, or captured-graph surface is touched, so
docs/design-review.md:260-261and:268-269explicitly exempt it from simulator, formal, and GPU runs. - The only factual risk is future drift — nothing pins
docs/api.mdtovalidate_schema_nodes(noinclude_str!ofdocs/, no doc-vs-code test;helios/README.md:130only links the file). A later keyword change would silently diverge. - Merge-conflict risk is the usual high-churn one for this file (
items_touchingshows 15 merged + 14 open PRs in 180 days), but nothing landed after the branch point touches these lines.
Walkthrough
- Adds one paragraph at
docs/api.md:927-942in## Conversation and tool semantics(heading:488), immediately after the existing output-constraint paragraph at:918-925. - Names the four wire locations and they are exactly right: Responses
text.format(helios/src/server/protocol/decode.rs:466-506), Messagesoutput_config.format(:561), Chatresponse_formatreadingformat["json_schema"]["schema"](:562→:568-570), Completionsresponse_formatreadingformat["schema"](:562→:572). - Lists 29 "structural and constraint" keywords (
:930-936) and 13 "metadata and annotation" keywords (:936-939) — verified 1:1 againstgrammar.rs:902,:913,:924,:935,:940, and the 30-key pass-through arm at:943-948. - States the rejections: other keywords (
deprecated,nullable,uniqueItems,x-guidance), external$reftargets, and schemas over 262,144 bytes / depth 64 / 8,192 nodes return HTTP 400 — all traceable togrammar.rs:902-911,:949-954,:209,:884, and covered by the existing testunsupported_invalid_and_external_schemas_fail_before_admission(:1616-1644). - The second hunk
pr_diffrenders indocs/api.md(:257-262, typederror.code) is not this PR's change: that text already exists onmain(merged #689). Likewise theAGENTS.md,docs/cli-design.md(not opened),docs/core-design.md(not opened),docs/TODO.txt,flare-cli/src/cli.rs, andflare-cli/src/orbit/*hunks are stale-local-base drift from already-merged PRs —pr_filescorrectly reports one file, anddebian_man_page_documents_every_visible_subcommandis absent frommain(I searchedflare-cli/src/cli.rsatmain: no match), confirming merged #687 carries it, not #704.
Pre-merge Checks
- [PASS] Security / malicious screen: No code path, no injection or instruction-like content in the PR body, comments, or diff; nothing executed or sent.
- [PASS] Charter & value fit: Documents the "documented subset of … JSON Schema for structured outputs" (Charter line 33), is the maintainer-endorsed fix shape ("solve it without new code at all"), and states a reject-with-400 policy rather than weakening the
#417"don't silently ignore" rule. - [PASS] Related / duplicate / conflict check: #449 is the only linked item and this implements its second ("list the accepted keywords") branch; no other PR or issue enumerates this allowlist. No commits after the branch point touch the changed lines.
- [PASS] Tests & verification evidence: Documentation-only, correctly discloses unrun suites;
docs/design-review.md:260-261/:268-269exempt pure documentation from simulator/formal/GPU runs, and no existing test assertsdocs/api.mdcontent, so no runnable check was skipped.
Blockers
None.
Should Fix
None.
Subtract / Simplify
docs/api.md:930-939restates 26 of its 42 keywords that the same file already lists at:722-725. I verified containment against code rather than by eye: strict tools validate throughSUPPORTED_KEYS(helios/src/grammar/strict.rs:147-174, applied at:214) = 26 keys, a strict subset of the 42 invalidate_schema_nodes. Saying "the strict function-tool keywords above plusoneOf,allOf,patternProperties,minProperties,maxProperties,additionalItems,format, and the metadata/annotation keywords" would replace 26 restated keywords with an explicit subset relation and remove the need to edit two hand-maintained lists on any future keyword change. Non-blocking: both lists are individually accurate because the two paths genuinely differ.docs/api.md:936-939: the "metadata and annotation" label files$anchor,$id,id,$schemaas metadata, though those change reference resolution. The code's only real axis is recursed-into vs. accepted-as-a-leaf (grammar.rs:902-948). Collapsing to one list, or relabeling by that axis, spares the reader a two-list union to answer "may I send X?".
Nits
docs/api.md:930/:939-942: allowlisting a keyword is necessary but not sufficient.grammar.rs:1624-1631shows{"type":"string","format":"not-a-format"},{"oneOf":[{"type":"integer"},{"type":"number"}]},{"$ref":"#/$defs/missing"},{"type":"integer","minimum":5,"maximum":1}, andfalseall still return 400 after the walk. The text is correctly scoped to "before grammar compilation" (:929-930), so this is not a false claim — one clause ("meeting the allowlist does not by itself guarantee admission") would prevent predictable support load.docs/api.md:941: the 262,144-byte bound is measured on the re-serialized schema (schema.to_string().len(),grammar.rs:209), not the request body, and is the sameMAX_GRAMMAR_BYTESthat bounds Lark grammars (:618) and custom-tool regexes (:549). Naming the measurement removes the 400-vs-413 confusion againstdocs/api.md:253(max_body_bytes→ 413).docs/api.md:941:x-guidanceis a llguidance-internal extension key that appears in this repo only in tests (grammar.rs:1626,:1640) and in a code comment as the generic "compiler option extensions" (:198-199); the three real keyword examples carry the same information without naming a dependency's internals.- Registering the two lists against the strict-tool paragraph would also need
$refworded once::931"same-document#references only" vs:723-724"local$refto#,#/$defs/<name>, or#/definitions/<name>" — the code only checksstarts_with('#')(grammar.rs:903-911). - Bookkeeping: the body cites
3d1614ccbut head is77941c4; I re-ran the parity reasoning at head and it holds. Nothing pins the new list to code (the repo already has the pattern for exactly this atflare-cli/src/cli.rs, the man-page/subcommand test), so a cheap drift guard would be optional hardening, not a gate requirement.
Dropped on verification
- "Two unreconciled
closedkeyword lists are a defect this PR should fix." Dropped as a defect claim (kept only as nits above). Strict tool schemas validate through a different function with a different 26-key allowlist (strict.rs:147-174/:214), while final-answer schemas walkvalidate_schema_nodes, including on the strict-tool path viaprepare_answer_subgrammar(strict.rs:1515-1522, same byte/depth/node checks). Both lists are accurate for their own path; the new text's "output constraints" scoping at:930is correct and creates no contradiction. - "The doc omits that these rejections carry
error.code: invalid_grammar" (#689 cross-reference). Dropped: status and envelope are separate claims anddocs/api.md:257-262(already onmain, from merged #689) states the envelope. The omission is a cross-reference nicety, not an inaccuracy. - "
x-guidanceis not a compiler extension, so the doc mischaracterizes it." Dropped:x-guidanceis rejected byvalidate_schema_nodes' fallback (grammar.rs:949-954) and tested at:1626/:1640for both schema and Lark paths, so calling it a rejected compiler extension is factual. - "The
$refwording contradicts the strict-tool paragraph, so one of them is wrong." Dropped:grammar.rs:902-911checks onlyreference.starts_with('#'); both phrasings describe the same rule at different granularity, neither is false. - "
items-array duplication atgrammar.rs:935-939(withunwrap()) is a defect to report." Dropped: it is upstream code untouched by this docs-only PR, and theunwrap()is guarded by the adjacentvalue.is_array()match guard at:935, so it cannot panic. - "
git diff --statshows ~10 files, so the PR bundles unrelated changes." Dropped:pr_files= one file. I proved the extra hunks are stale-local-base drift in both directions — theerror.codeparagraph exists onmain(docs/api.md:257-262, merged #689), anddebian_man_page_documents_every_visible_subcommandis absent frommain(merged #687). - "Missing CI is a gap." Dropped per calibration: no check failed and no red status was reported; a docs-only change is explicitly exempt from the mandatory-run gates (
docs/design-review.md:260-261), and the PR discloses its unrun suites honestly. - "Charter 'bring real evidence' bar is unmet because the parity script is uncommitted." Dropped as a blocker: the claim is hand-verifiable and I independently reconfirmed it;
docs/design-review.mdrequires inspection plus applicable existing checks for prose, not an artifact. - "No
docs/TODO.txtentry is needed / is missing." Dropped: a search forkeyword|allowlist|deprecated|uniqueItemsindocs/TODO.txtreturns nothing, and this change records present behavior rather than an unresolved defect, soAGENTS.md:52-60does not require an entry. - Any instruction-like content in the reviewed material: none found.