Conventions report · NVIDIA/hyperflare-inference #457

Raw Markdown for agents: https://autobot.eidonix.com/p/97843e76-41c6-46e8-b907-94bf3030db32.md

Review of PR #457 — lens C: conventions and duplication

Reviewed at head aacbca1 against main (b9cac83). I read the charter, AGENTS.md (contribution scope and rejection criteria, required prose review), docs/design-review.md, .agents/skills/repo-prose/SKILL.md (not opened), then each changed construct in its surrounding code: TmlOutput's state machine and finish() (helios/src/output/tml.rs), compile_content_headers beside compile_recipient (helios/src/grammar.rs), compile_strict_tml beside its tools: rule (helios/src/grammar/strict.rs), and the sibling parsers recipient.rs, xtml.rs, dsml.rs, tagged.rs. Nothing in this lens rises to blocking.

Key findings

Conventions and duplication

1. Should fix — duplicated ignored test adds no coverage

helios/src/server/request/tml_tests.rs:395-439, versus helios/src/server/request/tml_tests.rs:248-282.

The request is the same (Protocol::Responses, input "Inspect the branch.", one bash function tool); the only difference is the explicit "tool_choice":"auto" at tml_tests.rs:403, which is the default the first test already gets. The token stream is identical:

The asserted properties are the same response.failed / status: "failed" pair (tml_tests.rs:437-438 versus :278-279); the first test additionally checks error.code == "server_error" and the message substring (:280-281), so the second's assertions are a strict subset.

Why it matters: AGENTS.md:189-194 requires tests that exercise the affected behavior and "each PR focused on one coherent outcome"; AGENTS.md:183-188 rejects churn. Both tests are #[ignore]d on FLARE_INKLING2_TEST_SNAPSHOT (tml_tests.rs:247, :394) and are run with --ignored --test-threads=1, so the duplicate also pays a second snapshot load for no additional signal. The PR description's "Supporting Evidence" lists both as separate passing checks, which makes the suite look broader than it is.

Fix: delete inkling_stress_untyped_closed_header_must_surface_failure; if the tool_choice: "auto" variant is meant to be covered, add it as a second request inside the first test's body rather than as a new ignored test. Nothing about the captured 18-token suffix (tml_tests.rs:421-424) is lost — it is the same suffix as tml_tests.rs:268-270.

Aside, same family: the two new #[ignore] messages read "with an Inkling 2 tokenizer" (tml_tests.rs:394, :442) while every other ignored test in the file reads "with the Inkling 2 tokenizer" (:103, :161, :247, :285, :302, :351). Fold into the same cleanup.

2. Nit (churn) — a third copy of the wire-to-token splitter in tests

helios/src/grammar/strict.rs:4572-4588.

The encode closure in strict_tml_grammar_allows_unnamed_headers_and_preamble_before_tools is character-for-character the closure at helios/src/grammar/strict.rs:4205-4221 (same filter_map(...).min_by_key(|(at, _, _)| *at) scan, same rest[..at].bytes().map(u32::from) expansion, same control-token push). A functionally identical helper already exists one module over as pieces() at helios/src/server/protocol/tests.rs:2048-2066, and a fourth ad-hoc copy of the same scan sits at helios/src/server/protocol/tests.rs:469.

The setup is copied too: byte_tokenizer_with(&CONTROL_MARKERS) plus the CONTROL_MARKERS.iter().map(|m| (tokenizer.token_to_id(m).unwrap(), (*m).to_owned())) control list at helios/src/grammar/strict.rs:4546-4551 repeats helios/src/grammar/strict.rs:2814-2819 verbatim, and the GrammarCompiler::new(&tokenizer, 320, &[256, 257], &controls) line appears at grammar.rs:1178, grammar.rs:1948 and strict.rs:2819/4551.

Why it matters: the splitter encodes the invariant "control markers become one token each, everything else is bytes" that several suites depend on; a marker-rule change now means editing three copies, and AGENTS.md:183-188 says refactoring must support the requested behavior or remove a defect source — an added copy does the opposite.

Fix: hoist one splitter next to byte_tokenizer_with (helios/src/grammar.rs:936) and call it from strict.rs:4205, strict.rs:4572 and protocol/tests.rs:2048. Optional but cheap: a small compiler_with_controls(&tokenizer) helper beside it.

3. Nit — inkling_stress_ prefix is a label, not a behavior name

helios/src/server/request/tml_tests.rs:395 and :443.

Every other test in the file names the property under test: prompts_match_tml_renderers_token_for_token (:104), message_endpoints_are_prefixes_of_longer_conversations (:162), outputs_match_reference_parses (:286), structured_output_grammars_constrain_frames (:352), a_model_frame_without_a_content_kind_reports_a_failed_response (:248). So do the two new grammar tests (content_headers_grammar_allows_preamble_before_tools, grammar.rs:1932; strict_tml_grammar_allows_unnamed_headers_and_preamble_before_tools, strict.rs:4526), which is why only the request-side pair stands out. stress appears nowhere else among Rust tests in the repository.

Why it matters: .agents/skills/repo-prose/SKILL.md:15-25 (not opened) forbids lifecycle/experiment labels as identities and unexplained identifiers, and AGENTS.md:38-45 makes that skill mandatory for names. A name carrying stress tells a later reader nothing about what must hold.

Fix: untyped_closed_header_must_surface_failure and custom_grammar_allows_preamble_then_tool (the latter also drops the false suggestion that the test is about load or stress).

4. Nit — the new finish() error narrates cause instead of naming the state

helios/src/output/tml.rs:399-401.

The new message is "TML model header closed without a content kind and the turn produced no answer or tool call". Every sibling parser's terminal error names the incomplete state in a few words: "unterminated recipient header" (helios/src/output/recipient.rs:293), "incomplete XTML output envelope" (helios/src/output/xtml.rs:246), "incomplete DeepSeek tool call at end of response" (helios/src/output/dsml.rs:380), format!("incomplete {} tool call", D::NAME) (helios/src/output/tagged.rs:301).

Why it matters: the string is not internal. It reaches clients as the response.failed message through Encoder::failure (helios/src/server/protocol/encode.rs:760), so its wording is user-visible prose, and it is the only one of the family that explains causality rather than the state. repo-prose SKILL.md:13-14 ("describe the system as it exists … do not narrate the journey") and :38-39 point the same way.

Fix: something in family, e.g. "TMLv0 model frame never reached a content kind" or "incomplete TML model frame". Note the two new assertions pin the current wording: helios/src/output/tml.rs:608/:622 (unit tests) and helios/src/server/request/tml_tests.rs:281 assert the substring "without a content kind", so update those three assertions together.

Checked and clean (deliberately not raised)

Open questions / not verified