Repository navigation
fix(guardrails): say when check-bash-file-changes could not run - #6988
Conversation
An unexpected error in check-bash-file-changes.mjs was swallowed by
main().catch(() => {}), so the hook exited 0 with no output. It now gives
the fail-open notice the shell hooks' abort boundary gives: "guard did not
run (internal error, rc=1); this call was not checked" on stderr and as a
systemMessage, and still exits 0.
Closes #6905
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hook change, its tests and the README line that the previous commit left unstaged. Refs: #6905 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 2m 4s —— View job Security review complete ✅
Scope: No security issues found. Analysis:
No GitHub Actions files are touched by this PR, so no zizmor-lane deferral applies. |
|
Claude finished @kyle-sexton's task in 1m 45s —— View job Review:
|
|
claude-review has reviewed this pull request through e72d934; a later push is reviewed from there. |
|
claude-security-review has reviewed this pull request through e72d934; a later push is reviewed from there. |
Closes #6905
Summary
check-bash-file-changes.mjsended withmain().catch(() => {}), so an unexpected exception exited 0 with nothing on stderr or stdout. That contradicted the guardrails README's "Every hook says so when it could not run". The shell hooks get that notice fromhooks/abort-boundary.sh; this Node hook had no equivalent.Fix
guardrails check-bash-file-changes: guard did not run (internal error, rc=1); this call was not checked. Details: claude --debug., to stderr (followed by the error stack for the debug log) and as{"systemMessage": ...}on stdout. It exits 0, the hook's declared fail-open posture.rc=1is the status an uncaught error would have ended Node with..mjsguard has the gap.exec-bash.mjsis a generated shared launcher with no swallowing catch..changes/guardrails/...(patch).Verification
hooks/check-bash-file-changes.test.sh:CLAUDE_PLUGIN_DATAnames a file, so the snapshot'smkdirSyncthrows. Asserts exit 0, the exactsystemMessage, a single stdout document, and the notice as stderr's first line.null, somain()throws in check mode. Same assertions.PASS=60 FAIL=0.hooks/*.test.shexit 0, andnode --test hooks/exec-bash.resolver.test.mjspasses.scripts/check-changelog-fragments.sh --checkpasses. shellcheck is clean on the test file.Related
🤖 Generated with Claude Code