From edf9fb46aaa2684d5725c4dcf874a439dbf22ce5 Mon Sep 17 00:00:00 2001 From: Eve Date: Thu, 23 Apr 2026 08:43:25 +0800 Subject: [PATCH] feat: tighten long-task wrapper inference coverage --- scripts/test_long_task_governor_wrapper.mjs | 24 +++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/test_long_task_governor_wrapper.mjs b/scripts/test_long_task_governor_wrapper.mjs index 8568456..af20580 100644 --- a/scripts/test_long_task_governor_wrapper.mjs +++ b/scripts/test_long_task_governor_wrapper.mjs @@ -17,6 +17,17 @@ const fixtures = [ 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', file: path.join(repoRoot, 'docs', '_artifacts', 'long_task_governor_wrapper_invalid_silent_example.json'), @@ -56,10 +67,19 @@ const fixtures = [ ]; 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, encoding: 'utf8', - }); + }; + + if (fixture.input) { + options.input = `${JSON.stringify(fixture.input)}\n`; + } + + const stdout = execFileSync(process.execPath, args, options); let output; try {