Skip to content

feat: #!axme gate protocol for git commit/push#38

Merged
George-iam merged 1 commit intomainfrom
feat/axme-gate-20260407
Apr 7, 2026
Merged

feat: #!axme gate protocol for git commit/push#38
George-iam merged 1 commit intomainfrom
feat/axme-gate-20260407

Conversation

@George-iam
Copy link
Copy Markdown
Contributor

Summary

  • Replace fragile checkMergedBranch (cwd bug, fail-open, network dependent) with #!axme gate protocol
  • Every git commit/push must include #!axme pr=<number|none> repo=<owner/repo> suffix
  • Hook parses metadata, verifies PR not merged via gh pr view --repo (explicit repo, no cwd guessing)
  • Fail-CLOSED: if gh check fails, command is blocked (not silently allowed)
  • Agent instruction added to MCP server instructions so agents know the format upfront
  • Removes detectBranch and checkMergedBranch (source of repeated bugs)

Test plan

  • 21 new tests: parseAxmeGate parsing + checkGit integration
  • Blocks commit without gate, blocks push without gate
  • Allows pr=none, blocks invalid pr, blocks merged PR
  • Does NOT require gate on git add/status/branch/diff/log
  • Force push and direct-to-main checks still work with gate present
  • git -C prefix works with gate
  • Build + type check green
  • E2E: reload MCP server, attempt git commit without gate, verify block message

Every git commit/push must include `#!axme pr=<number|none> repo=<owner/repo>`
suffix. The hook parses this metadata and verifies PR status via
`gh pr view --repo` with explicit repo (no cwd guessing).

- Plain git commit/push without gate -> BLOCKED with format instruction
- pr=none -> allowed (new branch, no PR yet)
- pr=<number> -> checked via gh, merged -> BLOCKED
- gh fails -> BLOCKED (fail-closed, not fail-open)
- Removes old checkMergedBranch/detectBranch (cwd bug, fail-open, fragile)
- Agent instruction added to MCP server instructions
- 21 new tests (parseAxmeGate + checkGit integration)
@George-iam George-iam merged commit 58762bd into main Apr 7, 2026
@George-iam George-iam deleted the feat/axme-gate-20260407 branch April 7, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant