Repository navigation
stub: a rule is a word said, never text inside one - #795
Merged
Merged
Conversation
The script runtime's keyword rules matched anywhere in a message, so a storage token's JWT a `fetch` carried, once holding "tOoL", made that turn a tool turn (#778's CI): an extra reply, and every count after it off by one. A rule is now said by a word that starts with it (`says`), past an opening bracket, parenthesis or quote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexlwn123
approved these changes
Oct 31, 2026
alexlwn123
left a comment
Collaborator
There was a problem hiding this comment.
Pass at 2696a368d9808b03f5aa25a9772613ed5d830570.
The word-prefix matcher fixes accidental rule activation inside JWTs and URLs while preserving the existing stub prompts, including slowly, silently and [SILENT]. The shared helper and focused unit/bridge regression tests are proportionate to the fix; I found no blocking regression.
Validation: Linux CI images check passed (workspace tests and clippy). Local cargo test -p fragment-bridge could not compile on macOS because unchanged SimpleX code uses Linux-only libc::prctl/PR_SET_PDEATHSIG. Docker and broader CI checks were still pending at review time.
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The stub's keyword rules (
tool,fail,silent,approve/risky,slow,draw) matched anywhere in a message's lowercased text, including inside what a command carries. Afetch … with <storage token>once carried a JWT holding "tOoL" (#778's CI, run 41157411177). That turn became a tool turn, said "Let me look." first, and every later reply count in the computers lane was off by one: five failures from one chance token.What: a rule is said by a word of the message that starts with it (
says). It looks past an opening bracket, parenthesis or quote, soslowly,silently,failsand[SILENT]still say theirs. Text inside a word never does. A JWT word starts witheyJ, and a URL withhttp, so a token or URL can't trip a rule. The newer rules (choose,ask-me,notice,speak) already matched whole words, and stay as they are.Checked: no lane's stub message depends on a keyword inside a word. I went through every message in
crates/e2eand the bridge tests that holds one: "tool please", "a slow tool please", "think slowly…", "queued, silently", "end this turn with exactly [SILENT]", "speak and draw", "draw picture:…".restart-toolsandfp-toolsare AI-fake tool loops, not stub messages.Tests
a_rule_is_a_word_said_never_text_inside_one(unit): the words above say their rules; a token holding "tool" and "fail", a URL with/tools/,withdrawnand-toolsay none.a_token_says_no_rule(bridge): afetchwhose token holds "tOoL" and "fAiL" is a fetch's turn alone: no tool step, no error, one reply.cargo test -p fragment-bridgeand its clippy pass.Complexity ledger: one 3-line helper, six call sites changed, the module doc's sentence. Nothing removed or added elsewhere.
🤖 Generated with Claude Code