Case file — PR #704 docs/api: enumerate accepted response_format JSON Schema keywords
https://github.com/NVIDIA/hyperflare-inference/pull/704 · open, ready for review · author jcartu (CONTRIBUTOR, Discord jcartu) · head 77941c4, base main, branched at cc0a49d · 1 file, +17/−0 · no labels, no reviewers, no CI on head.
Key findings
- The diff panel shows ~10 files; only one belongs to this PR.
pr_filesreports exactly one file (docs/api.md, +17/−0), butpr_diffagainst the local base also renders hunks inAGENTS.md,docs/TODO.txt,docs/cli-design.md(not opened),docs/core-design.md,docs/model-preparation.md(not opened),docs/scheduling-runtime-design.md(not opened),flare-cli/src/cli.rs(not opened),flare-cli/src/orbit/*and a second, unrelateddocs/api.mdhunk about typed HTTP 400error.codevalues. All of that is base drift: the local copy ofmainis older than the PR's merge base. Proof:PreparationErrorwiring exists atpr/704(helios/src/server/http.rs:119-130(not opened)) and is absent on localmain; that is merged #689. The AGENTS.md / CLI hunks are merged #690 and #687. Do not attribute any of it to #704. (Scratchpad #1, #12.) - The headline parity claim holds, verified independently.
validate_schema_nodes(helios/src/grammar.rs:877-958) has 12 distinct keys across its recursion arms (:902$ref,:913$defs|definitions|properties|patternProperties,:924anyOf|oneOf|allOf|prefixItems,:935/:940items|additionalItems|additionalProperties) plus 30 pass-through keywords at:943-948= 42; the doc lists 29 structural + 13 metadata = 42, zero missing, zero extra, zero duplicates. Bounds match:MAX_GRAMMAR_BYTES = 262_144,MAX_SCHEMA_NODES = 8_192,MAX_SCHEMA_DEPTH = 64(grammar.rs:23-25), enforced at:884(depth/nodes) and:209(bytes). The PR cites commit3d1614cc, which is not the head (77941c4); the arms are substantively unchanged, so the claim survives. (Scratchpad #2, #9.) - It implements only the fallback ask of #449, not the reporter's request. #449 (shieldstar, 2026-11-21) wants
deprecatedaccepted; its "Expected" section offers two branches, the second being "if the keyword set is meant to stay narrow,docs/api.mdshould list the accepted keywords". #704 is that second branch. #449 stays open and the PR says "Refs", not "Fixes". (Scratchpad #3.) - A second, differently-scoped "closed" keyword list already exists 200 lines above, and #704 does not reconcile it.
docs/api.md:717-734(strict function tools, introduced by the same author's merged #418) enumerates a narrower keyword set and also calls it closed. The new paragraph (docs/api.md:927-942) never says how the two relate, and phrases the same$refrestriction differently (“same-document#references only” vs “local$refto#,#/$defs/<name>, or#/definitions/<name>”). (Scratchpad #4, #6.) - Nothing pins the new list to code. No
include_str!ofdocs/, no doc-vs-code test (searches fordocs/apiunderhelios/only hithelios/README.md:130(not opened)), so the enumeration can silently drift — in contrast to the repo'sflare-cli/src/cli.rs(not opened) test that asserts the man page lists every visible subcommand. (Scratchpad #4.) - Doctext vs #689's typed-error docs are adjacent but unlinked. #689 (same author, merged 2026-12-03 01:22) added
docs/api.md:257-262saying typed 400s carryerror.code: invalid_grammaron Chat Completions, Completions and Responses (Messages excluded by design). #704 says keyword/bound rejections "return HTTP 400" on all four routes and never mentionserror.code. Both are true (status vs envelope) but 680 lines apart, same author, same day. (Scratchpad #15.)
The change
One paragraph, 17 lines, inserted in ## Conversation and tool semantics (heading docs/api.md:488) directly after the existing output-constraint paragraph (docs/api.md:918-925), at docs/api.md:927-942:
- names the four wire locations —
response_formatwithtype: "json_schema"on Chat Completions and Completions,text.formaton Responses,output_config.formaton Messages (:927-929); - lists 29 "structural and constraint" keywords (
:930-936) and 13 "metadata and annotation" keywords (:936-939); - states that any other keyword (
deprecated,nullable,uniqueItems,x-guidance), external$reftargets, and schemas exceeding 262,144 bytes, depth 64, or 8,192 nodes return HTTP 400 (:939-942).
Size and scope: pr_files → docs/api.md (modified, +17 -0). No code, test, config, dependency, or artifact change; nothing else in the repo is touched.
What the change does not do, though the description could be read otherwise:
- It does not touch the strict-tool keyword paragraph at
docs/api.md:717-734, nor state the relation between the two lists (see Key finding 4). - It does not mention
json_object(fixed{"type":"object"}schema, no user schema walked —helios/src/server/request.rs:287-290), which is why the paragraph'stype: "json_schema"parenthetical is correct but silently scoped. - It does not say the byte bound is measured on the re-serialized schema (
schema.to_string().len(),grammar.rs:209), not the request body, so it is unrelated tomax_body_bytes(default 32 MiB,helios/src/server.rs:141; up to 256 MiB at:275-276; documenteddocs/api.md:243-253, 413request_too_largeat:253). - It does not say 262,144 is the shared
MAX_GRAMMAR_BYTESalso bounding Lark grammars (grammar.rs:618-621) and custom-tool regexes (grammar.rs:549). (Scratchpad #16.)
Nothing the description claims is missing from the diff; the description's own "no behavior changes" is confirmed (pr_files).
The why
- Motivation source: issue #449 (open,
area:api, shieldstar, 2026-11-21 18:26, updated 2026-12-03 11:40). Its report: a schema containing"deprecated": truefails withunsupported JSON-schema keyword $/properties/old/deprecated, even though neighbouring annotation keywordsreadOnly,writeOnly,examples,contentMediaType,contentEncodingare accepted. It carries a reproducible no-GPU unit-test recipe (helios/src/schema_keywords.rs(not opened),--exact grammar::schema_keywords::deprecated_keyword_is_outside_the_allowlist, rc 0 on upstream25b4951) plus areadOnlycontrol. - The fallback ask quoted above is what #704 implements. (
related_itemsconfirms #449 is #704's only link in either direction.) - Provenance: yatesdr, 2026-11-21 18:38 on #449: the allowlist is "closed on purpose" (citing
grammar.rs:876-887, doc comment:194-195, test:1648-1675), its annotation list "matches llguidance's", sodeprecated"likenullableoruniqueItems, gets HTTP 400 by design, and no document lists the accepted keywords. Accepting more annotation keywords would be a change to that rule, not a fix." Then jcartu, 2026-12-03 11:40 on #449: "Proposing a docs-only PR enumerating the acceptedresponse_formatJSON Schema keywords per @yatesdr's note; no behavior change." Same timestamp as #449's last update, i.e. the PR's direct provenance. - Age of the want: the gap was named 2026-11-21 and addressed 2026-12-03 (12 days). Line-number drift since then is ordinary (yatesdr's
grammar.rs:876-887→:877-958at head; tests:1648-1675→:1616-1644/:1646-1672), not a contradiction. (Scratchpad #3.)
Related work
- #418 (merged 2026-11-22, jcartu, +6048/−128) — created the strict function-tool machinery (
helios/src/grammar/strict.rs,compile_strict_validators) and the strict keyword subset now atdocs/api.md:717-734; its body says it "admit[s] the closed object subset". Closest overlapping item; #704 neither edits nor reconciles it. (Scratchpad #6.) - #449 (open issue) — the linked motivation; only half addressed, stays open.
- #461 (open, same author, +88/−26) "Document strict tool selection and numeric range precision" — sibling docs work on the same strict-schema paragraph; has two Autobot reviews and a yatesdr CHANGES_REQUESTED. Its yatesdr review point offers "Or leave admission as it is and document the limit, which
docs/api.mdnow states" — the same document-don't-change pattern #704 follows. Overlap risk is low: #461 edits the tool-choice area (≈docs/api.md:562-575/:666-681), 250+ lines above #704's insertion point. - #686 (open, same author) docs for DeepSeek V4/V4.1
tool_choice: required— same file, similar area, also far from:927-942. - #689 (merged 2026-12-03 01:22, same author) typed HTTP 400
error.codedocs + code — topically adjacent (same rejection path), unlinked by #704 (see Key finding 6). Backing code:AdmissionError::Grammar→ HTTP 400 athelios/src/server.rs:738,error_codeinvalid_grammarat:749; end-to-end assertion for all four routes incl. Messagesoutput_config.formatinhelios/src/server/runtime/phase_tests.rs:8871-8926. - #530 (open issue, devinkuhn, 2026-11-25,
area:scheduling/bug/performance) — structured output decodes ~2-3× slower on DeepSeek-V4.1-Flash-1017 (~55 tok/svs176unconstrained; 54.8 s median vs vLLM's 21.5 s; 85/450 client timeouts vs 1/203). Its ask 3 explicitly requests "a note in the model card ordocs/api.md" about the cost; #704 does not add one. Cost numbers may have moved after merged #626/#619 changed speculation rules for grammar-constrained requests. - #417 (closed issue) / #418 — precedent that schema-admission documentation is treated as a deliverable.
- #670, #638, #578, #615 (merged, same file) and open #694, #685, #677, #674, #621, #560, #554, #549, #548, #453, #172 — same-file neighbours only; none enumerate the output-constraint allowlist. No other PR or issue asks for this enumeration (searches for the allowlist wording returned nothing else). (Scratchpad #6, #11, #12.)
Recent activity
- Environment limit: local git history at the PR base is unreadable (
Could not read c513e46a…; the packet'sdocs:area history also failed), so per-commit activity indocs/cannot be listed. The packet does establish: no commits on the default branch sincecc0a49dtouch the PR's changed files, so #704 builds on / conflicts with nothing landed after its branch point. docs/api.mdis high-churn:items_touchinglists 15 merged and 14 open PRs in the last 180 days (e.g. merged #689, #670, #657, #638, #626, #620, #615, #578, #573, #568, #505, #478, #170, #102; open #694, #692, #686, #685, #677, #674, #621, #560, #554, #549, #548, #453, #461, #172). A textual rebase is likely.- Same-day cluster by one author: #689 merged 01:22, #449 comment announcing this PR 11:40, #704 opened 2026-12-03 — a coherent docs pass over
docs/api.md(error codes, schema keywords) alongside the still-open #686 and #461. - The stale local base is what makes the rendered diff look like 10 files (see Key finding 1). (Scratchpad #12, #15.)
People
- jcartu — CONTRIBUTOR, not one of the charter's priority contributors (@voipmonitor / @original-el8 / @lukealonso). 180 days: 6 merged, 3 closed, 9 open. Merged areas: docs (5),
helios/src(4), root (1),flare-cli/src(1),heliopause/src(1). Recently merged in this file/area: #689 (2026-12-03), #690 (2026-12-02), #687 (2026-12-02). Open siblings include #692, #691, #686, #688, #693, #642, #621, #461 and issue #703. - Track record directly on this subject: #418 (strict function-tool schemas, 16 files, +6048/−128) is the author's; #704 documents its neighbourhood.
- yatesdr — the maintainer voice that defines the closed-allowlist position (#449 comment, 2026-11-21) and the reviewer who requested changes on the sibling #461. De facto decider for this area.
- shieldstar — reporter of #449, whose preferred fix (accept
deprecated) this PR does not do; not a priority contributor. - Other
helios/src/grammar.rsauthors peritems_touching: lukealonso, voipmonitor (via merged #626/#670 and open #500/#228/#94/#167). - Process contrast: the author's other docs PRs in this window (#461, #686) carry
area:api,documentation,triage:reviewand got an Autobot case file within minutes; #704 has none of that. (Scratchpad #7.)
Community
- On #704 itself: no engagement at all —
pr_commentsreturns "No comments"; no reviews, no reactions, no labels, no Autobot case file. Effectively hours old (opened and last updated 2026-12-03). - On the topic: #449 has 2 comments plus a reproduction; #530 is the loudest structured-output report in the tracker (detailed production numbers, cross-referenced by merged #619/#626); #461 shows review bandwidth already committed to this docs area (5 comments, one CHANGES_REQUESTED, two Autobot reviews). (Scratchpad #11.)
Project fit
- Charter line 33: "We target the documented subset of the OpenAI API, the Anthropic Messages API … and JSON Schema for structured outputs." #704 documents exactly that subset for JSON Schema; the charter's own wording ("documented subset") makes a caller-facing enumeration the intended artifact, not an extra.
- Charter line 35 ("What gets merged"): "PRs that address a maintainer request, a roadmap item, a reproducible bug, a measured performance/memory issue, or bad docs." Both the maintainer-request and bad-docs criteria apply.
- Charter line 42 (supported matrix & compatibility): asks for checks across models, caches, parallel layouts, hardware, CUDA-graph transitions and loadability of existing artifacts/cores. A docs-only change has no such surface; the PR claims "no behavior, runtime, or core-compatibility changes", consistent with
pr_files. - Charter's "Be explicit and pin everything" / "Don't silently ignore API fields … either implement it according to the spec or reject it": the paragraph documents a reject-with-400 policy, i.e. the charter-compliant side, and makes the rejection discoverable.
- Charter PR-description standard (why / what changed / claimed result / evidence) and the no-new-code preference ("a way to solve it without new code at all") are both met — the latter is precisely how yatesdr steered #449.
- Roadmap: no item concerns JSON Schema keywords or structured-output docs (the listed items are the in-process Rust SDK, Engram tables #267, the FlashInfer pin #215); #704 touches none.
- Repository doc conventions (AGENTS.md, not charter):
:52-58requires present-state statements of what is implemented — #704 states the present allowlist, not an aspiration;:57-60forbids defect reports/progress notes in docs;:230asks that the relevant API section be edited for API-behavior changes — met by editingdocs/api.mditself.docs/TODO.txthas no allowlist/deprecatedentry (searches forkeyword|schema|allowlist|deprecatedfind none), which is consistent with a present-state doc change rather than pending work. - Where it does not line up: nothing material. The only tension is that priority-contributor weight does not apply, and the charter's evidence bar ("bring real evidence") is only lightly met — a hand-verifiable parity claim with no committed check (see below). (Scratchpad #8.)
Claims and evidence
| Claim in the PR body | Evidence in the tree | Verdict |
|---|---|---|
Programmatic 1:1 set parity at 3d1614cc; 42 == 42 (29+13); zero missing/extra/duplicates |
Re-derived from grammar.rs:902-948: 12 distinct recursion keys + 30 pass-through = 42; doc = 29 + 13 = 42 |
Holds, but the cited commit is not the head 77941c4 (arms unchanged in substance), and the parity script is not named or committed |
MAX_GRAMMAR_BYTES 262,144 / depth 64 / nodes 8,192 verified |
grammar.rs:23-25, :884, :209 |
Holds |
Protocol field mapping verified in decode.rs |
text.format at helios/src/server/protocol/decode.rs:466-504; output_config.format :561, response_format :562; schema read from format["json_schema"]["schema"] (Chat) or format["schema"] (:568-576) — explains the two spellings in the doc |
Holds |
git diff --check clean; git diff --stat touches only docs/api.md |
Consistent with pr_files (1 file). Note: against the local stale base git diff --stat would show ~10 files, so the claim must refer to the PR's own commit |
Plausible, unverifiable locally |
| "No behavior, runtime, or core-compatibility changes" | pr_files = one prose file; no include_str! of docs/ anywhere |
Confirmed |
| "Unrun checks: no Rust/Python/simulator/formal/GPU suites" | Honest for prose; the only workflow that would run is .github/workflows/native-serving.yml:1-22 (not opened) (pull_request, ubuntu + windows), and it reported no checks on head |
Disclosed, but the PR is fully self-verified only |
Accuracy nuances I verified (none contradict the text, which is scoped to "…a closed keyword allowlist before grammar compilation", docs/api.md:929-930):
- The enumeration is a floor, not a guarantee. Allowlist-clean schemas still 400 later:
{"type":"string","format":"not-a-format"}(grammar.rs:1624), dangling#/$defs/missing$ref(:1629), overlappingoneOfinteger/number (:1625),minimum: 5, maximum: 1(:1630), booleanfalseschema (:1631), unknowntypevalue (helios/src/server/runtime/phase_tests.rs:8873-8903). - Boolean schemas return
Okfrom the walk (grammar.rs:890-892), sotrue/falseare not described by a "keyword allowlist" framing at all;truecompiles,falseis rejected later. $refrule in code only checksreference.starts_with('#')(grammar.rs:903-911) — hence "external targets rejected", as documented.- The doc's "HTTP 400" holds on all four routes, verified for Messages
output_config.formattoo (phase_tests.rs:8896-8903: BAD_REQUEST +invalid_grammar). - Tests covering the rejections:
grammar.rs:1616-1644(unsupported_invalid_and_external_schemas_fail_before_admission, includesuniqueItems,nullable,x-guidance, external$ref) and:1646-1672(bounded_compilation_and_thread_ownership, depth loop). (Scratchpad #2, #9, #13, #15, #16.)
Reach
- Users: any caller sending a structured-output JSON Schema on Chat Completions / Completions (
response_format), Responses (text.format), Messages (output_config.format) — i.e. everyone treatingdocs/api.mdas the API reference (helios/README.md:130(not opened)). Before this PR the accepted set was only discoverable by readinghelios/src/grammar.rs, matching yatesdr's "no document lists the accepted keywords". - Operators: no config, default, dependency, pin, wire, or artifact change; nothing to re-tune, no migration. The one operational read-across to watch: a large schema yields 400 (schema byte bound, re-serialized length) not 413 (
max_body_bytes,docs/api.md:253) — the new paragraph does not distinguish them. - Compatibility: none affected; no per-model branching, no protocol change, no client-SDK change — so the charter's "keep the runtime small and model-agnostic" boundary is untouched.
- Documentation: the change is confined to
docs/api.md;docs/core-design.mdsays nothing aboutvalidate_schema_nodesor the allowlist (its only "allowlist" hits,:307/:322, are cache/page geometry), and no sibling doc restates these bounds, so nothing goes stale. - Second-order: with a concrete present-state list, any future keyword acceptance (e.g.
deprecatedper #449) becomes a visible doc change rather than silent divergence — and conversely, drifting from code becomes harder to notice only because nothing tests it. (Scratchpad #10, #16.)
Process
- Draft or ready: ready for review, opened and last updated 2026-12-03, so hours old at review time. No labels (contrast #461/#686, which carry
area:api,documentation,triage:review). - CI: no checks on head
77941c4. Nothing in CI would validate prose even if it ran. - Reviews: none; zero comments; no review requested.
- Description quality: complete against the AGENTS.md four-part standard (why / what changed / result / evidence) and ends with the repo's
Discord: jcartuconvention. - Base staleness: branched at
cc0a49d, older than the local copy ofmain, which is what inflates the rendered diff; a rebase would reduce it to the single hunk. (Scratchpad #5.)
Open questions / not found
- Which commit was the parity script run against? The body cites
3d1614cc, head is77941c4; the script is not committed or named. My hand recount at head matches, so this is bookkeeping, not a correctness gap. - Do maintainers want the two keyword lists (strict tools at
docs/api.md:717-734, output constraints at:927-942) explicitly related? #704 is silent; #449/#418 prose both use "closed". Unresolved by any item in the tracker. - Should the doc say anything about
json_object, the re-serialized byte measurement, the sharedMAX_GRAMMAR_BYTES, or the#530decode-cost warning? None is present; only #530 explicitly asks for adocs/api.mdnote, and it is about cost, not keywords. - Not found: any CI doc-lint job, any test pinning
docs/api.mdcontent, any additional issue/PR from a second requester asking for the allowlist enumeration, and any roadmap item covering structured-output documentation. - Not verifiable here: local
git diff --check/git diff --statresults (no shell) and thedocs/commit history at the base (unreadable local git objectc513e46a…).