Skip to content

chore(dev-loop): gate architecturally-significant PRs on an architecture-reviewer pass#160

Merged
emeraldleaf merged 7 commits into
mainfrom
chore/architecture-review-gate
Jul 19, 2026
Merged

chore(dev-loop): gate architecturally-significant PRs on an architecture-reviewer pass#160
emeraldleaf merged 7 commits into
mainfrom
chore/architecture-review-gate

Conversation

@emeraldleaf

@emeraldleaf emeraldleaf commented Jun 18, 2026

Copy link
Copy Markdown
Owner

What

Makes the "review architecturally-significant changes before merge" rule un-skippable by giving it a trigger at the ship moment.

  1. CLAUDE.md — explicit rule (under "Presence in the loop"): architecturally-significant changes get an architecture-reviewer pass before the PR opens; findings addressed or deferred in the PR body before merge. Defines "significant" concretely (transport/dependency change, 3+ services, cross-cutting pattern, Domain aggregate, or /feature-spec significance).
  2. .claude/scripts/remind-architecture-review.sh — a PreToolUse(Bash) hook that surfaces the reminder when the command opens a PR. Non-blocking (significance is a judgment call; a command-pattern deny could never let a PR through). Guards against the git commit false positive (commit messages mention the command in prose).
  3. .claude/settings.json — registers the hook.

Why

The lesson from PR #159 (ASB→RabbitMQ): the "stay present / review significant changes" principle already existed in CLAUDE.md and I'd read it — but it had no trigger at the ship moment, so it got skipped. The review, run only after a prompt, then caught a real bug (a dead OpenTelemetry trace source that would have silently dropped saga spans). Principle-as-words proved skippable; this adds the mechanical catch, per the project's own convention → hook → CI escalation philosophy.

Applying the gate to this PR

The new hook fired on gh pr create (working as intended). Assessing significance: this change is dev-loop tooling — a CLAUDE.md process rule + a bash hook + a settings entry, with no application .cs code. The architecture-reviewer agent evaluates application architecture (SOLID/DDD/VSA/perf/security against its Pattern checklist), none of which this PR touches. So per the gate's own criteria it's not significant in the agent's sense — proceeding without the agent (this is exactly the "pattern-conforming / tooling changes may proceed" carve-out).

Test plan

  • jq validates .claude/settings.json (2 PreToolUse entries).
  • Hook smoke-tested: fires on gh pr create, silent on git status, and silent on a git commit whose message mentions "gh pr create" (the false positive this guard fixes).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Clarified when architectural review is required before opening a pull request.
    • Defined the types of changes that warrant additional architectural review.
  • Chores

    • Added an automated, non-blocking reminder when creating pull requests.
    • Recorded an article audit outcome with no follow-up action required.

…ure-reviewer pass

Encodes the lesson from the ASB→RabbitMQ swap (PR #159): the "stay present / review
significant changes" principle existed in CLAUDE.md but had no trigger at the ship moment,
so it got skipped — the review (run only after a prompt) then caught a dead OTel trace source.
Principle alone proved skippable, so add the mechanical catch.

- CLAUDE.md: explicit rule — architecturally-significant changes get an architecture-reviewer
  pass before the PR opens; findings addressed or deferred in the PR body before merge. Defines
  "significant" concretely (transport/dep change, 3+ services, cross-cutting pattern, Domain
  aggregate, or /feature-spec significance).
- .claude/scripts/remind-architecture-review.sh: PreToolUse(Bash) hook that surfaces the
  reminder when the command is `gh pr create`. Non-blocking (significance is a judgment call;
  a command-pattern deny could never let a PR through). Smoke-tested both branches.
- .claude/settings.json: register the hook.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a PreToolUse Bash hook that reminds contributors to run architecture-reviewer before opening qualifying pull requests, documents the rule, and records a new article-audit result.

Changes

Architecture review gate

Layer / File(s) Summary
Define the pre-PR review rule
CLAUDE.md, .claude/scripts/remind-architecture-review.sh
Documents when an architecture review is required and introduces the reminder script with strict Bash execution.
Execute the PR creation reminder
.claude/scripts/remind-architecture-review.sh, .claude/settings.json
Extracts Bash commands, targets gh pr create, emits a non-blocking PreToolUse payload, and registers the hook.

Article audit record

Layer / File(s) Summary
Append the audit result
.claude/audits/INDEX.md
Adds the 2026-06-17 “The New SDLC with Vibe Coding” audit entry with a “No action” outcome.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a dev-loop gate that reminds authors to run an architecture-reviewer pass for significant PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/architecture-review-gate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

No action — article already encoded more rigorously in the repo’s AI workflow rules.
@emeraldleaf

Copy link
Copy Markdown
Owner Author

Re-validated against current main after the merge train landed:

  • CI 8/8 green (incl. the new tombstone + messaging-topology audits added on main since this branch was cut).
  • No conflict with this week's CLAUDE.md rewrites — the rule text slots in cleanly.
  • Hook smoke-tested on the current branch: fires on gh pr create, stays silent on a git commit whose message merely mentions "gh pr create" (the false positive this branch already fixed), silent on unrelated commands.

The rationale also got stronger since this was opened: the gate is exactly what caught 1 Must-fix + 3 Should-consider on #173 (including a factually wrong teaching comment claiming NotificationService handlers were idempotent) before the PR was opened — and the #159 review it cites went on to surface 25 verified findings, two of them real durability bugs (#168/#169, fixed in #173).

@emeraldleaf

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@emeraldleaf

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@emeraldleaf

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/settings.json:
- Around line 53-61: Update the permissions.allow array in the settings
configuration to include the Bash(gh pr create *) permission, alongside the
existing GitHub CLI permissions, so the architecture-review hook can
successfully execute gh pr create.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: dad8295b-9d4c-4936-b592-3345a3b766a5

📥 Commits

Reviewing files that changed from the base of the PR and between 10c0113 and a8bb2d2.

📒 Files selected for processing (4)
  • .claude/audits/INDEX.md
  • .claude/scripts/remind-architecture-review.sh
  • .claude/settings.json
  • CLAUDE.md

Comment thread .claude/settings.json
@emeraldleaf
emeraldleaf merged commit 03e8b95 into main Jul 19, 2026
8 checks passed
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