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
+8
View File
@@ -15,6 +15,14 @@ test('operational questions are diagnostic while explicit repair requests remain
for (const text of ['先修复系统', '为什么失败,请帮我修复', '这个错误怎么回事,然后修一下', 'fix this error', '继续完成']) assert.equal(isDiagnosticQuestion(text), false, text);
});
test('an explicit prohibition on running engineering checks is not interpreted as a requirement to run them', () => {
for (const goal of ['只读核对指定文件范围,不修改文件,不运行工程检查。', '不执行工程检查,只解释原结果',
'不需要做任何测试', '无需工程检查', 'Read the evidence; do not run checks.', "Don't run tests; explain the original failure."]) {
assert.equal(taskContract({goal}).checks, 'skip', goal);
}
for (const goal of ['修复并运行工程检查', '运行并通过原测试', 'Fix the source and run checks.']) assert.equal(taskContract({goal}).checks, 'required', goal);
});
test('file delivery requires a positive instruction, not saved evidence or a prohibited write', () => {
for (const goal of ['读取保存的原工件,分段取得真实依据,不执行命令或修改文件。',
'读取保存过的 HTML 文件并解释内容', '不要创建文件,只分析结果', '读取工件,不执行命令或创建文件',