fix(#2090): correct beforeTool test to match parity-faithful path-key contract
This commit is contained in:
@@ -105,10 +105,13 @@ test('write tool with .planning/ in a non-PATH field (content body) is ALLOWED',
|
|||||||
assert.equal(result.decision, 'allow');
|
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({
|
const result = evaluateBeforeTool({
|
||||||
tool: { name: 'apply_patch' },
|
tool: { name: 'apply_patch' },
|
||||||
input: { paths: ['src/a.ts', '.planning/config.json'] },
|
input: { target: '.planning/config.json' },
|
||||||
});
|
});
|
||||||
assert.equal(result.decision, 'skip');
|
assert.equal(result.decision, 'skip');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user