Skip to content

fix(cognition): the manual's blank is refused before dispatch — one seam names the field left as <replace-with-…> or a run of zeros (card 04d89a37) - #4149

Merged
joelteply merged 2 commits into
canaryfrom
fix/the-manuals-blank-is-refused-before-dispatch
Sep 17, 2026
Merged

joelteply merged 2 commits into
canaryfrom
fix/the-manuals-blank-is-refused-before-dispatch

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

The manual renders every string blank as <replace-with-string> and every example as a copyable block; small tiers copy it verbatim. Tonight's receipts: code/edit <replace-with-string> (Kimi), work/release({"card_id":"<string>"}) ×12 in one turn, 64-zero artifact hashes on work/submit ×56/day on the M5, all-zero review UUIDs (5204f4b5). #4045 removed <string>; the family is open-ended.

How

One seam instead of a renderer chase: CommandToolExecutor::execute_native_batch walks each call's input; any string that is an angle-bracketed token (<replace-with-…>, <string>, <any>) or a 32+ run of zeros/dashes (an example hash, the nil uuid) is refused before dispatch with the field path named and what belongs there ("a real path, a real id from work/list, the sha256 of your patch — or omit the field where the verb derives it"), plus tool.call.manual_blank {persona, command, fields}. Real calls are untouched (<html> in prose, a shell command, a real sha).

Tests

the_manuals_blank_is_named_by_field_and_a_real_call_is_not — five blank shapes named by dotted path; a real call yields none. command_executor::tests green.

Pairs with #4148 (work/submit derives its artifact) — the verbs derive what they can, the seam refuses what a citizen cannot know.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…eam for every verb names the FIELD she left as <replace-with-…> or a run of zeros (card 04d89a37)

The manual says "emit this SHAPE; every <replace-with-…> is a blank you fill in" and
small tiers copy the block verbatim: code/edit <replace-with-string> (Kimi, 5090,
2026-09-16), work/release({"card_id":"<string>"}) ×12 in one turn (09-14), sixty-four-
zero artifact hashes on work/submit ×56 in a day (M5, 09-16), all-zero review ids
(5204f4b5). #4045 removed <string>; the placeholder family is open-ended, so the fix
moves from the renderer to the ONE place every persona call passes:
CommandToolExecutor::execute_native_batch walks the call's input, and any string that
is an angle-bracketed token or a 32+ run of zeros/dashes is refused BEFORE dispatch with
the field named and what belongs in it (a real path, a real id from work/list, the
sha256 of your patch — or omit the field where the verb derives it), plus a probe
tool.call.manual_blank {persona, command, fields}. A real call is untouched (an <html>
tag inside prose or a shell command is not a blank).

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Reviewed at 529d0c6f9. Right seam, right asymmetry, ships as far as I'm concerned. One narrow false positive worth a documented answer, not a block.

The predicate is tighter than the description suggests, and that matters. is_blank requires the WHOLE trimmed string to be <…>, no space, ≤64 chars. So the case I came to object to does not exist: Vec<String>, Option<u8>, or a code/edit content blob full of Rust generics all pass, because the angle brackets are inside the value rather than being it. That is the difference between a usable gate and one that makes editing Rust impossible, and the diff gets it right.

The asymmetry is the argument for shipping it open-ended. An allowlist of known placeholders (<string>, <any>, …) is what #4045 tried and the family outran it. Refusing any whole-value angle token costs a citizen one confused turn against a message that names the field and says what to fill; letting <replace-with-whatever-the-manual-says-next> through costs a silent bad write. Refuse-loud beats accept-quiet here, and the error text ("marks a field YOU fill") tells the model what to do rather than only what went wrong — which is the part that actually changes a small tier's next turn.

Refusing before dispatch is the correct placement. Validation inside each command would be N implementations drifting apart; execute_native_batch is the one seam every native call passes. And it probes, so a spike in refusals is visible the day a manual regresses rather than inferred from citizens acting strangely.

The one gap: a bare tag as a complete value

<div>, <br>, <html> satisfy every clause — starts <, ends >, no space, short. A citizen passing a single tag as an entire argument (a querySelector, a search pattern, a replacement string) gets refused with a message telling her to fill in a blank she did not leave. Rare, but the failure is confusing rather than obvious, and there is currently no way to say "I really mean the literal text <div>".

Not worth blocking — the frequency is plainly lower than the placeholder family it catches. Worth one line in the error text naming the escape (or noting there isn't one), so the citizen who hits it is not left arguing with a gate that thinks her real value is a blank.

Not checked

The zeros/dashes arm beyond its existence, and whether 32 is the right run length — a legitimate 32-zero run in a diff or a fixture would hit it, and I did not look for one.

…nd fn — the slip the ratchet was built to catch (77 > 76); each test carries its own attribute again

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 00ec557 into canary Sep 17, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-manuals-blank-is-refused-before-dispatch branch September 17, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant