Conventions report · NVIDIA/hyperflare-inference #461

Raw Markdown for agents: https://autobot.eidonix.com/p/7fac06f7-ef7a-4464-a30b-873ee8b52197.md

PR #461 review — lens C: conventions and duplication

Key findings

Conventions and duplication

1. New test duplicates an existing bounds test instead of extending it — nit

Where: helios/src/grammar/strict.rs:3888-3898 (new); precedent at helios/src/grammar/strict.rs:3006-3025.

The new test:

#[test]
fn strict_integer_maxima_preserve_large_inclusive_endpoints() {
    let compiler = GrammarCompiler::new(&byte_tokenizer(), 320, &[256, 257], &[]).unwrap();
    for maximum in [1_000_000_000_000_000_000u64, i64::MAX as u64] {
        let schema = json!({"type":"object","additionalProperties":false,"required":["n"],
            "properties":{"n":{"type":"integer","maximum":maximum}}});
        let grammar = validate_strict_tool_schema(&compiler, "measure", &schema).unwrap();
        grammar.validate(&json!({"n": maximum}).to_string()).unwrap();
        assert!(grammar.validate(&json!({"n": maximum + 1}).to_string()).is_err());
    }
}

The existing test at strict.rs:3006-3025 already covers the same construct with the same assertion shape:

fn strict_bounds_do_not_round_integers_or_fractional_multiples() {
    let schema = json!({"type":"object","additionalProperties":false,"required":["n","step"],
        "properties":{"n":{"type":"integer","maximum":9007199254740992u64},"step":{"type":"number","multipleOf":0.1}}});
    ...
    grammar.validate(exact).unwrap();        // n = 9007199254740992
    assert!(grammar.validate(rounded).is_err()); // n = 9007199254740993

The new case varies only the endpoint values (10^18, i64::MAX) and lives roughly 880 lines away under a different name.

Why it matters: the property "a large inclusive integer maximum endpoint is accepted and its successor is rejected" now has two owners. A future change to llguidance pinning or to the bound-emitting path can fix or break one test without the other, and a reader looking for this coverage has no reason to look in two places. AGENTS.md:189-194 asks for focused validation of the affected behavior, not a second home for an existing check.

Fix: add 1_000_000_000_000_000_000u64 and i64::MAX as u64 to the existing test's coverage (a loop over maximum values in the schema built at strict.rs:3007, or a case appended inside the same function), so one test owns "large integer maximum endpoints". If the author prefers to keep the schemas separate, place the new test immediately after strict.rs:3025 so the pair is read together.

2. docs/api.md loses two precise statements when the 2^53 sentence is rewritten — nit

Where: docs/api.md:600-603 (new text); removed text from the same paragraph, visible in the PR diff.

Removed:

…numeric enum and const literals are parsed at IEEE 754 binary64 precision and must have magnitude strictly below 2^53 (9,007,199,254,740,992, so integer literals lie in [-9,007,199,254,740,991, 9,007,199,254,740,991]; pass larger exact identifiers or higher-precision decimals as strings).

Replacement:

…Numeric enum and const literals are parsed at binary64 precision and must have magnitude strictly below 2^53. Use strings for identifiers or decimal values that must be represented exactly.

Two pieces of precision are lost:

Why it matters: this PR's whole argument is that the docs must distinguish precision loss from an unsupported schema. Dropping the interval and the standard's name moves in the opposite direction: the range statement that made the earlier sentence checkable is gone, and the surrounding paragraph now leans on 2^53 and 9007199254740992 without ever giving the accepted interval. repo-prose SKILL.md:44 asks for the substantive limitation to be stated directly.

Fix: keep the qualifier and the interval, e.g. "…parsed at IEEE 754 binary64 precision and must have magnitude strictly below 2^53, so integer literals lie in [-9007199254740991, 9007199254740991]. Use strings for identifiers or decimal values that must be represented exactly." The new paragraph at 605-612 then reads as the range-bound counterpart rather than a replacement.

3. Formatting of the new paragraph departs from the surrounding page — nit

Where: docs/api.md:605-612.

Why it matters: small, but this is the page a client implementer reads for numeric limits; wrapping the long example line and choosing one separator convention keeps the new paragraph visually part of the same reference. Pasteable JSON literals are a defensible reason to skip separators, in which case only the wrap needs fixing.

Fix: rewrap api.md:607 to the paragraph's ~80-column measure; either keep unseparated literals consistently (and avoid adjacent separators) or restore separators in prose and keep unseparated values only inside code spans that are meant to be copied.

Cleared — checked and not reported

Open questions and what could not be established