#1 [high] Lens D findings so far (PR 575)
PR 575 (Preserve raw JSON tool args in TmlOutput). Diff: helios/src/output/tml.rs (call() rewritten with #[derive(Deserialize)] struct RawCall{name:String,#[serde(borrow)]args:&RawValue}, deny_unknown_fields, args.trim().starts_with('{'), text: args.to_owned()), helios/src/grammar/strict.rs new test tml_strict_parser_preserves_30_digit_integers (lines 3820-3922), helios/src/output/tml.rs new test call_preserves_raw_json_arguments... (607-629), tests/server/test_inkling2.py new test test_strict_tml_tool_calls_and_truncation (121-209).
Candidates:
- strict.rs 3828-3847 schema is byte-identical to qwen/glm test 3727-3746 → extract helper.
- strict.rs 3917-3921 asserts raw_args.matches(big).count()==5 — indirect; direct assert_eq against expected args string (built at 3885) is shorter and stronger (also proves order/whitespace).
- tml.rs 619-628 duplicate-key case restates serde derive duplicate-field rejection; pre-existing test rejected_invocations_surface_as_text_and_open_calls_complete_only_at_eos (553-562) already loops bodies for the text fallback → add one body there, delete 10 lines.
- Behavior change: prior code object.len()!=2 with serde_json Value collapsed duplicate keys and ACCEPTED {"name":"x","name":"x","args":{}}; now rejected. PR says "matching prior TMLv0 recovery semantics". Verify with git history.
- python test 155-209: truncation requests hand-built urllib instead of fixture; fixture asserts finish_reason in ("stop","tool_calls") at line 63 → reason for bypass. 5 scenarios in one test.
- python 139/152/192:
big in argumentssubstring; parsed big_id == int(big) stronger.
Check: helios/Cargo.toml:52 serde_json features include "raw_value" and preserve_order → no dep change. Charter/AGENTS: reject unsupported abstractions/churn (AGENTS.md 188-199), focused meaningful validation (194-199), design-review principle 15/12.
#2 [high] Lens D findings, PR 575 (final)
PR 575, lens D (simplicity). Files: helios/src/output/tml.rs (call() 329-363, new test 607-629), helios/src/grammar/strict.rs (new test 3820-3922), tests/server/test_inkling2.py (121-209).
D1 (nit) strict.rs:3828-3847 — the 20-line big_schema is byte-identical to the schema in qwen_and_glm_strict_parsers_preserve_30_digit_integers at 3727-3746 (same $defs/BigInt, top/via_any/via_ref/nested, same required list). Fix: hoist one fn big_int_schema() -> Value (or a const BIG) in the test module and use it in both tests; ~20 lines deleted, and the two tests can never drift.
D2 (nit) strict.rs:3909-3921 — assert_eq!(raw_args.matches(big).count(), 5, ...) is an indirect proxy for "no precision loss". The expected argument string is already computable from big alone, and the payload at 3885 is {"name":"audit","args":<expected>}. Smaller and stronger: let expected = format!(r#"{{"top":{big},"via_any":{big},"via_ref":{big},"nested":{{"id":{big},"arr":[{big}]}}}}"#); built once, payload = {"name":"audit","args":…} from it, then assert_eq!(raw_args, expected) — this also pins property order and exact bytes, which the count assertion cannot (e.g. 1.234e29 occurrences of the digits would still be one mismatch, but a reordered object passes the count check). Saves 4 lines and one format!.
D3 (nit) strict.rs:3820-3907 — the test repeats, nearly line for line, the harness of tml_json_strict_grammar_rebases_root_ref_and_parses_end_to_end (2803-2930): tokenizer/controls build (3821-3826 vs 2804-2809), syn.reasoning=None + TmlJson ToolParser (3849-3855 vs 2819-2824), OutputConfig+TaggedConfig with the same json! tool wrapper (3856-3867 vs 2832-2842), plan (3869-3879 vs 2844-2854), and the token-feed loop (3888-3906 vs 2860-2895). The one genuinely new thing is the 30-digit payload and the matches assertion. Fix: add a fn tml_strict_config(name:&str, schema:&Value) -> (OutputConfig, OutputEnvelope, ToolGrammarPlan) helper in the test module (tools list built from name/schema), and express this test as ~15 lines on top of it; the second existing user also shrinks. Together with D1/D2 that is roughly 60 of the 105 added Rust test lines gone without losing any asserted behaviour.
D4 (nit) tml.rs:619-628 — the duplicate-key half of call_preserves_raw_json_arguments... only re-asserts that #[serde(deny_unknown_fields)] on the derived struct rejects {"name":"lookup","name":"lookup","args":{}} and that the body then falls back to visible text. The fallback-to-text list already exists: rejected_invocations_surface_as_text_and_open_calls_complete_only_at_eos (553-562) loops bodies through both starts. Fix: add r#"{"name":"lookup","name":"lookup","args":{}}"# (and, if wanted, r#"{"name":"lookup","args":{},"args":{}}"#) to that array and delete 619-628; 10 lines fewer, and the invariant lives in one place.
D5 (nit, prose/accuracy) tml.rs:329-363 vs main 328-353 — "emits args verbatim" and "matching prior TMLv0 recovery semantics" are both inexact. (a) parsed.args.get().trim() then to_owned() drops whitespace surrounding the raw value, so a payload "args": { … } is not emitted verbatim (nothing else is normalised, key order and integers are preserved). (b) The old object.len()!=2 check ran on a serde_json Value map, which collapses duplicate keys, so {"name":"lookup","name":"lookup","args":{}} was accepted before and is now shown as text; with preserve_order the Map is an IndexMap whose insert replaces in place, so len stayed 2. That is a real (and reasonable) tightening, but it is not "prior semantics". Fix: say "emits the raw argument object with surrounding whitespace trimmed" and name the duplicate-wrapper-key tightening as a behaviour change, or drop the trim and the claim.
D6 (nit) tests/server/test_inkling2.py:121-209 — one 90-line test covers five independent behaviours (buffered chat, streamed chat, chat max_tokens truncation, Responses buffered, Responses max_output_tokens truncation) and hand-rolls three urllib requests (155-209) only because the module fixture asserts finish_reason in ("stop","tool_calls") (line 63), which truncation violates. Fix: give the fixture an allow_length=True flag (or return the raw body when the caller asks), then split into test_strict_tml_tool_calls (buffered+streamed, ~20 lines) and a parametrised test_strict_tml_truncation(protocol, limit_field) over [("/v1/chat/completions","max_tokens"), ("/v1/responses","max_output_tokens")] — ~45 lines total, and each failure names the protocol/limit that broke. Also lines 139/152/192 assert big in arguments as a substring; json.loads(arguments)["big_id"] == int(big) (already done for the buffered case at 140-141) proves the value survived, where the substring only proves the digits appear somewhere.
Checks: serde_json already enables raw_value (helios/Cargo.toml:52), so no dependency change — no finding. No new flags/options/fallbacks in production code (AGENTS.md 188-199 satisfied on the production side). Nothing found that warrants blocking.
#3 [high] Research summary
Reviewed PR 575 through the simplicity lens. The production change itself is a net simplification (one derived struct replaces the Value round-trip, no new flags, options or fallback paths, and raw_value is already enabled in helios/Cargo.toml:52 so no dependency change). All findings are nits and concern the added tests plus two inexact prose claims; none is blocking.
Findings recorded in the scratchpad (entry 2):
- strict.rs:3828-3847 — the new
big_schemais byte-identical to the one at 3727-3746; hoist a shared helper. - strict.rs:3909-3921 —
matches(big).count() == 5is a proxy; assert the exact expected argument string instead (shorter and pins key order). - strict.rs:3820-3907 — the new test rebuilds, line for line, the harness of
tml_json_strict_grammar_rebases_root_ref_and_parses_end_to_end(2803-2930); extract a config/envelope/plan helper, ~60 of the 105 added test lines go. - tml.rs:619-628 — the duplicate-key case only restates serde's derive behaviour and the text fallback already has a loop at 553-562; add the body there and delete these 10 lines.
- tml.rs:329-363 — "emits args verbatim" and "matching prior TMLv0 recovery semantics" are both inexact: the raw value is trimmed, and the old
object.len()!=2check on aValuemap accepted duplicate wrapper keys (withpreserve_orderan IndexMap replaces in place), so duplicate-key rejection is a real behaviour change that should be stated. - tests/server/test_inkling2.py:121-209 — one 90-line test for five behaviours with three hand-rolled urllib requests; splitting it and giving the fixture an
allow_lengthflag, plus assertingbig_id == int(big)rather than a digit substring, makes it shorter and each failure more specific.
#4 [high] Rules citations + closing statements for the D-lens report
Addendum to entry 2 (findings D1-D6). Report needs these bits:
RULES CITED (all read this session):
- AGENTS.md 188-193 "Reject unsupported abstractions and churn": no frameworks, extension points, speculative compatibility, fallback layers or config switches without a concrete requirement; "Unsolicited formatting, renaming, comment expansion, annotation sweeps, and file rearrangements are not contributions by themselves. Refactoring must directly support the requested behavior or remove a demonstrated source of defect or cost." → backs D1/D3 (duplicated test scaffolding/churn) and underpins the "no production churn" positive.
- AGENTS.md 194-199 "Require focused, meaningful validation": "Tests must exercise the affected behavior or contract; source-text checks and mocks that bypass the behavior cannot establish runtime correctness... Keep each PR focused on one coherent outcome." → backs D2 (assert the real string, not a digit count), D4 (test only restates the derive), D6 (one test asserting five behaviours).
- AGENTS.md 72-113 / design-review.md principle 16 + 147-160: PR prose must state exactly what changed, with before/after and no claims beyond evidence → backs D5.
- design-review.md 171-193 (testing hierarchy layer 1: crate tests exercise production entry points) — satisfied by both new Rust tests; no complaint there.
- design-review.md 232-259 (mandatory enforcement / non-substitution) — not triggered: no scheduler, admission, speculation, cancellation, cache or rank-coordination change, so no simulator/TLA+/Kani obligation; the new Rust tests are CPU-only and the GPU-path coverage is the python suite.
VERDICT: nothing blocking in this lens. Production diff is a net simplification: one #[derive(Deserialize)] struct with RawValue replaces the Value round-trip and the manual as_object/len()!=2/is_object checks; no new flags, options, env switches, parallel paths or fallbacks; raw_value and preserve_order already enabled at helios/Cargo.toml:52 so no dependency or Cargo.lock change (charter "pin everything" untouched).
DOCS GAP (feeds D5, low severity): docs/api.md 588-605 specifies the strict-schema subset and TMLv0 behaviour and 624-628 specifies buffering/truncation semantics, but states nothing about wrapper-key uniqueness, so the newly rejected {"name":..,"name":..,"args":..} form is undocumented. Either state it in docs/api.md near 604-605, or keep the old lenient acceptance; the PR text should not claim "prior semantics" for a changed acceptance set either way.