PR #461 — Document strict tool selection and numeric range precision (lens B: architecture and scope)
Head e831b49, base main, 2 files, +39/−14: docs/api.md (+27/−14) and a
test-only change in helios/src/grammar/strict.rs (+12/−0). No production code
changes. Reviewer yatesdr had requested changes and offered two options; the
author took the second — "leave admission as it is and document the limit, which
docs/api.md now states" (PR comment 2026-11-23 15:29).
Key findings
- Should fix — the documented deviation has no TODO record. The new
paragraph (docs/api.md:605-612) states a known deviation of the strict
grammar from the declared schema, but
docs/TODO.txthas no entry for it, against AGENTS.md:47-55 ("Record unresolved defects … in docs/TODO.txt, not in design documents") and the repo-prose skill's present-state rule. - Should fix — the documented rounding behaviour is not pinned by any test.
The added test
strict_integer_maxima_preserve_large_inclusive_endpoints(helios/src/grammar/strict.rs:3888-3898) covers only inclusivemaximum. Neither documented rounding example is asserted, so the docs are the sole record of the contract against a=1.9.1-pinned llguidance (helios/Cargo.toml:62). - No blocking finding. The change belongs in the repository and sits at the
right layer: it is the maintainer-offered documentation alternative, the prose
is in the file
docs/core-design.md:1684already delegates the strict schema subset to, the runtime diff against the PR base is empty, and the new selection/required-mode wording matches the code it describes.
Scope: does this belong in the repository?
Yes, and it is authorized. AGENTS.md:160-164 accepts "an explicit maintainer request … or inaccurate documentation"; the charter's "What gets merged" includes "bad docs". The reviewer's own review offered the documentation route, and the author took it explicitly (PR comment 2026-11-23 15:29: "I took the documentation alternative from your review"). No unapproved scope expansion under AGENTS.md:166-170 or design-review.md:122-133: no new API surface, no flag, no configuration switch.
Approach and layering
Right document. docs/core-design.md:1684 delegates "the accepted strict
schema subset, parser formats, protocol mappings and streamed errors" to
docs/api.md, and core-design.md:1669-1683 already states that a grammar
constrains the answer, that required mode without a grammar uses ordinary
sampling, and that named selection does not by itself enable a grammar. Putting
the selection/grammar distinction and the numeric-bound limitation in
docs/api.md follows that delegation rather than duplicating architecture prose.
The new selection and required-mode wording matches the code.
- 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") —prepare_validated_inferencesetshas_active_strict_toolfrom the selected tools' strict schemas and compiles a request grammar only then, helios/src/server/request.rs:225-249;ToolChoice::Namedotherwise only filters the presented definitions, request.rs:498-501. - docs/api.md:544-546 ("Required mode by itself leaves sampling unconstrained; any
active
strict: truefunction still attaches the strict request grammar") — required mode adds only the call instruction and validates the completed call; nothing in that path changes sampling. The replaced sentence "Sampling is unchanged" was narrower and less accurate than the new wording, which now covers the strict-tool exception. No behaviour claim is lost.
No admission weakening in code. The net runtime diff against the PR base is
empty, so no strict guarantee is relaxed: validate_strict_node still rejects
numeric const/enum literals at or above 2^53 (helios/src/grammar/strict.rs
const/enum gate, exercised at strict.rs:3900-3987 including the ±(2^53−1)
endpoint rows at 3950-3978), and range keywords are still required to be finite
numbers (strict.rs:575-584). The PR splits the const/enum magnitude restriction
from range keywords without touching either rule.
No per-model special case or flag. The prose is generic across parsers; the only existing parser-specific strict-tool statement (TMLv0 declared names, docs/api.md:614-615) is unchanged apart from re-wrapping.
Compatibility with what exists
The description claims "No requests accepted on main acquire a new HTTP
400", and the empty runtime diff supports it. Checked against the code: the
range-keyword check admits any finite as_f64()
(helios/src/grammar/strict.rs:576-583), which is what keeps minimum: 9007199254740993 and exclusiveMinimum: 9007199254740992 from becoming
admission errors — the alternative the reviewer offered (refuse only bounds
llguidance rounds) would have made them 400s. The documentation route therefore
preserves those requests, as the description says. The one documented
counter-example direction, inclusive maximum: 9007199254740992 distinguishing
the endpoint from the next integer, is already covered by
strict_bounds_do_not_round_integers_or_fractional_multiples
(strict.rs:3006-3016), which the PR leaves unchanged.
Evidence for claims
No performance claim is made, and the description says so ("No GPU benchmark was run; there is no performance claim"), satisfying design-review.md:94-102. design-review.md:161-163 states documentation changes do not require GPU tests, so the absence of a benchmark is not a gap. The Discord line is present ("Discord: jcartu"), satisfying design-review.md:150-156 and AGENTS.md:137-148. The description follows the four-part scheme of design-review.md:134-147 (Why / What changed / Compatibility / Evidence).
The correctness evidence, however, is thin in one respect: the description's rounding examples come from the reviewer's aarch64 run and are not carried as a test in the PR — see finding 2 below.
Findings
1. Should fix — the unresolved llguidance rounding defect is recorded only in docs/api.md, with no docs/TODO.txt entry
File: docs/api.md:605-612 (new paragraph) against docs/TODO.txt.
The paragraph documents a real deviation: for an integer property,
minimum: 9007199254740993 can admit 9007199254740992, and
exclusiveMinimum: 9007199254740992 can admit the endpoint. helios
does not compensate — range keywords pass admission as long as they are finite
numbers (helios/src/grammar/strict.rs:576-583) and are then handed to the pinned
llguidance (=1.9.1, helios/Cargo.toml:62). The reviewer confirmed both rows on
main at 6d6fe0c6, and the PR description repeats them under Compatibility.
AGENTS.md:47-55: "State designed behavior that the code does not implement as a
specification marked designed, not implemented… Record unresolved defects, unrun
checks, and pending measurements in docs/TODO.txt, not in design
documents." The prose skill states the same present-state rule
(.agents/skills/repo-prose/SKILL.md (not opened):26-34). docs/TODO.txt has no entry for
this defect (searched for 900719925474099, 2^53, and numeric-bound wording;
the only strict-tool item is docs/TODO.txt:25, qualifying strict: true on
TMLv0 cores). As written, the limitation is documented with no owner, no removal
criterion and no tracked follow-up.
Fix: keep the api.md paragraph (it correctly states the present limitation and
the client-side workaround) and add a docs/TODO.txt entry naming the missing
condition and its removal criterion, e.g. "Refuse or exactly enforce strict-tool
minimum/maximum/exclusiveMinimum/exclusiveMaximum above 2^53;
llguidance 1.9.1 rounds them. Remove when the api.md examples stop reproducing."
2. Should fix — the two documented rounding outcomes are asserted nowhere in the repository
File: docs/api.md:605-612 versus helios/src/grammar/strict.rs:3888-3898.
The single added test covers only the inclusive-maximum side: for maximum in
{10^18, i64::MAX} the endpoint is admitted and its successor rejected. The
behaviours the new paragraph documents — minimum: 9007199254740993 admitting
9007199254740992, and exclusiveMinimum: 9007199254740992 admitting the
endpoint — are not asserted. Searching helios for those literals returns only
the const/enum rows (strict.rs:3906-3917, 3950-3978) and the unchanged inclusive
maximum test (strict.rs:3008-3011); nothing exercises a rounding range bound.
Why it matters: llguidance is pinned at =1.9.1 (helios/Cargo.toml:62), and the
documented limitation is now the only description of that contract. A dependency
bump can change either side silently, leaving the API reference false with no
signal. AGENTS.md:189-194: "Tests must exercise the affected behavior or
contract… describe its problem, resulting behavior, validation, and material
limitations"; design-review.md:94-102 (principle 12) asks that evidence be
attached to the claim. The reviewer's evidence was a scratch test that the PR does
not carry.
Fix: extend the added test, or add a sibling, asserting the two documented rounding outcomes and naming them as the current limitation, so an llguidance change turns the docs stale visibly. If a test that asserts the wrong-but-current behaviour is judged to bless it, say so explicitly in the TODO entry and in the PR's stated limitations.
Considered and not reported
- The deleted integer interval. The old text spelled out
[-9,007,199,254,740,991, 9,007,199,254,740,991]; the new text says magnitude strictly below2^53, which implies the same interval for integer literals. No accuracy lost, and the old interval was misleading once range keywords were separated fromconst/enum. - The reworded required-mode sentence. The removed "Sampling is unchanged" is replaced by "Required mode by itself leaves sampling unconstrained", which is still true: the strict-tool path compiles a grammar and does not alter sampling parameters (helios/src/server/request.rs:225-265).
- Client-side validation advice (docs/api.md:611-612). Recommending exact application-side validation before executing a tool is a client obligation stated in the API reference, not a runtime policy change; it does not move policy across the preparation/runtime boundary (design-review.md:122-133).
- No GPU validation. Documentation changes do not require GPU tests (design-review.md:161-163).
Open questions and what could not be found
- Whether the maintainer who requested changes (
yatesdr) accepts documenting the rounding rather than refusing those bounds is a policy call I cannot settle from the repository; the review offered both and the author chose the documentation route. - The exact llguidance behaviour for
exclusiveMaximumabove2^53is not demonstrated anywhere in the repository; the description lists the twominimum/exclusiveMinimumexamples only. A test (see finding 2) would settle whetherexclusiveMaximumneeds the same caution in the prose. - No test or documentation states what happens to a
number(non-integer) property whose range bound sits above2^53; the paragraph is written forintegerproperties and its last sentence is generic. Behaviour is unverified here.