Review — PR #461 "Document strict tool selection and numeric range precision" (lens E, prose)
Lens: the PR description, its commit messages, and the docs and comments it changes, judged against the repository's writing rules (AGENTS.md "Required prose review" and "Required PR descriptions", docs/design-review.md principle 16, .agents/skills/repo-prose/SKILL.md (not opened)).
Key findings
- The new range-bounds paragraph tells a client to keep a large bound and validate in the tool, but some large bounds are already refused with HTTP 400.
docs/api.md:605-612frames the whole space of largeminimum/maximum/exclusiveMinimum/exclusiveMaximumvalues as "interpreted at binary64 precision … validate the tool arguments with exact arithmetic before executing the tool". The reviewer's own table on this PR (yatesdr, 2026-11-23 15:04, on main6d6fe0c6) records thatminimum: -9223372036854775808on anintegerproperty andminimum: 2^60on anumberproperty are already refused by llguidance with a range error, i.e. HTTP 400 underdocs/api.md:644-645("invalid strict schemas return HTTP 400"). Admission inhelios/src/grammar/strict.rs:575-584only requires each bound to have anas_f64representation, so the refusal comes from the downstream compiler and is invisible in this repository's code — which is exactly why the document has to say it. Severity: should fix. - The passage codifies an unresolved enforcement defect without the TODO entry the repository requires. The new text states that a strict
integergrammar admits values its schema forbids, and the PR description says plainly "This does not fix llguidance's rounding".AGENTS.md:47-55requires unresolved defects to be recorded indocs/TODO.txt, "not in design documents", and.agents/skills/repo-prose/SKILL.md:38-39(not opened) requires a TODO to name the missing condition and the criterion for removal.docs/TODO.txthas no entry for large strict numeric bounds; its only strict-tool item isdocs/TODO.txt:25-28(TMLv0 qualification). Severity: should fix. - Nothing blocking. The description's compatibility claim checks out: the only
helios/srchunk is a#[cfg(test)]function (helios/src/grammar/strict.rs:3888-3898), so no code path changes and no accepted request gains a 400 — the claim in the PR body is accurate, not merely asserted.
PR description: the four required parts
AGENTS.md:67-107 requires, in this order: why, what exactly changed, the claimed benefit or result, and the evidence, with material limitations visible (AGENTS.md:98-104) and headings not mandatory but content and order mandatory (AGENTS.md:129-135).
- Why — present and causal, not a restatement of the diff: "Named and required tool selection do not, by themselves, constrain decoding" and "rejecting every bound at or above
2^53would reject inclusive integer maxima that the grammar enforces exactly". It also names the constraint that makes the approach valid (documentation preserves requests that a stricter admission rule would refuse). Good. - What changed — present, before/after explicit ("The API reference now distinguishes tool selection from a strict function's grammar… keeps the magnitude restriction … separate from
minimum,maximum…"). Accurate against the diff. - Claimed result — the weakest part. The only result statements are inside Why ("Documenting the limitation preserves those requests") and inside Compatibility ("No requests accepted on
mainacquire a new HTTP 400").AGENTS.md:90-97wants the claimed benefit stated precisely and before the supporting evidence, distinguishing expectation from measurement. Here a reader gets the benefit two sections early and partially, and the section that occupies requirement 3's slot is "Compatibility". The content exists and the order is not violated outright, so this is a nit rather than a should-fix; the fix is one sentence at the head of a "Result" statement, e.g. "Result: the API reference now states both rounding behaviours and the exact-endpoint cases that admission accepts; no decoding or admission behaviour changes." - Evidence — present and well scoped: the aarch64 review link, the commit it was observed at (
6d6fe0c6), the method (strictschema admission plusTextGrammar::validate), the unchangedmaximum: 9007199254740992regression against the PR base, the new test's contract, the exactcargo testcommand with counts (28 passed, 0 failed, 1 ignored), and an explicit "No GPU benchmark was run; there is no performance claim". This satisfiesAGENTS.md:98-107including "Never invent evidence". - Discord line — present as the last line,
Discord: jcartu, no leading@(AGENTS.md:139-146). Correct. - Limitation disclosure — the Compatibility section volunteering the two rounding cases and naming the exact values is exactly the "keep material limitations visible" requirement; it is the strongest prose in the description and should stay.
Commit messages
- The head commit
e831b496"Preserve admission for large strict numeric bounds" describes the branch relative to its own earlier commita640a302, not relative to the merge base6b58639; against the base, admission was never changed..agents/skills/repo-prose/SKILL.md:40-43(not opened) asks a commit to state the resulting behaviour and compatibility impact, which for a squash-merge subject this is only true in a history the reader cannot see. Nit — fix by squashing to a subject that states the net change ("Document strict tool selection and numeric range precision"), which the PR title already supplies. - yatesdr's nit on
a640a302(its commit body carries #418's timing provenance) has not been answered in the branch: the author's reply (2026-11-23 15:29) says only "the PR description no longer cites unrelated timing results".AGENTS.md:124-127rejects audit artifacts and development chronology, andrepo-prose SKILL.md:26-29rules out changelog/defect-report material in repository prose. Nit — remove the passage in the squash. Caveat: I cannot read commit bodies with the available tools (search_historyreturns subjects only), so this carries the reviewer's quotation rather than an independent check.
Changed docs and comments
docs/api.md:605-612 — new range-bounds paragraph (should fix)
Correct where it can be checked:
- "An inclusive
maximum: 9007199254740992does distinguish the endpoint from the next integer" matcheshelios/src/grammar/strict.rs:3006-3016(exactaccepted,rounded=9007199254740993rejected) and the reviewer's row for the same bound. - "For an
integerproperty,minimum: 9007199254740993can admit9007199254740992" and theexclusiveMinimumcase match the reviewer's observation on main; both are single-case observations, so the "can admit" hedge is the right grammar. - It correctly keeps the
const/enummagnitude restriction separate from range keywords — the two fail differently (admission error athelios/src/grammar/strict.rs:348-371versus silent rounding of a bound), and conflating them is what yatesdr objected to in the earlier revision.
Two defects:
- Omitted outcome. Some large bounds are refused outright, not rounded, so the paragraph's advice ("keep the bound, validate with exact arithmetic inside the tool") is wrong for them; the reader's fallback is an undocumented 400. Fix: one sentence in the same paragraph — bounds whose magnitude the schema compiler cannot represent are rejected at admission with HTTP 400, so a bound must be kept within the exact range or moved to application-side validation. Nothing in
helios/src/grammar/strict.rs:575-584can settle which bounds those are; only a test throughvalidate_strict_tool_schemaasserting the outcome of each bound keyword at2^60and-2^63would, and the paragraph should then quote the test. - Unresolved defect in a specification document.
AGENTS.md:52-55: "Record unresolved defects … in docs/TODO.txt, not in design documents." The paragraph documents that the engine admits values the schema forbids; that is a defect report as well as a limitation. Bypass criterion: it is legitimate as an API-contract limitation, but it must be paired with adocs/TODO.txtentry that names the missing condition and the removal criterion (repo-prose SKILL.md:38-39), e.g. "Reject or exactly enforce large strict numeric bounds so anintegergrammar does not admit a value itsminimum/exclusiveMinimumforbids. Close when a test shows the 9007199254740992 cases are refused during generation, or whendocs/api.md's guidance is no longer needed." No such entry exists.
Nit at docs/api.md:608-609: "…can admit the endpoint itself because adding one rounds back to the same number" states a mechanism inside llguidance. Nothing in this repository shows that exclusive bounds are implemented as bound + 1; docs/design-review.md:134-149 rejects unexplained references and unsupported claims in changed prose. Either drop the causal clause or cite where the exclusive-bound handling lives.
Nit at docs/api.md:600-603: the rewrite drops the removed text's exact expansion — "9,007,199,254,740,992, so integer literals lie in [-9,007,199,254,740,991, 9,007,199,254,740,991]" — leaving only "must have magnitude strictly below 2^53". The predicate is still correct (the 2^53 endpoint itself is rejected by helios/src/grammar/strict.rs:3910-3947), but a client no longer gets the inclusive range or the decimal value, and has to convert 2^53 itself. Restoring the expansion costs one line.
docs/api.md:522-525 — named selection (verified consistent)
"retaining conversation history and adding no separate call instruction. Selection by itself adds no decoding constraint; when the selected function sets strict: true, it attaches the strict request grammar described below." Matches helios/src/server/request.rs:225-241: active tools are filtered to the named tool and a grammar is compiled only when some active tool is strict; also agrees with docs/core-design.md:1679-1683 ("Named tool selection filters the definitions to that tool; it does not by itself enable a grammar"). Replacing "adding no instructions or decoding constraints" with the split sentence is a genuine improvement: the old sentence contradicted itself once a strict named tool attached a grammar. No finding.
docs/api.md:540-552 — required mode (verified consistent)
"Required mode by itself leaves sampling unconstrained; any active strict: true function still attaches the strict request grammar" matches helios/src/server/request.rs:225-241 (Required keeps all tools, grammar compiled if any is strict) and docs/core-design.md:1679-1680. Dropping "Sampling is unchanged;" removes nothing that the new sentence does not cover, and the paragraph keeps its error contract (HTTP 500 buffered, terminal error event for streams) unchanged. No finding.
helios/src/grammar/strict.rs:3888-3898 — added test prose
The name strict_integer_maxima_preserve_large_inclusive_endpoints and the body agree: both accepted maxima are inclusive endpoints, and each successor is rejected. Two scope notes for the description rather than defects: it exercises only maximum, so the minimum / exclusiveMinimum claims in the new docs paragraph remain supported only by the reviewer's scratch test; and maximum + 1 for i64::MAX is emitted as an unsigned literal, which is the value the assertion needs. The test carries no comment that needs rewriting under repo-prose SKILL.md:38-39.
Evidence and claims
- Every claim in the description that I could check in code holds: no runtime hunk, the
maximum: 9007199254740992regression is untouched (helios/src/grammar/strict.rs:3006-3016), and the named/required paragraphs describe the code. - The two rounding cases are attributed to a named platform, commit and method, and the description explicitly declines to call them fixed. That is the correct handling of evidence the author did not produce.
- No performance claim is made and no benchmark implied, so
AGENTS.md:90-97's metric requirements do not apply.
Open questions and what could not be settled
- Which bound keywords and magnitudes admission actually refuses.
helios/src/grammar/strict.rs:575-584accepts anyas_f64value, so the refusal lives in llguidance and only a test can pin it. Until that test exists, the docs cannot state the refusal precisely, and the paragraph stays incomplete (finding 1). - Whether the reviewer's
minimum: 2^60on anumberobservation reproduces on x86_64 and in the shipped llguidance version; the PR's own run was CPU x86_64 but covered onlygrammar::strict::tests::. - Commit bodies of
a640a302ande831b496— not readable with the review tools; the commit-message nit rests on the reviewer's verbatim quotation. - Whether a
docs/TODO.txtentry for the rounding defect already exists under wording I did not search (I searchedstrict|llguidance|binary64|numeric|round; the only strict-tool hit isdocs/TODO.txt:25-28).