(prompt: string)
| 68 | * "only before an actual mutating tool call." False positives cost one planning turn, not a block. |
| 69 | */ |
| 70 | export function looksLikeBuildTask(prompt: string): boolean { |
| 71 | if (!prompt) return false; |
| 72 | // "What architecture does it need?" / "what's wrong with X?" is advisory — answer in chat, |
| 73 | // don't gate it as a build even though it contains the word "architecture". |
| 74 | if (looksLikeAdvisoryQuestion(prompt)) return false; |
| 75 | const p = prompt.toLowerCase(); |
| 76 | if (STRONG_SIGNALS.some(s => p.includes(s))) return true; |
| 77 | const weak = WEAK_SIGNALS.reduce((n, w) => n + (p.includes(w) ? 1 : 0), 0); |
| 78 | return weak >= 2 && prompt.length > 120; |
| 79 | } |
| 80 | |
| 81 | const PLAN_FILE_RE = /(^|[/\\])(plan|design|architecture|adr|rfc)[^/\\]*\.(md|markdown|txt)$/i; |
| 82 |
no test coverage detected