From a8bb5979a5ad8e39fc96dd2ad1fb90fe48727e83 Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Tue, 14 Apr 2026 21:17:17 -0700 Subject: [PATCH] fix: preserve commit-quality blocking in bash dispatcher --- scripts/hooks/pre-bash-commit-quality.js | 6 +++++- tests/hooks/bash-hook-dispatcher.test.js | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/hooks/pre-bash-commit-quality.js b/scripts/hooks/pre-bash-commit-quality.js index b554bff1..37e6bc7e 100644 --- a/scripts/hooks/pre-bash-commit-quality.js +++ b/scripts/hooks/pre-bash-commit-quality.js @@ -380,7 +380,11 @@ function evaluate(rawInput) { } function run(rawInput) { - return evaluate(rawInput).output; + const result = evaluate(rawInput); + return { + stdout: result.output, + exitCode: result.exitCode, + }; } // ── stdin entry point ──────────────────────────────────────────── diff --git a/tests/hooks/bash-hook-dispatcher.test.js b/tests/hooks/bash-hook-dispatcher.test.js index 2215ae83..f9351360 100644 --- a/tests/hooks/bash-hook-dispatcher.test.js +++ b/tests/hooks/bash-hook-dispatcher.test.js @@ -74,7 +74,7 @@ function runTests() { if (test('post dispatcher writes both bash audit and cost logs in one pass', () => { const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ecc-bash-dispatcher-')); - const payload = { tool_input: { command: 'npm publish --token abc123' } }; + const payload = { tool_input: { command: 'npm publish --token fixture-token' } }; try { const result = runScript(postDispatcher, payload, { @@ -89,8 +89,8 @@ function runTests() { assert.ok(auditLog.includes('--token=')); assert.ok(costLog.includes('tool=Bash command=npm publish --token=')); - assert.ok(!auditLog.includes('abc123')); - assert.ok(!costLog.includes('abc123')); + assert.ok(!auditLog.includes('fixture-token')); + assert.ok(!costLog.includes('fixture-token')); } finally { fs.rmSync(homeDir, { recursive: true, force: true }); }