feat: tighten long-task wrapper inference coverage

This commit is contained in:
Eve
2026-04-23 08:43:25 +08:00
parent f6671cfb60
commit edf9fb46aa

View File

@@ -17,6 +17,17 @@ const fixtures = [
assert.equal(output.classification, 'long_task'); assert.equal(output.classification, 'long_task');
}, },
}, },
{
name: 'borderline wrapper inference',
input: {
requestText: 'Inspect the current hook and compare it to the wrapper outputs before replying.',
canReplyNow: false,
},
assert(output) {
assert.equal(output.classification, 'long_task');
assert.equal(output.needsCheckpoint, true);
},
},
{ {
name: 'invalid silent', name: 'invalid silent',
file: path.join(repoRoot, 'docs', '_artifacts', 'long_task_governor_wrapper_invalid_silent_example.json'), file: path.join(repoRoot, 'docs', '_artifacts', 'long_task_governor_wrapper_invalid_silent_example.json'),
@@ -56,10 +67,19 @@ const fixtures = [
]; ];
function runFixture(fixture) { function runFixture(fixture) {
const stdout = execFileSync(process.execPath, [wrapperPath, '--compact', '--input', fixture.file], { const args = fixture.file
? [wrapperPath, '--compact', '--input', fixture.file]
: [wrapperPath, '--compact'];
const options = {
cwd: repoRoot, cwd: repoRoot,
encoding: 'utf8', encoding: 'utf8',
}); };
if (fixture.input) {
options.input = `${JSON.stringify(fixture.input)}\n`;
}
const stdout = execFileSync(process.execPath, args, options);
let output; let output;
try { try {