-
Notifications
You must be signed in to change notification settings - Fork 0
chore(dev-loop): gate architecturally-significant PRs on an architecture-reviewer pass #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
306def7
chore(dev-loop): gate architecturally-significant PRs on an architect…
emeraldleaf 8e0a9df
docs(audits): log vibe-coding audit
emeraldleaf 4b0b456
Merge branch 'main' into chore/architecture-review-gate
emeraldleaf 292bed6
Merge branch 'main' into chore/architecture-review-gate
emeraldleaf 16159b4
Merge branch 'main' into chore/architecture-review-gate
emeraldleaf 44c6e2d
Merge remote-tracking branch 'origin/main' into chore/architecture-re…
emeraldleaf a8bb2d2
Merge branch 'chore/architecture-review-gate' of https://github.com/e…
emeraldleaf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env bash | ||
| # PreToolUse hook on Bash. When the command opens a PR (`gh pr create`), surfaces a reminder | ||
| # to run the architecture-reviewer agent first for architecturally-significant changes. | ||
| # | ||
| # Purpose: the "architecture-reviewer before merge" rule (CLAUDE.md "Presence in the loop") | ||
| # proved skippable as principle alone — the ASB->RabbitMQ swap (PR #159) shipped to a PR before | ||
| # any review; the review, run only after a prompt, then caught a dead OpenTelemetry trace source. | ||
| # This is the mechanical catch at the ship moment. Non-blocking by design: significance is a | ||
| # judgment call (pattern-conforming changes legitimately skip the agent), and a hard deny on a | ||
| # command pattern can't ever let the PR through. The gate is "resolve findings before MERGE", | ||
| # and PRs are not auto-merged, so a reminder at open-time is correctly timed. | ||
| # | ||
| # See CLAUDE.md "Architecturally-significant changes get an architecture-reviewer pass". | ||
|
|
||
| set -uo pipefail | ||
|
|
||
| command=$(jq -r '.tool_input.command // ""' 2>/dev/null) | ||
|
|
||
| # `git commit` messages routinely mention "gh pr create" in prose (this script's own commit did), | ||
| # which would false-positive on a plain substring match. A real PR-open is never part of a commit. | ||
| case "$command" in | ||
| *"git commit"*) exit 0 ;; | ||
| esac | ||
|
|
||
| # Only fire when actually opening a PR. | ||
| case "$command" in | ||
| *"gh pr create"*) ;; | ||
| *) exit 0 ;; | ||
| esac | ||
|
|
||
| # Feed the reminder text straight into jq as raw stdin (-R -s) to build the hook output. | ||
| # (Avoids a heredoc inside $(...), which mis-parses apostrophes on macOS bash 3.2.) | ||
| jq -Rs '{hookSpecificOutput: {hookEventName: "PreToolUse", additionalContext: .}}' <<'EOF' | ||
| ARCHITECTURE-REVIEW GATE (CLAUDE.md "Presence in the loop") -- about to open a PR. | ||
|
|
||
| If this change is architecturally significant, run the `architecture-reviewer` agent on the | ||
| diff and address or explicitly defer its findings in the PR body before merge. Significant = | ||
| - adds/removes a dependency or transport, OR | ||
| - touches 3+ services, OR | ||
| - alters a cross-cutting pattern (DI, middleware, persistence, messaging, auth), OR | ||
| - modifies a Domain aggregate, OR | ||
| - the /feature-spec Significance Check would flag it. | ||
|
|
||
| Pattern-conforming changes (CRUD matching an existing shape, an audit-log row, a doc-only | ||
| edit) may proceed without the agent. This is a reminder, not a block. | ||
| EOF |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.