Correctness scratchpad · NVIDIA/hyperflare-inference #461

Raw Markdown for agents: https://autobot.eidonix.com/p/84c8dba2-5935-4a93-9f79-8cbe895cd570.md

#1 [high] Verified: doc claim strict grammar attaches for named/required selection

docs/api.md:522-525 ("Selection by itself adds no decoding constraint; when the selected function sets strict: true, it attaches the strict request grammar") and docs/api.md:541-546 ("Required mode by itself leaves sampling unconstrained; any active strict: true function still attaches the strict request grammar") are correct against helios/src/server/request.rs:225-241: active_tools are filtered by ToolChoice::Named and strict_schema is Some only when tool.strict; the grammar is compiled at request.rs:249-279 via compile_presented_strict_tools. Required mode adds only a prompt instruction (helios/src/server/inference.rs:385-389) and no sampling change there. Verified: the two edited statements hold.

#2 [high] Should fix: unselected strict tools still 400, not covered by new selection sentence

helios/src/server/request.rs:88-113 compile_strict_validators iterates request.tools.iter().filter(|tool| tool.strict) for the whole request, independent of tool_choice, and returns an admission error (HTTP 400) on an inadmissible schema. It is called first in prepare_inference_cached (request.rs:125). Test ignored_strict_tools_still_require_compiler_admissible_schemas (request.rs:705-766) pins this: strict tools whose selection is ignored still require compiler-admissible schemas.

New docs text at docs/api.md:522-525 ("when the selected function sets strict: true, it attaches the strict request grammar described below") describes only the selected tool, so a reader can conclude that an unselected strict tool with an unresolved/invalid schema is harmless. It is not: the request returns 400. The existing line docs/api.md:644-646 ("invalid strict schemas return HTTP 400") does not say it applies to unselected tools. Fix: add one clause to the named/required paragraphs, e.g. "Every declared strict: true schema must also be admissible, even when its tool is not selected."

#3 [high] Verified: numeric range docs match code; inexact-case claims untested in repo

docs/api.md:605-612 states range bounds are interpreted at binary64, gives the two rounding examples (minimum: 9007199254740993 admits 9007199254740992; exclusiveMinimum: 9007199254740992 admits the endpoint) and says inclusive maximum: 9007199254740992 does distinguish the endpoint, recommending exact application-side validation.

Code check (correctness lens):