Conversation
…ation `hasAffirmativeSddIntent` gated on a bare `\bsdd\b` mention. The hyphen in `non-SDD` is a word boundary, so that test matched the token inside the compound: a brief that explicitly rules the workflow out classified as affirmative SDD intent and opened session preflight. The negative-exclusion regexes could not cover this. They match negated clauses (`do not use SDD`, `sin usar SDD`), each requiring the negation and the token to sit in the same clause; a compound is a single token, so no clause-level negation is present to match. Discount only the negated occurrence, with a lookbehind on the mention test rather than another phrase in the exclusion list. A brief that excludes one path and still asks for the workflow elsewhere keeps its affirmative mention, and a word merely ending in `non` never suppresses the mention that follows it.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe SDD preflight classifier now ignores ChangesSDD intent classification
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Negative SDD compounds no longer invoke preflight while separate affirmative requests remain recognized. No merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #1038
Summary
non-SDD,non SDD) when testing for an SDD mention, so a brief that rules the workflow out no longer classifies as affirmative intent.non.Root cause
hasAffirmativeSddIntentgates on/\bsdd\b/i. The hyphen innon-SDDis a word boundary, so that test matches the token inside the compound. An anchored imperative such asImplementthen satisfies the intent half, andisSddPreflightTriggerreturnstruefor a brief that explicitly excludes the workflow.The negative-exclusion regexes in
isSddPreflightTriggercannot cover this, which is why this is a fix on the mention test and not another entry in that list. They match negated clauses —don't/do not/never/not want|need|plan|intend|use, plus the Spanishsin usar/no quiero|necesito|...forms — and each requires the negation and the token to sit in the same clause. A compound is a single token, so there is no clause-level negation for them to match.The fix uses a negative lookbehind on the mention test, so only the negated occurrence is discounted rather than the whole text:
Scope
This is the classification defect only. It is independent of transport and reaches the interactive parent, where the false positive opens the session preflight dialog during an unrelated request.
It is also the first half of #1001, whose second half — the RPC
inputhook consuming the resulting rejection — is fixed separately in #1036. The two are independent and can land in either order: #1036 touchesextensions/gentle-ai.ts, this one toucheslib/sdd-preflight.ts.Changes
lib/sdd-preflight.tshasAffirmativeSddIntenton a mention that is not part of a negative compoundtests/sdd-preflight.test.tsTest plan
Added
a negative SDD compound is an exclusion, not an invocationtotests/sdd-preflight.test.ts. It fails onmainon the first case and passes with the fix, and it pins both boundaries so the lookbehind cannot be over-broad:non-SDD,Non-SDDandnon SDDbriefs must not trigger.Implement the non-SDD path, then let's plan the SDD change.must still trigger — only the negated mention is discounted, not the text.Implement the canon-SDD alignment.must still trigger — a word merely ending innonnever suppresses the mention that follows.Classifier output on the reproduction set from #1038, before and after:
Full local run on Linux, Node 24, with the pinned
gentle-ai v2.9.1installed:pnpm test— exit 0 (2409 unit tests, provider-contract mirror check, runtime harness)pnpm run typecheck—200 recorded diagnostic(s), no regressionspnpm run check:runtime-modules—runtime matches TypeScript sourcesnode scripts/verify-package-files.mjs—169 filescheck passedSummary by CodeRabbit