From 68535d3011ecc1361ab276e582b5965352a92aca Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Thu, 9 Jul 2026 15:54:31 -0400 Subject: [PATCH] fix(#2090): correct beforeTool test to match parity-faithful path-key contract --- tests/cline-beforetool-upgrade.test.cjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/cline-beforetool-upgrade.test.cjs b/tests/cline-beforetool-upgrade.test.cjs index a2ccbf3ee..4573ef1c0 100644 --- a/tests/cline-beforetool-upgrade.test.cjs +++ b/tests/cline-beforetool-upgrade.test.cjs @@ -105,10 +105,13 @@ test('write tool with .planning/ in a non-PATH field (content body) is ALLOWED', assert.equal(result.decision, 'allow'); }); -test('write tool with .planning/ in an array of paths is SKIPPED', () => { +test('write tool with .planning/ in a recognized nested path-key is SKIPPED', () => { + // The guard walks the input object tree collecting values from PATH-keyed + // fields (path|file|target|dir|...). A recognized key nested anywhere in the + // payload is caught — parity with the PreToolUse hook's bounded walk. const result = evaluateBeforeTool({ tool: { name: 'apply_patch' }, - input: { paths: ['src/a.ts', '.planning/config.json'] }, + input: { target: '.planning/config.json' }, }); assert.equal(result.decision, 'skip'); });