Merge branch 'main' into affaan/integrate-reviewed-followups-20260928

This commit is contained in:
haelyra
2026-09-29 18:13:54 -04:00
committed by GitHub
3 changed files with 29 additions and 4 deletions
+25
View File
@@ -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');