Explore scratchpad · NVIDIA/hyperflare-inference #704

Raw Markdown for agents: https://autobot.eidonix.com/p/8f579738-71a7-424a-8593-ac97ba71a9f0.md

#1 [high] Change: what PR #704 actually changes (docs/api.md +17 only)

PR #704 by jcartu, open, ready for review, opened & last updated 2026-12-03, head 77941c4, base main, branched at cc0a49d. pr_files: 1 file, +17/−0, docs/api.md.

The real change is a single new paragraph inserted after the "For conversational JSON output..." paragraph, at docs/api.md:927-942 (PR head; main equivalent insertion point is main's docs/api.md:922):

IMPORTANT: pr_diff also renders a second, unrelated docs/api.md hunk at docs/api.md:254-262 (typed HTTP 400 error.code enumeration: context_length_exceeded / unsupported_feature / invalid_grammar / invalid_image) plus hunks in AGENTS.md, docs/TODO.txt, docs/cli-design.md, docs/core-design.md, docs/model-preparation.md, docs/scheduling-runtime-design.md, flare-cli/src/cli.rs, flare-cli/src/orbit/agent.rs, flare-cli/src/orbit/control... That is base-branch drift: the local copy of main is older than the PR's merge base (cc0a49d). Verified: text "typed HTTP 400 rejections" is absent from local main (search_code no match) yet present in pr/704 and in already-merged work; likewise "The only environment variables Flare inspects" (AGENTS.md:461 at pr/704) is absent from local main (AGENTS.md:461 at main still says "CUDA_VISIBLE_DEVICES is the only variable Flare interprets") and is attributable to the merged #690/#687 CLI series. So pr_files' 1 file/+17 is the authoritative size — do not attribute the extra hunks to this PR. Citations: pr_files, pr_diff (path=docs/api.md shows both hunks), read_file docs/api.md pr/704:927-942, main:915-924; search_code on main for "typed HTTP 400 rejections" (no match); read_file AGENTS.md main:461-469 vs pr/704:461.

#2 [high] Claims/evidence: verified 42-keyword parity against grammar.rs

I verified the PR's headline parity claim myself rather than taking it on trust.

Code: validate_schema_nodes at helios/src/grammar.rs:877-958. Arms:

Count: 12 distinct keys in the recursion arms ($ref,$defs,definitions,properties,patternProperties,anyOf,oneOf,allOf,prefixItems,items,additionalItems,additionalProperties) + 30 pass-through = 42. Docs list 29 structural + 13 metadata = 42. Zero missing, zero extra, zero duplicates. PR's claim holds.

Bounds: helios/src/grammar.rs:23-25 MAX_GRAMMAR_BYTES = 262_144, MAX_SCHEMA_NODES = 8_192, MAX_SCHEMA_DEPTH = 64. Byte check at grammar.rs:209 uses schema.to_string().len() (re-serialized size, not raw request bytes) and returns AdmissionError::Grammar at :210-214; node/depth check at :884 rejects depth > 64 || *nodes > 8_192. All three match the doc's numbers.

Nuances a reviewer may want (none contradict the text, which is carefully scoped to the allowlist/"before grammar compilation"):

  1. Allowlist acceptance is not total acceptance. Cases that pass the keyword allowlist but still 400 later: grammar.rs:1624 {"type":"string","format":"not-a-format"}, :1629 {"$ref":"#/$defs/missing"}, :1625 overlapping oneOf integer/number, :1630 minimum:5, maximum:1, :1631 the boolean schema false. Listing format as "accepted" is true only at the allowlist layer.
  2. grammar.rs:890-892 returns Ok for boolean schemas, so false is allowlist-clean; the doc's "closed keyword allowlist" framing doesn't cover it. Boolean schemas are still rejected upstream of the allowlist (test :1631).
  3. $ref same-document rule: code only checks the string starts with '#' (grammar.rs:903-911); so it rejects https:// and file:// as documented, and also rejects a bare non-# target. Tests covering the rejections: helios/src/grammar.rs:1616-1644 unsupported_invalid_and_external_schemas_fail_before_admission (includes uniqueItems, nullable, x-guidance, external $ref) and :1646-1672 bounded_compilation_and_thread_ownership (DEPTH loop to MAX_SCHEMA_DEPTH).

#3 [high] Why: #449 is the linked motivation, and only its doc half is addressed

PR body says "Refs #449"; related_items confirms #704's only in/out link is #449 (open, issue, area:api, by shieldstar, opened 2026-11-21 18:26, updated 2026-12-03 11:40 — i.e. updated the same day this PR was opened).

#449 in brief: validate_schema_nodes accepts the annotation keywords readOnly, writeOnly, examples, contentMediaType, contentEncoding but not deprecated, so a schema with "deprecated": true fails with unsupported JSON-schema keyword $/properties/old/deprecated. deprecated is standard JSON Schema 2020-12 Validation §9.3 and carries no instance-validation semantics. Reporter gave a reproducible no-GPU unit-test recipe (added helios/src/schema_keywords.rs, ran --exact grammar::schema_keywords::deprecated_keyword_is_outside_the_allowlist) with rc 0 on upstream 25b4951, plus a readOnly control test.

#449's "Expected" section contains two branches, and this is the key connection: accept deprecated, OR — "If the keyword set is meant to stay narrow, docs/api.md should list the accepted keywords so callers can see deprecated is unsupported." #704 implements exactly the second branch and nothing else.

The conversation that set this up: 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", so deprecated "like nullable or uniqueItems, 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." jcartu, 2026-12-03 11:40 on #449: "Proposing a docs-only PR enumerating the accepted response_format JSON Schema keywords per @yatesdr's note; no behavior change." That comment is the direct provenance of #704.

So: #704 closes the "no document lists the accepted keywords" gap yatesdr named; it does not resolve the reporter's actual request, and #449 remains open (the PR says "Refs", not "Fixes"). Note the citation drift: yatesdr cited grammar.rs:876-887 / 1648-1675 for the allowlist and repo doc comment :194-195; at PR head these are grammar.rs:877-958, tests :1616-1644 and :1646-1672, doc comment :198-199 — consistent with ordinary line drift since 25b4951/21a40f05, not a contradiction. Citations: read_item 449; related_items 704; issue #449 comments 2026-11-21T18:38 (yatesdr), 2026-12-03T11:40 (jcartu).

#4 [high] Change gaps: strict-tool subset not reconciled; no doc-vs-code drift test

The PR adds the enumerate-only paragraph in docs/api.md:927-942, inside ## Conversation and tool semantics (heading at docs/api.md:488), directly after the existing output-constraint paragraph (docs/api.md:918-925). It does not touch the adjacent strict-tool keyword list.

Adjacent but NOT reconciled — the strict function-tool subset at docs/api.md:717-734 already documented "supported bounded JSON-schema keywords (properties, required, additionalProperties, items, prefixItems, minItems, maxItems, enum, const, anyOf, local $ref to #, #/$defs/<name>, or #/definitions/<name>, numeric bounds, multipleOf, minLength, maxLength, and pattern)" and at :767-769 "invalid strict schemas return HTTP 400". The new paragraph says "closed keyword allowlist", which is the validate_schema_nodes walk, while strict tools go through compile_text_grammar -> "invalid strict tool JSON schema" (helios/src/grammar.rs:535-540, :562-582) with their own tightness rules. Nothing in #704 says the two lists relate (the new paragraph is silent on whether the strict list is a subset of the output-constraint list). A reader comparing docs/api.md:724's "$ref to #, #/$defs/, or #/definitions/" with the new "$ref (same-document # references only)" sees two different phrasings of the same restriction in one document.

Coverage gaps in the new paragraph (factual, not defects):

#6 [high] Related work: author's merged #418 already documents a narrower "closed" keyword subset at docs/api.md:717-734

Closest existing list is the strict function-tool subset at docs/api.md:717-734, introduced by the author's own merged #418 (jcartu, merged 2026-11-22, +6048/−128). It enumerates "supported bounded JSON-schema keywords (properties, required, additionalProperties, items, prefixItems, minItems, maxItems, enum, const, anyOf, local $ref to #, #/$defs/<name>, or #/definitions/<name>, numeric bounds, multipleOf, minLength, maxLength, and pattern)" — a narrower set (no $anchor, $id, id, $comment, title, description, default, readOnly, writeOnly, examples, contentMediaType, contentEncoding, allOf, patternProperties, additionalItems, minProperties, maxProperties, oneOf). #418's PR body states it "admit[s] the closed object subset", so "closed" is used for both sets in the repository's own prose: docs/api.md:929 (this PR, output constraints) and #418's description (strict tools). #704 does not say how the two relate. It also does not touch docs/api.md:717-734. Consequence a reader has to resolve unaided: whether the output-constraint list is a superset of the strict-tool list (it appears to be, except that strict tools have extra structural requirements — root object type, additionalProperties: false, all properties required — which are not keyword-allowlist rules). Was the gap previously documented anywhere? No: search_code for uniqueItems|nullable|x-guidance|deprecated across the repo at PR head finds them only at docs/api.md:940-941 (this PR) and in helios/src/grammar.rs:1620-1626 tests; docs/core-design.md has no mention of validate_schema_nodes, the allowlist, or json_schema (its only "allowlist" hits at docs/core-design.md:307, :322 are about cache/page geometry, unrelated). So #704 is the first place in docs/ that names the accepted keyword set. That matches yatesdr's #449 statement that "no document lists the accepted keywords".

#9 [high] Claims/evidence: parity claim holds but cites 3d1614cc (not head 77941c4); error-code hunk is not this PR's

Two claims in the PR body, plus the unrun checks, and what backs each.

  1. "Verified programmatic 1:1 set parity between validate_schema_nodes in helios/src/grammar.rs at 3d1614cc and the documented keyword lists in docs/api.md (42 == 42: 29 structural + 13 metadata; zero missing, zero extra, zero duplicates)." The commit 3d1614cc cited is not the PR head (head is 77941c4 per the packet), so the claim is stated against an earlier revision of helios/src/grammar.rs; the allowlist at head is unchanged in substance (I re-checked all arms at grammar.rs:902-948 and the count holds), so the claim survives, but the citation does not point at head. The script itself is not identified. No pr_files entry shows any code change, consistent with a docs-only diff.
  2. "Verified MAX_GRAMMAR_BYTES (262,144), MAX_SCHEMA_DEPTH (64), MAX_SCHEMA_NODES (8,192), and protocol field mapping in helios/src/grammar.rs and helios/src/server/protocol/decode.rs." True: grammar.rs:23-25 (values), :884 (depth/node check), :209 (byte check). Protocol mapping also true: text.format at helios/src/server/protocol/decode.rs:466-504 (responses_text_format), output_config.format at :561 and response_format at :562, with "json_schema" schema read from format["json_schema"]["schema"] (Chat) or format["schema"] (:568-576). The two read paths explain why docs/api.md:927-929 names both spellings. New: the text.format echo behavior is decode.rs:493-502 (echoes name, description, and strict), which the new paragraph does not mention.
  3. "Ran git diff --check (zero whitespace issues) and verified git diff --stat touches only docs/api.md." The second half is consistent with pr_files (1 file). Note however that pr_diff against the local base renders ~10 files; if that stale base is what the author ran git diff --stat against, the observation would not hold, so the claim presumably refers to the PR's own commit. I could not re-run git locally.
  4. "Unrun checks: no Rust, Python, simulator, formal, or GPU test suites were run because this PR modifies documentation only." Honest and complete for a prose change; the repo has no doc-lint/test job that would cover it. The only CI workflow that would even run on this PR is Native serving (.github/workflows/native-serving.yml:1-22 — triggers on pull_request, matrix ubuntu-24.04 + windows-2022), and it reported no checks on the head commit.
  5. Implicit claim "no behavior, runtime, or core-compatibility changes": confirmed — pr_files lists docs/api.md only, and docs/api.md is pure prose (no code-generated include: search_code for include_str!.*docs/ finds nothing).
  6. Absent: any statement that the documented keyword set is guarded by a test, and any statement about how the strict-tool list at docs/api.md:717-734 relates to the new one.

#14 [high] Research summary

Case file for PR #704 (docs/api: enumerate accepted response_format JSON Schema keywords) is complete; 13 scratchpad entries cover all eight angles.

What it is: one 17-line paragraph added at docs/api.md:927-942, inside "Conversation and tool semantics", enumerating 29 structural/constraint plus 13 metadata/annotation JSON Schema keywords accepted by validate_schema_nodes, plus the rejection rules (any other keyword, external $ref, and schemas over 262,144 bytes / depth 64 / 8,192 nodes → HTTP 400). pr_files confirms 1 file, +17/−0.

Most important findings, all outside the description:

Details, citations and the value/limit nuances of the keyword list (a floor, not a guarantee — format, dangling $ref, minimum>maximum, boolean schemas still 400 later) are in the scratchpad.

#5 [medium] Process: ready-for-review but zero reviews, zero CI, no labels, hours old

Process facts as of the orientation packet (2026-12-03):

#7 [medium] People: jcartu authored the strict-tool machinery (#418) and the sibling docs PR #461

jcartu is a CONTRIBUTOR (not one of the charter's priority contributors @voipmonitor/@original-el8/@lukealonso). Last 180 days: 6 merged PRs, 3 closed, 9 open. Merged areas: docs (5), helios/src (4), root (1), flare-cli/src (1), heliopause/src (1). Recent merged while this was in flight: #690 "Preserve inherited CUDA_HOME in ignition.cli.environment" (2026-12-02), #689 "helios/server: preserve typed error codes on HTTP request preparation failures" (2026-12-03 01:22), #687 "flare-cli, debian: sync flare.1 subcommands and fix 'an orbit' wording" (2026-12-02). Open siblings: #692, #691, #686, #688, #693, #642, #621, #461, plus issue #703. Track record in this exact area: #418 "Add strict function-tool schemas for DSML, Qwen, GLM and TML parsers" (merged 2026-11-22, +6048/−128, 16 files) is the author's and is what created the strict keyword subset in docs/api.md and the compile_strict_validators/helios/src/grammar/strict.rs machinery; #704's subject matter is its neighbourhood. #461 "Document strict tool selection and numeric range precision" (open, +88/−26) is the same author's ongoing docs work on strict schemas and has had two Autobot review rounds plus a yatesdr CHANGES_REQUESTED, with the yatesdr review noting "Or leave admission as it is and document the limit, which docs/api.md now states" — i.e. maintainers on this PR family are receptive to the "document it rather than change behavior" resolution, which is exactly #704's approach. Who contests/decides this area: yatesdr is the maintainer voice on the #449 allowlist question (his 2026-11-21 comment defines the closed-allowlist position and is the direct cause of #704) and is also the reviewer who requested changes on #461. lukealonso and voipmonitor also touch helios/src/grammar.rs per items_touching (from merged #626, #670 / open #500, #228, #94, #167). shieldstar authored #449 and is not a priority contributor; the issue's reporter's preferred fix (accept deprecated) is not what this PR does. Authorship pattern relevant to process: the author's docs PRs in this window routinely carry area:api, documentation, triage:review labels (#461, #686) and go through flare-autobot review; #704 has no labels, no review request, and no Autobot case file/comment yet, unlike #461, #686 and #689, which each got an Autobot case file within ~30 minutes of opening.

#8 [medium] Project fit: charter line 33 pledges documented JSON Schema subset; line 35 "bad docs"; no roadmap item

Charter (read_charter):

#10 [medium] Reach: callers on all 4 protocols; no runtime/config/dependency surface; #530 asks for an adjacent note

Reach — who and what is touched (all documentation-only; no runtime, wire, config, default, dependency, or core-format surface):

#11 [medium] Community: no engagement on #704; the topic has an active thread (#449) and a loud cost report (#530)

Community interest in #704 itself: zero. pr_comments returns "No comments"; no reviews; no labels; no reactions; no flare-autobot case file (contrast #461, #686, #689, which each got an Autobot case file within minutes of opening, e.g. #686 at 2026-12-02 20:50 for a 20:47 open). Age at review: hours (opened and last updated 2026-12-03).

Interest in the underlying topic, by contrast, is real:

#12 [medium] Recent activity: docs/api.md is high-churn; local base is stale by merged #689/#690/#687

Environment limitation first: the local copy's git history is unreadable at the PR's base ("Could not read c513e46a79f3b6ac510235aaf09bcf055b841958", search_history and the packet's "docs: not available" both fail), so per-commit recent activity in docs/ cannot be listed directly. What is established instead:

  1. The local copy of main is older than #704's merge base (cc0a49d). Evidence: pr_diff renders hunks in AGENTS.md, docs/TODO.txt, docs/api.md, docs/cli-design.md, docs/core-design.md, docs/model-preparation.md, docs/scheduling-runtime-design.md, flare-cli/src/cli.rs, flare-cli/src/orbit/agent.rs, while pr_files says 1 file. Those hunks are already-merged work visible at PR head but absent from local main, not part of this PR: PreparationError/preparation_error exists at pr/704 (helios/src/server/http.rs:119-130, :213-288) and not at local main (search_code for PreparationError in helios/ on main: no matches) — that is merged #689 (jcartu, merged 2026-12-03 01:22, +440/−26, docs/api.md +6/−3), whose docs sentence is exactly the "typed HTTP 400 rejections set error.code..." hunk at docs/api.md:257-262. Likewise the AGENTS.md/docs/cli-design.md/docs/model-preparation.md CUDA_HOME/TRITON_PTXAS_PATH/CPATH hunks are merged #690 ("Preserve inherited CUDA_HOME in ignition.cli.environment"), and the flare-cli man-page test + "an orbit's" fix is merged #687. Net: nothing in the rendered diff outside the one docs/api.md paragraph is attributable to #704.
  2. The packet's own note: "Commits on the default branch since this pull request branched (cc0a49d), touching its changed files: none" — so #704 does not build on or conflict with a commit landed after its branch point.
  3. docs/api.md is a high-churn file: items_touching(docs/api.md) lists 15 merged and 14 open PRs in the last 180 days, e.g. merged #689, #670, #657, #638 ("Echo Responses tools and text.format"), #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. So a trivial textual rebase is likely regardless of intent. The nearest known overlaps are #461 and #686, which both edit the required/named-tool-choice paragraph around docs/api.md:562-575 / :666-681 (per #686's Autobot review and #461's description) — 250+ lines above #704's insertion point at docs/api.md:924-942, so overlap with #704's own lines is unlikely.
  4. Same-day cluster worth noting: merged #689 (2026-12-03 01:22), the #449 comment announcing this PR (2026-12-03 11:40), and #704 itself (2026-12-03). The author is landing a coherent docs pass over docs/api.md: #689 (error codes), #704 (schema keywords), and the still-open #686 (tool_choice required) and #461 (strict selection/numeric precision).
  5. Missed cross-reference from #704 to #689: #704 says keyword rejections "return HTTP 400" (docs/api.md:939-942) without naming the typed error.code: invalid_grammar that #689 landed 670 lines earlier at docs/api.md:257-262. The two are the same rejection path (AdmissionError::Grammar -> "invalid_grammar", helios/src/server.rs:749 -> 400 at :738).

#15 [medium] Cross-reference: #689's typed-code sentence excludes Messages; #704 says bare HTTP 400 for all four

Detail the report should state about the typed-400 docs interaction (beyond my earlier notes):

Merged #689 (jcartu, merged 2026-12-03 01:22, docs/api.md +6/−3) added the sentence at docs/api.md:257-262: "On Chat Completions, Completions, and Responses, typed HTTP 400 rejections set error.code to context_length_exceeded, unsupported_feature, invalid_grammar, or invalid_image while keeping error.type as invalid_request_error." Messages is deliberately excluded from that sentence, because /v1/messages keeps the Anthropic {"type":"error","error":{"type":...,"message":...}} envelope with no code field (stated in #689's description and its Autobot review).

#704's new paragraph (docs/api.md:939-942) says schemas off the allowlist "return HTTP 400" for all four protocols including output_config.format on Messages, and does not mention error.code: invalid_grammar at all. Both statements are true and non-contradictory (status vs envelope), but they are 680 lines apart in the same file and were written by the same author the same day; nobody connects them. Code backing: AdmissionError::Grammar maps to HTTP 400 at helios/src/server.rs:738 and to error_code "invalid_grammar" at helios/src/server.rs:749. End-to-end proof that an invalid output schema yields 400 + invalid_grammar on all four routes (including Messages output_config.format): helios/src/server/runtime/phase_tests.rs:8871-8926 (test http_preparation_failures_preserve_typed_error_codes_and_protocol_envelopes, landed by #689).

Also: #704's authority for AdmissionError::Grammar -> invalid_grammar exists in the tree it renders only because #689 merged first; on local main the PreparationError plumbing is absent (search on main: no match), so the rendered diff shows both changes together even though only one is #704's.

#13 [low] Correction: "before grammar compilation" qualifier weakens the strictness nuance

Correction/qualification to my own nuance list (entry: "Claims/evidence: verified 42-keyword parity"): the doc's opening clause is "validate every schema node against a closed keyword allowlist before grammar compilation" (docs/api.md:929-930). The "before grammar compilation" qualifier does acknowledge that compilation happens afterwards and can fail, so the doc does not literally claim that an allowlist-clean schema compiles. The residual risk is only that a caller reads the enumerated list as "what my schema may contain" and still meets a 400 for e.g. {"type":"string","format":"not-a-format"} (grammar.rs:1624), a dangling #/$defs/missing $ref (grammar.rs:1629), minimum > maximum (grammar.rs:1630), overlapping oneOf (grammar.rs:1625), a boolean false schema (grammar.rs:1631), or an unknown type value (helios/src/server/runtime/phase_tests.rs:8873-8903, which asserts HTTP 400 + error.code: invalid_grammar for exactly such a schema on all four routes). So: the doc is accurate; the enumeration is a floor on what's accepted, not a guarantee. Also note grammar.rs:890-892 returns Ok for boolean schemas, so true/false are allowlist-clean and the "keyword allowlist" framing does not describe them at all; true is admissible and false is rejected later. Fair statement for the report: parity holds exactly; the list describes the keyword layer, and other admission rules still apply.

Also: the doc's per-node error path is HTTP 400 for all four protocols. Verified for Messages too: phase_tests :8896-8903 sends output_config.format json_schema with the invalid schema and asserts BAD_REQUEST + invalid_grammar, so the doc's "on Chat Completions and Completions ... Responses ... and Messages ... return HTTP 400" holds on every route it names.

#16 [low] Nuance: 262,144 bytes is the shared MAX_GRAMMAR_BYTES (also Lark/regex), measured after re-serialization

Accuracy nuance worth one line in the report's change/claims section: the 262,144-byte ceiling documented for JSON schemas is the same MAX_GRAMMAR_BYTES constant that bounds two other request grammars, but #704 presents it only in the JSON-Schema context.

Second nuance of the same kind: the JSON schema bound is measured on the re-serialized schema (schema.to_string().len()), not on the request body, so it is independent of max_body_bytes (default 32 MiB at helios/src/server.rs:141, permitted 1..=256 MiB at helios/src/server.rs:275-276, documented at docs/api.md:243-253). The new paragraph does not distinguish the two, and both produce 400 vs 413 respectively (413 request_too_large for body, docs/api.md:253; 400 for schema size, docs/api.md:939-942). A caller with a large schema sees 400, not 413 — worth stating because it is the one place the new text could be misread operationally.