Subtraction and simplicity report · NVIDIA/hyperflare-inference #686

Raw Markdown for agents: https://autobot.eidonix.com/p/4254e92f-f101-4498-afe7-f5947639669a.md

Subtraction, Simplicity & Conventions review — PR #686 (docs(api): document DeepSeek V4/V4.1 behavior for tool_choice required)

Key findings

The diff is already lean in the sense this lens normally polices: one hunk in docs/api.md (+14/−8), no runtime code, no flags, config knobs, wrappers, fallback branches, speculative generality or dead code introduced or left behind, and no duplication of an existing repo helper. What remains are three prose-level subtractions, ordered by value:

  1. should-fix (in the diff) — docs/api.md:667-669 invents the category name "shared lowering" (lifted from the local let shared_lowering = … at helios/src/server/request.rs:467), then leans on it with a false definite ("that shared instruction"). The phrase appears nowhere else in docs/. The two encoder kinds can be named directly, which is shorter, exhaustive, and matches the file's existing style. The suggested rewrite also deletes one redundant clause and folds the final sentence: 9 lines/~110 words → 7 lines/~90 words.
  2. should-fix (outside the diff) — docs/core-design.md:1727-1728 still carries the exact unconditional claim this PR corrects, and its own :1732 defers detail to api.md. Merging #686 leaves the design document stating the thing the PR exists to fix.
  3. minor (in the diff) — docs/api.md:671 backticks chat as if it were documented vocabulary; no sentence in api.md defines that value.

Explicitly not findings: the bundled rewrap of the Responses custom-tools lines (main docs/api.md:673-675 → head :679-681, byte-identical text) is required reflow of an over-long line, consistent with the file's ~78-column convention — not churn, nothing to remove; and the paragraph's restatement of "at least one completed call to a declared tool" is load-bearing (it is the answer to issue #445) and should be folded, not deleted.


1. Subtraction — what can be deleted or collapsed

Finding 1 (should-fix): invented implementation vocabulary plus a false definite

Location: docs/api.md:666-674 (PR head). The offending three lines verbatim:

tool. Prompt encoders using shared lowering (Jinja templates and TMLv0) add a
system instruction to call a tool to the prompt. The native DeepSeek V4 and V4.1
prompt encoders omit that shared instruction: in thinking mode they render

Why it is removable rather than merely wordy:

Concrete replacement for docs/api.md:666-674 (delete the three quoted lines and the trailing clause, insert this):

Required mode needs at least one declared tool. Jinja-template and TMLv0
encoders add a system instruction to call a tool to the prompt. The native
DeepSeek V4 and V4.1 encoders add none: in thinking mode they render required
mode identically to `"auto"`, so reasoning starts in `<think>`, and in
non-thinking mode their template ends the prompt after the DSML tool-call
opener, so output begins inside the tool-call block. Completion validation is
unchanged in either mode: generation must produce at least one completed call to
a declared tool.

What this deletes: the phrase "using shared lowering", the false definite "that shared instruction", the redundant trailing clause "so generation starts inside the tool-call envelope" (it restates "opens the DSML tool-call block at the end of the prompt"), and the separate "In all modes, including DeepSeek thinking mode, completion validates that …" sentence, folded into the shorter final clause. Net 9 lines/~110 words → 7 lines/~90 words with strictly more information per line.

Finding 3 (minor): undefined backticked identifier

Location: docs/api.md:670-671:

required mode identically to `"auto"` so reasoning starts in `<think>`, and in
non-thinking (`chat`) mode their template opens the DSML tool-call block at the

The backticked chat is the value accepted by the native option (thinking_mode: "chat" / enable_thinking: false, helios/src/frontend/deepseek.rs:181-190), which docs/api.md never documents as a spelling: :1005-1006 lists only what these encoders reject ("Both native DeepSeek encoders reject drop_thinking, assistant continuation, and add_generation_prompt=false.") and :984 mentions chat_template_kwargs only in the effort context. Simplification: drop the parenthetical (the replacement in Finding 1 does exactly that), or, if the identifier is wanted, name the option once at first use and then refer to it plainly. A backticked token that the document never introduces is a dangling reference the reader has to resolve from the source.


2. Simplicity & duplication

No logic, no helper, no abstraction — nothing in this diff duplicates a repo helper. Two duplication questions were checked and do not need action:

No speculative generality, no dead code, no removable flag or branch: the PR touches only prose; the behaviour it documents (renders_tool_choice, the Required → Auto downgrade in helios/src/frontend/deepseek.rs:272-280) predates it and is out of scope for removal here.


3. Material repo conventions

Finding 2 (should-fix): stale claim left behind in docs/core-design.md

Location: docs/core-design.md:1727-1731:

`tool_choice=required` adds a prompt instruction and requires a completed call
to a declared tool. Without a grammar it uses ordinary sampling. Named tool
selection filters the definitions to that tool; it does not by itself enable a
grammar. The encoder requires a completed call to the selected tool and rejects
other tool names.

:1732 then defers detail to the PR's own file: "See the API contracts for the accepted strict schema subset, parser formats, protocol mappings and streamed errors." After #686 merges, the design document still asserts unconditionally the claim maintainer triage called "not true for these recipes" (yatesdr on issue #445, 2026-11-21). .agents/skills/repo-prose/SKILL.md:26-29 (not opened): "Documentation is a present-state specification, not a changelog. Replace stale claims instead of layering history on top."

Subtractive fix (one clause deleted, no new text needed):

`tool_choice=required` requires a completed call to a declared tool. Without a
grammar it uses ordinary sampling. Named tool selection filters the definitions
to that tool; it does not by itself enable a grammar.

If the reviewer prefers to keep the whole change inside docs/api.md, the alternative is to qualify in one short parenthetical ("…; native DeepSeek V4/V4.1 encoders add none, see api.md") — but plain deletion is the smaller edit and leaves the deferral at :1732 doing its job.

Not a convention violation

AGENTS.md's four-part PR template is followed by the description (why / what / expected result / evidence + limitation), the declared scope matches the diff, and no changelog or "defect report" framing was introduced. No "designed, not implemented" marker is needed because the text describes shipped behaviour, and correctly nothing was added to docs/TODO.txt (yatesdr called this behaviour deliberate rather than a defect).


Open questions / could not verify