Repository navigation
Hook: the miss note covers the autopilot half, says which rule failed, and describes the phrases (T200, T201) - #104
Conversation
…, and describes the phrases (T200, T201) The note fires when a switch the owner asked for did not happen: no rule changed the state, or autopilot named with its on word stayed off. It names the failed rule in one sentence, describes the phrases instead of quoting them, and ends with Tell the user. The on rule's trailing-words branch now refuses an off word after the optional on word, off-meaning words, a hidden or look-alike off, every question mark, and a Markdown quote, list item or indented line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ssed switch names its reason (T200, T201 round 1) - F-R725-1, F-R724-L1: the on rule folds only the words after the phrase. A look-alike letter, a zero-width space or a combining mark inside the phrase makes it no phrase, as on main. The tail gets NFKD per word (not its punctuation), loses marks and format characters, and maps the Cyrillic and Greek look-alikes and the small capitals. - F-R725-2: the phrase, then a comma, colon, semicolon or dash, then an off word, no longer turns the mode on. - Reviewer question: the phrase with an off word next also switches autopilot off, and the note says so. - F-R724-L2: an off line in an agent's frame no longer hides the autopilot note. - F-R726-1: an autopilot ask with an off word, "autopilot please" and "and autopilot" get the autopilot note; the note names the reason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Repair round 1 (run R727), new head 4ac827d. This comment describes the phrases and does not quote them.
Proof: the new test cases fail on the old head ed073bb (4 of 4 tests fail, 38 failing case lines) and pass on the new head. Build, check, the hook and providers test files (314 of 314) pass; the 1 MB padding rows pass, with 4 new rows for the folded tail, the punctuation guard and the autopilot ask. The full npm test under a 900 s alarm passed 784 of 784 (301 s). Fakes for the process tools were first on PATH for every run. Not merged. |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The on rule's phrase start had no end boundary, so a combining mark or an invisible format character on the phrase's last letter fell into the folded tail and was removed. Add a boundary that refuses a letter, a mark, a digit or a format character next, as on main. Rows for probes A10 to A16 and D13. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Repair round 2 (R735): this closes the last gap of F-R725-1, which the security review R733 found. What was wrong: the rule that finds the start of the phrase did not check what came right after the last letter of the mode name. A combining accent, a zero-width space, a soft hyphen, a variation selector or a word joiner on that letter fell into the words after the phrase. The fold then removed it, so the on rule matched: the mode turned on and the owner got no note. The fix: the phrase start now ends with a boundary. A letter, a mark, a digit or an invisible format character next means "not the phrase", as on main. The words after it are not folded, the mode does not turn on, and the owner gets the miss note. The change is one line in packages/sage-core/mode-policy.mjs, plus the rebuilt plugin copies. Tests: 8 rows (probes A10 to A16 and D13). They cover the accent alone, the accent with more words, the accent in the form with "enter", the four invisible characters, and the accent followed by a comma and the autopilot request. The rows are in the modes table and the note table of scripts/sage-hook.test.mjs, and in scripts/providers.test.mjs for both bundles. They fail on 9d5fdad and pass on ae693a0. The 1 MB padding rows still pass. Checks: npm run build (228 files) and npm run check (all pass). With a fake ps, pgrep and kill: sage-hook tests 223 of 223, providers tests 91 of 91. 🤖 Generated with Claude Code |
Closes #64
Closes #65
The miss note now fires when a switch the owner asked for did not happen. It names the failed rule in one sentence, describes the phrases instead of quoting them, and ends with "Tell the user." The on rule's trailing-words branch closes the edge cases from the PR #54 reviews.
Codex parity: the Codex adapter reads the same sageOn and sageOff from sage-core, so the rule changes apply to it too.
providers.test.mjschecks both bundles. Codex has no miss note, the same as before.Checks:
npm run buildbuilt 228 files,npm run checkpasses all checks, andnpm testpasses 784 of 784.🤖 Generated with Claude Code