Skip to content

fix(guard-git): segment push targets; scan all -m for attribution - #229

Merged
danielvm-git merged 1 commit into
mainfrom
fix/guard-git-attribution-push-target
Nov 6, 2026
Merged

danielvm-git merged 1 commit into
mainfrom
fix/guard-git-attribution-push-target

Conversation

@danielvm-git

Copy link
Copy Markdown
Owner

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. Both hooks/pre-tool-use.sh and extensions/omp-hooks.ts now split the command on separators (;, &, |) and judge only the push segment.

BUG-2026-11-03-guard-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.

Tests

  • specs/verifications/fixtures/guard-git-normalize.yaml gains two rows: prose-in-separator → allow, real protected target → block.
  • scripts/test-guard-git-normalize.sh gains two adjacent cases: footer-in-second-paragraph → block, bare "Co-authored-by" prose (no colon) → allow.
  • Both implementations agree on all 33 rows.
PASS (a) shell hook matches all 33 fixture rows
PASS (b) TS extension matches all 33 fixture rows
PASS (c) shell and TS agree on all 33 rows
PASS (d) adjacent rules: commits, pushes, gemini JSON, pi fallback

Gates

npm run compliance 0 · bash scripts/run-verification-gates.sh 61/61 · trace-stories --strict 0.

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
danielvm-git merged commit e72e2ad into main Nov 6, 2026
7 checks passed
@danielvm-git
danielvm-git deleted the fix/guard-git-attribution-push-target branch November 6, 2026 22:35
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.
github-actions Bot pushed a commit that referenced this pull request Nov 6, 2026
## [2.94.1](v2.94.0...v2.94.1) (2026-11-06)

### Bug Fixes

* **guard-git:** segment push targets; scan all -m ([#229](#229)) ([e72e2ad](e72e2ad))
* **trace:** index only git-tracked files and avoid other worktrees ([#203](#203)) ([6becdc3](6becdc3)), closes [#197](#197)
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.94.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant