Repository navigation
fix(scripts): fail checks that checked nothing and record the hook timings - #16645
Conversation
…mings A check that ran over no input exited 0, which reads as a clean run. - check-cant-fail-scan.sh <base>: an empty diff while HEAD is not the base exits 2, as check-affected.sh does. A diff with no test file keeps exit 0 and now counts the files it looked at. - affected-tests.sh --shard: a leg that draws none of a non-empty selection exits 2 (more legs than suites). No workflow calls it with --shard; CI legs use run-plugin-tests.sh --suites-from. - lefthook.yml pre-push: a merge-base copy of the hook that cannot be extracted, or a failed mktemp, blocks the push instead of passing. No origin/main merge-base still skips with its notice. The check-placement contract gets the commit-set budget (10 s, judgment from the measured set) and a per-check timing table for both stages. Change-scoped tests stay in CI: they add 91 s on a one-file script edit and 146 s on a 28-file change, over the 60 s push budget. The plugin-imports boundary check already runs at pre-push. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis 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-security-review reviewed Security review: PR #16645I found no security issues. I read all 8 changed files in full in the diff. critical-findings: 0 What I checked
Trust controls. No trust control widens. Nothing changes the trusted-trigger check, lane token scope, the kill switch, merge holds, token-broker config or any plugin manifest. Embedded text. The PR context has no instructions aimed at this review. Spend. Nothing here can cause a charge; it changes local git-hook and script behaviour only. |
|
claude-review reviewed Code review: no findings. I read every hunk of all 8 changed files. What I checked
Context checks
Verifier dropped 0 of 0 candidates. |
No related issue: owner decision that a check over zero inputs fails, and that the hook stages get a measured budget.
Summary
A check that ran over no input exited 0, which reads as a clean run. Three repo checks now fail when they checked nothing. The check-placement contract gets a commit-set budget and a timing table for each check at both hook stages.
Fix
scripts/check-cant-fail-scan.sh <base>: an empty diff while HEAD is not the base exits 2, ascheck-affected.shdoes. A diff with no test file keeps exit 0 and now reports how many files it looked at.scripts/affected-tests.sh --shard: a leg that gets none of a non-empty selection exits 2, because that means more legs than suites. No workflow calls it with--shard.lefthook.ymlpre-push: the push is now blocked when the hook's merge-base copy cannot be extracted ormktempfails; before, it passed. With noorigin/mainmerge-base, the job still skips and prints its notice.docs/contracts/check-placement/README.md: sets the commit budget to 10 s for all 11pre-commitentries run in a row (judgment from the measured set). Adds a per-check timing table for both stages. Change-scoped tests stay in CI: they add 91 s on a one-file script edit and 146 s on a 28-file change, which is over the 60 s push budget.Verification
check-cant-fail-scan(25),affected-tests(148),check-affected-pre-push(52),check-affected(133), guardrailslefthook-remote(40) and code-tidyinglefthook-remote(14).check-line-citations.py: passes.check-affected,reference-verifyandpre-push-contentall passed.Measured over budget
On
83fb17c179, a real 44-fileorigin/maincommit, the shippedpre-commitset took 96.3 s. That is over the 10 s commit budget and the 60 s push budget. bash-formatshell-checkalone took 98.9 s: shellcheck needs 1.7 s for each copy of the 5,174-linelib/hook-utils.sh, and that commit changes 22 copies. The contract records this as a measured result. The fix is in bash-format, not in this PR.Related
🤖 Generated with Claude Code