fix(tasks): honor explicit prohibitions on running engineering checks

This commit is contained in:
Agent Workbench Dev
2026-11-04 19:43:47 +08:00
parent 1037031e82
commit b4d7d2c965
4 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export function taskContract(task, lookup = () => null) {
original = previous;
}
const goal = original.contract?.goal ?? original.goal;
const skip = /无需(?:任何)?测试|不(?:需要|用|要)(?:进行|做|运行)?测试|\b(?:no tests?(?: needed|required)?|without (?:running )?tests?)\b/i.test(goal);
const skip = /无需(?:任何)?(?:测试|工程检查)|不(?:需要|用|要)?(?:进行|做|运行|执行)?(?:任何)?(?:测试|工程检查)|\b(?:no (?:tests?|checks?)(?: needed|required)?|without (?:running )?(?:tests?|checks?)|(?:do not|don't|never) (?:run|execute) (?:tests?|checks?))\b/i.test(goal);
const required = !skip && /(?:运行|执行|通过|修复|补充|添加).{0,12}(?:测试|工程检查)|\b(?:run|pass|fix|add)\b.{0,24}\b(?:tests?|checks?)\b/i.test(goal);
const file = hasFileDeliveryRequest(goal);
return { schemaVersion: 1, goal, kind: file ? 'file' : 'general', checks: skip ? 'skip' : required ? 'required' : 'unspecified',