Repository navigation
fix(guard-git): segment push targets; scan all -m for attribution - #229
Merged
Merged
Conversation
1. push-target-matches-text: the protected-branch check tested the whole command string, so a protected name in trailing prose or a later command blocked an unrelated feature push. Both the shell hook and the TS extension now split the command on separators and judge only the git push segment. 2. attribution-second-m: only the first -m paragraph was checked for the Co-authored-by footer, so a second -m carrying it passed. The shell hook now scans the full command for the token. Regression rows added to the normalize fixture and two adjacent attribution cases; both implementations agree on all 33 rows. Refs BUG-2026-11-03-guard-push-target-matches-text, BUG-2026-11-03-guard-attribution-second-m
danielvm-git
added a commit
that referenced
this pull request
Nov 6, 2026
PR #229 fixed the push-target-matches-text and attribution-second-m defects; record the evidence in the bug records and regenerate the registry.
|
🎉 This PR is included in version 2.94.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.
What this fixes
Two guard-git defects from the 2026-11-03 bug batch.
BUG-2026-11-03-guard-push-target-matches-text— the protected-branch check ran its regex over the whole command string, so a protected name in trailing prose (echo "=== commits ahead of main ===") or a later command blocked an unrelated feature push. Bothhooks/pre-tool-use.shandextensions/omp-hooks.tsnow split the command on separators (;,&,|) and judge only the push segment.BUG-2026-11-03-guard-attribution-second-m— only the first-mparagraph was checked for theCo-authored-by:footer, so a second-mcarrying it passed. The shell hook now scans the full command for the token.Tests
specs/verifications/fixtures/guard-git-normalize.yamlgains two rows: prose-in-separator → allow, real protected target → block.scripts/test-guard-git-normalize.shgains two adjacent cases: footer-in-second-paragraph → block, bare "Co-authored-by" prose (no colon) → allow.Gates
npm run compliance0 ·bash scripts/run-verification-gates.sh61/61 ·trace-stories --strict0.