MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / looksLikeBuildTask

Function looksLikeBuildTask

src/agent/preflight-gate.ts:70–79  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

68 * "only before an actual mutating tool call." False positives cost one planning turn, not a block.
69 */
70export 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
81const PLAN_FILE_RE = /(^|[/\\])(plan|design|architecture|adr|rfc)[^/\\]*\.(md|markdown|txt)$/i;
82

Callers 2

runMethod · 0.85

Calls 1

Tested by

no test coverage detected