test(hooks): hook-behavior harness, shellcheck CI, baseline cases (U15 — PR0, merge first) - #43
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CI runners ship a newer shellcheck that reports the sourced-invoked library functions as SC2317 (unreachable) where local versions report SC2329 (never invoked) — same false positive, different finding code. Scoped to the one file whose functions are called only from dynamically sourced case files; the hook-tests job itself was already green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
U15 (PR0 lane) from
plan_framework_hardening.md— the review's Critical finding: hooks were untested config. This PR makes hook behavior a tested surface and must merge FIRST; the hooks/invariants/gates lanes add their cases to it.What changed
scripts/test-hooks.sh— table-driven hook-behavior runner (report() idiom from check-invariants.sh); auto-sourcesscripts/hook-tests.d/*.shcase files (open/closed: later PRs ship cases as new files);path_without_jqshim for fail-open testing.scripts/hook-tests.d/00-baseline.sh— 11 characterization cases pinning current behavior of the five hooks the plan touches (advisory pre-commit context, explicit main-push deny, clean-tree silence, secret-write ask, normal-write allow, jq-absent fail-open sweep).failing-project(node -e "process.exit(1)"),slow-gate(sleeps 8s).shellcheckandhook-testsjobs (pinned SHAs, minimal permissions, matching house style).VERIFICATION_COMMANDS+ unusedPY_MGRblock;ls | wc -l→find), behavior pinned by the baseline cases.Provenance
check-invariants.sh21/21 GREEN;test-hooks.sh11/11 GREEN; shellcheck + actionlint + bash -n clean; harness teeth verified (deliberate wrong expectation fails the run).Notes / follow-up
The shellcheck CI job excludes three pre-existing finding classes in
scripts/with an in-file comment (SC2319— check-invariants' own idiom;SC2164;SC1087in init-framework.sh). Follow-up unit should fix or formally except them.🤖 Generated with Claude Code