B13 — guard.py backstop recognizes GitHub's own commits (stale-ref-proof)#59
Merged
Conversation
…ef-proof (B13) The backstop keyed on author email and origin/main ancestry; both are blind exactly when the container stop hook misfires (stale/absent refs — four false 'amend these' nudges on 2026-07-11 alone named GitHub merge commits). GitHub finalizes merge/squash commits as committer noreply@github.com; those are now INTRINSICALLY protected — HEAD and range checks both read author AND committer, so the block holds with no published ref at all. Five tests drive the real hook against fixture repos, including the stale-origin/main rebase and the no-overreach case (agent-only history stays rewritable). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LVPyHAtQ1cdK76RpFasafP
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
wecanjustbuildthings | 528c54a | Jul 12 2026, 11:07 AM |
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.
What does this PR do?
The M0-R1 scope addendum, one commit (
528c54a) + tests. One precision on the ruling's wording, verified before writing: the misfiring nudge lives in the container-level~/.claude/stop-hook-git-check.sh(user-level; this repo cannot ship a fix there — prior HOOK-LAND-v1 ruling stands). What the repo CAN fix — and what this lands — is the defense against obeying that nudge:guard.py's RULE-3 backstop keyed on author email +origin/mainancestry, both blind exactly when refs are stale or absent — the misfire condition itself.The fix: GitHub finalizes merge/squash commits as committer
noreply@github.com. Those are now intrinsically protected: the HEAD and range checks read author AND committer, so a--amend/--reset-author/filter-branch/rebase touching one is blocked with no published ref needed at all.Tests (5, driving the real hook against fixture repos via stdin JSON, asserting exit codes):
origin/main→ blockedVerification
npm run verify:allexit 0 — 366/366 tests (+5)Per the M0-R1 sequence: you merge this, then M1 begins.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LVPyHAtQ1cdK76RpFasafP
Generated by Claude Code