mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-20 06:51:44 +02:00
Merge branch 'main' into affaan/integrate-reviewed-followups-20260928
This commit is contained in:
@@ -2748,6 +2748,31 @@ async function runTests() {
|
||||
passed++;
|
||||
else failed++;
|
||||
|
||||
if (
|
||||
test('MCP health-check hooks use anchored ^mcp__ matcher (no wildcard spawns)', () => {
|
||||
const hooksPath = path.join(__dirname, '..', '..', 'hooks', 'hooks.json');
|
||||
const hooks = readHooksConfig(hooksPath);
|
||||
|
||||
const preMcp = hooks.hooks.PreToolUse.filter(entry => JSON.stringify(entry).includes('pre:mcp-health-check'));
|
||||
assert.strictEqual(preMcp.length, 1, 'Should define exactly one PreToolUse mcp-health-check entry');
|
||||
assert.strictEqual(
|
||||
preMcp[0].matcher,
|
||||
'^mcp__',
|
||||
`PreToolUse mcp-health-check matcher must be anchored '^mcp__' so it only spawns on genuine MCP tool names (got ${preMcp[0].matcher})`
|
||||
);
|
||||
|
||||
const postMcp = hooks.hooks.PostToolUseFailure.filter(entry => JSON.stringify(entry).includes('post:mcp-health-check'));
|
||||
assert.strictEqual(postMcp.length, 1, 'Should define exactly one PostToolUseFailure mcp-health-check entry');
|
||||
assert.strictEqual(
|
||||
postMcp[0].matcher,
|
||||
'^mcp__',
|
||||
`PostToolUseFailure mcp-health-check matcher must be anchored '^mcp__' so it only spawns on genuine MCP tool failures (got ${postMcp[0].matcher})`
|
||||
);
|
||||
})
|
||||
)
|
||||
passed++;
|
||||
else failed++;
|
||||
|
||||
if (
|
||||
test('hooks.json gives PowerShell dedicated GateGuard and governance routes', () => {
|
||||
const hooksPath = path.join(__dirname, '..', '..', 'hooks', 'hooks.json');
|
||||
|
||||
Reference in New Issue
Block a user