Recommendation: Ready To Merge
PR #575 fixes a real, reproducible HTTP 500 bug still live on main (helios/src/output/tml.rs:365) with a minimal, zero-dependency change in the right layer (TmlOutput::call), bringing TMLv0 to parity with the existing RawValue preservation used by Qwen/GLM (helios/src/output/tagged.rs:871,927). The rebase onto 571a4471 (head a0d9065) introduces no correctness, concurrency, memory, or CI regressions, and the author has refreshed the commit trailers and disclosed the non-strict verbatim-forwarding and duplicate-key behaviors in the PR description. Only optional test-duplication simplifications and minor bookkeeping nits remain.
Merge Risk
Level: Low
- Isolated per-request parser change: Only
TmlOutput::call(helios/src/output/tml.rs:342-376) changes production behavior; it touches per-request parser state with no locks, shared buffers, CUDA graph/op-contract changes, or cross-request blast radius. - Net reduction in hot-path allocation: Replacing
serde_json::Valuetree construction +args.to_string()with borrowed&'a RawValue(#[serde(borrow)]) removes an intermediate heap AST allocation per TMLv0 tool call while preserving the existing 1 MiB parser bound (helios/src/output/tml.rs:279,303) and 8 MiB response bound (helios/src/server/output.rs:1803). - Well-bounded behavioral delta: Non-strict TMLv0 calls now forward trimmed raw
argstext verbatim (preserving interior whitespace/number spellings) and reject duplicate wrapper keys as visible text via#[serde(deny_unknown_fields)]; both behaviors are disclosed in the PR description and covered by unit tests.
Walkthrough
helios/src/output/tml.rs:22-23,342-376: Replacesserde_json::Valuedeserialization andargs.to_string()re-serialization inTmlOutput::callwith a local#[serde(deny_unknown_fields)]RawCall<'a>struct borrowingargs: &'a RawValue(using the already-enabledserde_jsonraw_valuefeature athelios/Cargo.toml:52), trims outer whitespace, checksargs.starts_with('{'), and emitsargs.to_owned()verbatim.helios/src/output/tml.rs:620-642: Adds unit testcall_preserves_raw_json_arguments_including_arbitrary_precision_integersverifying 30-digit positive/negative/nested integers, reversed wrapper key order, and duplicate wrapper key fallback to visible text.helios/src/grammar/strict.rs:3819-3922: Addstml_strict_parser_preserves_30_digit_integers, exercising the realGrammarCompiler,compile_presented_strict_tools,OutputPipeline,validate_strict_tool_schema, andTextGrammar::validateend-to-end across top-level,anyOf,$ref, nested object, and nested array 30-digit integers.tests/server/test_inkling2.py:121-209: Adds live TP4 qualification testtest_strict_tml_tool_calls_and_truncationcovering buffered/streamed Chat Completions, Chatmax_tokens=10truncation, Responses buffered, and Responsesmax_output_tokens=10truncation (module-skipped withoutFLARE_RUN_CUDA_TESTS=1andFLARE_INKLING2_TEST_URL).
Pre-merge Checks
- [PASS] Security / malicious screen: No suspicious code, dependency changes, network exfiltration, or prompt-injection artifacts; existing parser size bounds (
helios/src/output/tml.rs:279,303) are untouched. - [PASS] Charter & value fit: Fixes a reproducible HTTP 500 on documented strict TMLv0 support (
docs/api.md:614-631) in the output parser with no per-model switches, flags, or new dependencies. - [PASS] Related / duplicate / conflict check: Bug is still live on
main(helios/src/output/tml.rs:365); open PRs #457 (tml.rs,strict.rs) and #461/#670 (strict.rs) do not semantically conflict withTmlOutput::call(at most minor contextual merge ordering instrict.rstests). - [WARN] Tests & verification evidence: Rust unit/grammar tests cover the real parser and strict validator (
output::tml::7 tests andgrammar::strict::28 + 1 ignored match the tree), and.github/workflows/native-serving.yml:63 (not opened),68runs them in--releaseon Linux/Windows; however, the post-rebase comment rancargo testwithout--release,tests/server/test_inkling2.py:23-26is skipped by.github/workflows/python-cpu.yml:30-33(not opened), and the external "35/35" live harness has no command/core ID recorded in-repo.
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Deduplicate the 30-digit schema fixture in
helios/src/grammar/strict.rs:3827-3848.tml_strict_parser_preserves_30_digit_integerscopiesbigand the 20-linebig_schemaverbatim fromqwen_and_glm_strict_parsers_preserve_30_digit_integersimmediately above it (helios/src/grammar/strict.rs:3726-3746). Extract a sharedfn big_integer_case() -> (&'static str, Value)helper inmod tests(~20 net lines removed, zero coverage loss). - Reuse the
servicefixture and collapse repeatedurllibPOST boilerplate intests/server/test_inkling2.py:121-209.test_strict_tml_tool_calls_and_truncationre-fetches/v1/models(:122-123) even though the moduleservicefixture already resolvesurlandmodel["id"](:31-33), and repeats identicalurllib.request.Request+urlopen+json.loadplumbing three times (:155-169,:176-189,:194-207). Exposingurl/model(or a smallpost(path, body)helper) onservicealongsideask.chunk(:67) removes the redundant/v1/modelscall and cuts ~25–30 lines.
Nits
docs/TODO.txtbookkeeping (docs/TODO.txt:5-8;:12-15onmain): The strict TMLv0 qualification item remains[ ](andtests/server/test_inkling2.py:121-209covers Chat buffered/streamed and Responses buffered/truncated, leaving Responses streamed only in the external 35/35 run). Either close/update the entry with recorded results once streamed Responses is covered or note why it stays open.- Optional API doc note (
docs/api.md:614-631): Consider adding one sentence noting that TMLv0 forwards rawargstext verbatim (trimmed of outer whitespace) and surfaces duplicate wrapper keys as visible text. - Out-of-scope follow-up (multi-turn precision): Multi-turn conversations still round-trip tool arguments through
serde_json::Valueon the next turn's ingress (helios/src/server/protocol/decode.rs:91-101), TMLv0 prompt rendering (helios/src/frontend/tml.rs:75-88,149-174), and Anthropic Messages non-streamingtool_use.input(helios/src/server/protocol/encode.rs:334). Worth tracking separately if multi-turn >64-bit integer round-trips are needed. - Evidence provenance: Consider noting the core/command behind the "35/35 strict TMLv0 live serving tests" claim and confirming
--releaseon the rebased SHA (a0d9065) to match.github/workflows/native-serving.yml:63 (not opened),68.
Dropped on verification
- Missing DCO
Signed-off-by:blocker (Value Proposition #1) & staleDesign-Signed-Off-Bydigest (early Dossier): Dropped as stale against pre-rebase commits (07955d702c/c7fae93). On heada0d9065, the author rebased onto571a4471and reported addingSigned-off-by: woooflet <ford@fordmorris.com>and refreshingDesign-Signed-Off-By: Antigravity (Gemini-4-Neon); design-review=2e5b(verified via.githooks/commit-msg). - PR description misstates duplicate-key behavior as preserved (Value Proposition #3): Dropped as stale; the current PR description explicitly discloses both non-strict verbatim forwarding and duplicate-key fallback to visible text.
- "No JSON-object guard before hand-off" & proposed
serde_json::from_str::<&RawValue>(args).is_ok()fix (Correctness & Contracts Lens C): Dropped as factually incorrect.serde_json::from_str::<RawCall<'_>>(body)already syntactically validatesparsed.argsas a complete JSON value, soargs.starts_with('{')guarantees a syntactically valid JSON object, and re-runningfrom_str::<&RawValue>(args)would be a no-op. (The only remainingRawValue-vs-Valuedelta is> f64::MAXnumbers such as1e500reachinghelios/src/server/output.rs:148,1823, which matches existing Qwen/GLM behavior athelios/src/output/tagged.rs:927.) - "Not tested for non-strict" sub-claim and Major severity on
docs/api.md(Correctness & Contracts Lens A): Dropped/downgraded.helios/src/output/tml.rs:620-642exercises non-strictTmlOutput(parser()at:415has nostrict: true) for both raw 30-digit integers and duplicate wrapper keys; the optionaldocs/api.mdsentence is kept underNits. - "Delete unprovable key-order assertion" at
tests/server/test_inkling2.py:141(Subtraction & Simplicity Lens #3 / Dossier #5 / Correctness Lens D1): Dropped as over-flagging. Whilepreserve_order(helios/Cargo.toml:52) already preserved insertion order onmain, the live test also qualifies strict schema property emission order; deleting a valid 1-line assertion adds churn without value. - Parametrized
servicefixture duplicatingeffort="none"calls intests/server/test_inkling2.py(Subtraction & Simplicity Lens #4): Dropped as low-signal;test_streamed_reasoning_and_answer(tests/server/test_inkling2.py:80-82) in the same file already follows the exact same pattern. - Inflated line-reduction / block-count estimates in Subtraction & Simplicity Lens #1 and #2: Corrected "~44 duplicated lines" in
helios/src/grammar/strict.rsto ~20 net lines removable and "four"urllibPOST blocks intests/server/test_inkling2.pyto 3urllib.request.RequestPOST blocks plus 1/v1/modelsGET.