Verdict: worth merging — with four small changes (one of them a merge blocker)
This is a genuine root-cause bug fix at the right layer, in the layer that owns the wire bytes, with a tiny footprint and no flags, no per-model branch, and no core-format change. It closes a maintainer-tracked roadmap item (docs/TODO.txt:5-8). It needs a DCO sign-off before merge, and three description/doc/tracking corrections.
Why the change is the right one (charter: "reproducible bug", "root cause", "smallest footprint")
The defect is real and the diagnosis is correct. Before this PR TmlOutput::call parsed the TMLv0 invocation body into serde_json::Value, then re-serialized it (object.len() != 2 / args.to_string(), old helios/src/output/tml.rs:329-348). serde_json is built with preserve_order, float_roundtrip, raw_value but not arbitrary_precision (helios/Cargo.toml:52), so a 30-digit integer round-trips through Value::Number as binary64 (1.2345678901234568e29). OutputEncoder holds every strict call until it completes, then validates the buffered argument text against the TextGrammar compiled at admission (helios/src/server/protocol/encode.rs:517-553, validator at :539-541); the grammar emits an integer, the parser hands it back as a float, and helios/src/grammar.rs:653 fails the request with strict tool arguments does not match its grammar → HTTP 500. That is exactly the failure the PR describes, on exactly that path — this is not a symptom being swallowed, and it is not fixed by retrying or by weakening validation.
It fixes the problem where the project already fixes it. The Qwen function-tag and GLM argument-tag parsers already keep raw JSON tokens for strict non-string scalars through RawArguments / strict_nonstring_raw (helios/src/output/tagged.rs:805-859), and #418 added a 30-digit test for them (helios/src/grammar/strict.rs:3723-3817). TMLv0 was simply the one parser left behind, which is why #418 had to leave docs/TODO.txt:5-8 open. This PR brings TMLv0 to parity rather than inventing a new mechanism, so the "solve the right problem in the right place" and "no per-model special cases" rules are satisfied: rml.rs (not opened) becomes #[serde(deny_unknown_fields)] RawCall { name: String, #[serde(borrow)] args: &'a RawValue }, gate on args.get().starts_with('{') (helios/src/output/tml.rs:329-363), emit args.to_owned() verbatim (:359). raw_value is already an enabled feature, so there is no dependency change — which also matters given the project's "pin everything" rule.
Who benefits, how much
Anyone serving a TMLv0 core (Inkling 2 Small / Mini NVFP4, the recipes named at docs/model-preparation.md:324 (not opened)) through OpenAI Chat Completions or Responses with strict: true function tools, and any agent client that passes exact identifiers (audit IDs, hashes-as-integers, snowflakes) rather than strings. The failure mode being removed is a hard HTTP 500 on a live request, so the benefit is qualitative but high: strict TMLv0 goes from "500 on a legal schema" to "works". Client-visible value is real but narrow: one model family, one strict-tool feature, and docs/api.md:588-605 already advertises TMLv0 as a supported strict parser, so today the docs promise something that breaks. That pre-existing doc/behaviour gap is the strongest argument for merging.
Cost
- Complexity: ~+41/−10 in
tml.rs, ~+105 of tests instrict.rs, ~+91 lines of a skipped-by-default Python qualification test. No new modules, traits, flags, config, or extension points. Net effect is less code on the hot path: one borrow-based wrapper parse replaces a fullValuetree construction plus re-serialization. - Performance: strictly cheaper per TMLv0 call (no intermediate
Value, no allocation of the argument tree;&RawValueborrows the slice). No effect on decode, scheduling, MTP width, MTP/prefix cache, or any GPU path. - Maintenance: negligible; one struct and one byte check, both idiomatic serde_json raw-value usage.
- Risk: low and well-contained to TMLv0.
argsobject-ness is now checked by a leading{byte instead ofis_object()— equivalent for well-formed JSON, and serde still validates the whole body's syntax, so malformed payloads still fall back to visible text. All recovery paths are asserted:strict.rs:3893-3925runs the realGrammarCompiler+OutputPipelinewire throughTextGrammar::validateacross top-level,anyOf,$ref, and nested array/object 30-digit integers;tml.rs:607-629covers the raw-bytes case and duplicate-key rejection. ExistingFrame/ToolBody/truncation tests (tml.rs:525-573) still exercise the fallback semantics.
Simpler alternative? No.
The only alternatives are worse: (a) turn on arbitrary_precision in serde_json — a global change to Value semantics across the whole runtime, requiring a dependency-feature change and re-auditing every Value consumer, squarely against "keep the runtime small"; (b) re-slice the original body string in TmlOutput — hand-rolled string surgery in place of a library primitive; (c) validate the parsed Value instead of the emitted text in OutputEncoder — that is what the client receives, and it would either weaken the check or drop the guarantee that the client sees the validated bytes. The chosen fix is the smallest correct one and matches existing precedent.
Changes to request before merge
- Merge blocker — DCO sign-off is missing.
CONTRIBUTING.md:9-11requiresSigned-off-by:on every commit ("Any contribution which contains commits that are not Signed-Off will not be accepted"). The head commit07955d702ccarriesDesign-Signed-Off-By: Antigravity (gemini-3.1-pro); design-review=eb2fandDiscord: woooflet, but noSigned-off-by:trailer. Ask forgit commit -sand a force-push. - Close the tracked item.
AGENTS.md(Task tracking) says to "update or remove entries as work is completed", anddocs/TODO.txt:5-8says "Close when a served TMLv0 core passes those checks and the result is recorded." The PR claims to address that item but does not touchdocs/TODO.txt. Require the entry be updated/removed with the recorded result in the same PR, otherwise the roadmap silently keeps a stale open item. - Correct one description claim. The description says unknown and duplicate wrapper keys "fail deserialization and fall back to visible text, matching prior TMLv0 recovery semantics." Unknown keys did previously fail (
object.len() != 2), but duplicate keys did not:Valuecollapses them, so{"name":"lookup","name":"lookup","args":{}}used to be accepted as a call. The new behaviour is stricter and, I think, better — under a strict grammar duplicate keys cannot be generated, so only prose or unconstrained output is affected — but it is a behaviour change, not a preserved semantic. Say so explicitly, and add the same statement for the other client-visible change: for non-strict TMLv0 calls the argument text is no longer normalized by aValueround-trip, so number spellings and any whitespace the model emitted now reach the client verbatim (the strict grammar emits compact JSON, so strict calls are unaffected). Both facts are correct-as-implemented, they are just not what the description currently says. - Tighten the evidence and the served test. The
35/35live result has no command, core ID, or harness reference;AGENTS.mdrequires reproduction commands to identify required inputs and configuration. The re-runnable part (tests/server/test_inkling2.py:121-209) is good and already fills the "no TMLv0 core was served" gap that#418had to disclose — so cite it as the harness and name the core/deployment ID behind the35/35. Also note that this one Python test bundles about eight model-behaviour assertions (including a 30-digit literal reproduction and twomax_tokens=10truncation cases); if it proves flaky on hardware, splitting the truncation cases out is the natural follow-up, since a model output variance would otherwise fail the whole strict-TMLv0 result.
Optional, not required: docs/api.md:588-633 describes strict TMLv0 support and buffering but says nothing about argument text being passed through verbatim; one sentence would make the new non-normalizing behaviour part of the documented contract rather than an implementation detail.
Summary
Merge it. It is a small, correctly-placed latent fix that turns a documented-but-broken strict path (docs/api.md:588-605) into a working one for the Inkling 2 recipes, removes an HTTP 500, adds net-negative work to the parse path, and closes a maintainer roadmap item — the exact profile of change AGENTS.md says gets merged. What it does not yet have is a DCO sign-off, a closed TODO entry, an accurate statement of the two behaviour changes it introduces, and evidence concrete enough to reproduce the served claim.