Repository navigation
fix(hooks): give each guard fixture row its own branch context - #196
Merged
Merged
Conversation
The parity gate pinned the TS side to a feature branch (branchFor returned a
constant) while the shell side read the checkout's real HEAD. Protected-branch
rules answer differently on main, so the table could only pass off-branch: it
was green on every PR and went red on the first push to main after the previous
fix merged.
- Fixture rows may state 'branch:'; the two commit rows are now the SAME command
with opposite verdicts, one on a feature branch, one on main.
- The probe takes [{command, branch}] so branchFor answers per row.
- The harness creates a throwaway repo per distinct branch and runs the shell
hook in it, so both sides are judged in the same context — no production env
override (a pinned branch would be a bypass for real agents).
- (d) adjacent assertions run in a feature repo for the same reason.
Mutation-checked: removing the commit rule from the TS port fails (b) and (c).
Refs BUG-2026-11-03-guard-normalize-branch-context.
Fixes verification-gates red on main (run 41667688664).
|
🎉 This PR is included in version 2.91.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
mainwent red right after #194 merged. The parity gate compared a TS side pinned to a featurebranch with a shell side reading the real HEAD. Protected-branch rules answer differently on
main, so the table could only pass off-branch. FixesBUG-2026-11-03-guard-normalize-branch-context.branch:— default is a feature branch. The two commit rows are now thesame command text with opposite verdicts: allow on
fix/…, block onmain. That pair is theproperty that had no coverage.
scripts/omp-guard-probe.tstakes[{command, branch}], sobranchForanswers per row.scripts/test-guard-git-normalize.shbuilds one throwaway repo per distinct branch —git init,empty commit, checkout — and runs the shell hook inside it, so both implementations are judged in
the same context. Deliberately no production env override: a pinned branch would be a bypass
for real agents.
branch: mainrow also documents the protected-branch commit rule that was untested before.Test plan
bash scripts/test-guard-git-normalize.sh→ 4 passed, 0 failed (31 rows) from a feature worktreeHEAD -> main→ 4 passed, 0 failedmainclone → 2 passed, 3 failed — byte-identical to the CI failurenpm run compliancepass ·bash scripts/run-verification-gates.sh54/54 passbash scripts/lib/assert-epic-gate.sh releasepass