Repository navigation
fix(hooks): fail closed on unavailable and invalid pre-push scans #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6e1b916
fix(hooks): require successful validated pre-push scans
hyperpolymath 4c97823
docs(hooks): document pre-push scanner validation and failure handling
coderabbitai[bot] aa3794e
fix(hooks): deduplicate pre-push scanners without associative arrays
coderabbitai[bot] d0a455b
test(hooks): expand pre-push scanner, CI runner, and hook installatio…
coderabbitai[bot] a01d278
fix(hooks): preserve dangling hooks and adopt the current canon table
hyperpolymath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // SPDX-License-Identifier: CC-BY-SA-4.0 | ||
| = Local pre-push gate | ||
| :revdate: 2026-11-07 | ||
|
|
||
| Run `bash scripts/install-pre-push-gate.sh /path/to/consumer` from a reviewed | ||
| fleet checkout. The installer uses Git's hooks path, including linked worktrees | ||
| and `core.hooksPath`. It refuses to replace a different existing hook. Compose | ||
| such a hook explicitly; do not overwrite its checks. A second identical | ||
|
hyperpolymath marked this conversation as resolved.
Resolved
|
||
| installation is a no-op. A future upgrade also requires reviewing the existing | ||
| copy rather than overwriting custom changes. | ||
|
|
||
| The gate requires `jq`, GNU `timeout`, and at least one available scanner on | ||
| the hook's PATH. With the default `auto` selection it runs every available | ||
| scanner; a failure from either blocks even if another scanner succeeds. | ||
| Set repository config `fleet.prePushScanners` to `hypatia`, `panic-attack`, or | ||
| `hypatia panic-attack` to require those particular scanners. An unavailable | ||
| required scanner blocks. `fleet.prePushTimeoutSeconds` defaults to 180 and | ||
| accepts 1 through 1800 seconds per scanner. | ||
|
|
||
| Hypatia uses `hypatia-cli.sh scan` with JSON output and the critical threshold. | ||
| Both its Elixir findings array and Bash submission envelope are validated. | ||
| Panic-attack uses `assail --headless --output-format json --fail-on-incomplete`; | ||
| its 2.6 report must record complete, non-empty declared coverage. Older reports | ||
| with no coverage receipt cannot certify this gate. Unknown formats, severities, | ||
| malformed output, scanner errors and timeouts block. Explicit suppressed or | ||
| advisory findings do not block; unsuppressed critical findings do. | ||
|
|
||
| Static scanning does not execute changed workflows. Set `fleet.prePushCiRunner` | ||
| to an absolute executable path for the consumer's owned execution gate. It runs | ||
| in the consumer working tree and receives the original pre-push arguments and | ||
| ref-update stdin. A missing or failed configured runner blocks. Without one, | ||
| the output explicitly reports static scanning only; it is not local CI parity | ||
| or hosted validation. The consumer remains responsible for selecting changed | ||
| scripts and fixtures and validating unsupported hosted semantics. | ||
|
|
||
| `bash tests/pre-push-gate-test.sh` uses fixture scanner processes to exercise | ||
| failure boundaries, actual Git hook installation and a real script/fixture | ||
| execution adapter. Those controls are not deployment evidence or a real scan. | ||
| Record actual scanner and consumer execution receipts separately before | ||
| claiming a consumer has adopted the full gate. | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the
rhodibotmatrix job runs,scripts/check-canon-drift.shdefaults tomainand compares that branch's gate table andcanon.lockagainst this digest; however, the current standardscanon.lockstill records the previous2f31f46d...gate hash, while this change pinsfe57d352.../5c510bba...and the checker never reads the newcommitfield. Consequently the mandatory Rust job exits in the canon-drift step before building or testing. Land the gate table and lock upstream first, or update the checker to fetch and consistently validate the configured repository/commit.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CodeRabbit please fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Analysis chain
Script executed:
Length of output: 31336
Script executed:
Length of output: 4589
@hyperpolymathThe gate table at the pinned commit matches the vendored digest, butcanon.lockat that same commit still records the old digest. Changing the ref alone will not make the check pass. The upstream lock must be corrected before this gate update can pass without weakening validation.Failed to start Coding Agent task. Please try again.
You are interacting with an AI system.