Skip to content

Commit 28a3fbc

Browse files
chore(forge): add CodeRabbit review gate
1 parent 02725ff commit 28a3fbc

3 files changed

Lines changed: 65 additions & 6 deletions

File tree

.github/PULL_REQUEST_TEMPLATE/agent.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ $ uv run python-docs-mcp-server doctor
2222
<!-- Plus any change-type-specific gates from pipeline §5 (stdio smoke,
2323
validate-corpus, uv lock --check) that applied to this change. -->
2424

25+
## CodeRabbit review
26+
<!-- After CodeRabbit comments, summarize findings as:
27+
- Blocking: <items or None>
28+
- Follow-up: <items or None>
29+
- False positive: <items or None>
30+
If CodeRabbit has not run yet, write "Pending." Do not mark findings green
31+
by silence. -->
32+
Pending.
33+
2534
## What this does NOT touch
2635
<!-- Restate the forbidden-territory items (pipeline §2) relevant to this issue
2736
and affirm they were not modified. -->

AGENT-EXECUTION-PIPELINE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Every PR requires human review before merge. **No auto-merge, ever.**
1717
- Agents declare their scope explicitly and stay inside it.
1818
- The canonical validation gate (§5) must pass before any PR is opened. Failing gate → no PR, just a `WORKING-NOTES.md` on the branch + comment on the issue.
19+
- Automated review tools such as CodeRabbit provide review signal only. They do not approve, merge, or override the human-review gate.
1920
- Forbidden territory (§2) is non-negotiable. Any drift triggers a hard stop.
2021
- Recovery is always **stop and post a comment**, never **silently expand scope**.
2122

@@ -134,6 +135,7 @@ uv run python-docs-mcp-server doctor
134135
- `Closes #<issue-number>` (or `Refs #` if intentionally not closing)
135136
- Each acceptance criterion as a checked or unchecked box, with a one-line explanation if unchecked
136137
- Output (or link to artifact) for the §5 validation gate
138+
- CodeRabbit triage summary when CodeRabbit comments on the PR: blocking, follow-up, false positive, or pending/unavailable
137139
- "What this does NOT touch" section reaffirming the forbidden-territory items relevant to this issue
138140
- A short "Why this approach" paragraph if the design wasn't fully prescribed in the issue
139141
- **PR is opened against** the milestone integration branch (e.g., `release/v0.3.0`) when one exists, otherwise `main`. Never auto-merge.
@@ -371,5 +373,6 @@ The default loop is Vision → Gilfoyle → Heimdall → Vision/Aymen:
371373
- Vision owns issue pre-flight, `agent-ready`, review synthesis, branch protection, and pause/resume decisions.
372374
- Gilfoyle owns scoped implementation on exactly one issue at a time.
373375
- Heimdall owns independent verification, packaging/install smoke, security-sensitive checks, and release-readiness checks.
376+
- CodeRabbit findings are mandatory review signal when present. Vision/Heimdall must triage them as blocking, follow-up, or false positive before `verified`.
374377
- Saga is not in the default loop because this MCP has no UI.
375378
- Pipeline Monitor remains disabled unless Aymen explicitly asks for assisted merge checks; no auto-merge is allowed.

OPENCLAW-FORGE-PROTOCOL.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The core loop is:
1313
- **Vision** plans, gates, reviews, and protects the repo.
1414
- **Gilfoyle** implements one scoped issue at a time.
1515
- **Heimdall** verifies behavior, packaging, security posture, and release readiness.
16+
- **CodeRabbit** provides automated review signal that Heimdall and Vision must triage.
1617
- **Aymen** remains the final human review authority for protected merges.
1718

1819
`AGENT-EXECUTION-PIPELINE.md` remains the binding repo policy. This protocol is
@@ -27,6 +28,7 @@ the OpenClaw operating layer for applying that policy.
2728
| Supervisor | Vision (`main`) | Issue pre-flight, labels, branch protection, final review synthesis, stuck-work decisions | Yes, for protocol/config/documentation fixes | No auto-merge |
2829
| Implementer | Gilfoyle (`arch`) | Implement exactly one `agent-ready` issue, open/update one PR, run the canonical gate | Yes | No |
2930
| Verifier | Heimdall (`test`) | Independently validate PR behavior, test evidence, packaging/install smoke, security/release risks | Only test artifacts or diagnostic notes when explicitly assigned | No |
31+
| Automated reviewer | CodeRabbit | Static review comments, maintainability findings, and security-adjacent review signal | No | No |
3032
| Designer | Saga (`design`) | Not in the default loop; no UI exists | No | No |
3133
| Merger | Pipeline Monitor (`merge`) | Disabled for this repo unless Aymen explicitly asks for assisted merge checks | No | No auto-merge |
3234

@@ -47,9 +49,12 @@ flowchart TD
4749
F --> G{Canonical gate green?}
4850
G -- no --> H[Commit WORKING-NOTES.md + stop]
4951
G -- yes --> I[Gilfoyle opens PR]
52+
I --> R[CodeRabbit automated review]
5053
I --> J[Heimdall independent verification]
51-
J --> K{Verifier pass?}
52-
K -- no --> L[Heimdall labels verification-failed and comments exact failures]
54+
R --> S[Vision/Heimdall triage findings]
55+
J --> K{Verifier + review triage pass?}
56+
S --> K
57+
K -- no --> L[Heimdall or Vision labels verification-failed and comments exact failures]
5358
L --> E
5459
K -- yes --> M[Heimdall labels verified]
5560
M --> N[Vision review synthesis]
@@ -102,6 +107,8 @@ Vision also owns PR review synthesis:
102107

103108
- Check the PR diff against forbidden territory.
104109
- Compare Heimdall's verification comment with Gilfoyle's claimed evidence.
110+
- Read CodeRabbit findings and classify each as blocking, non-blocking follow-up,
111+
or false positive.
105112
- Decide whether to request changes, add `🛑 needs-human-review`, or approve
106113
for Aymen's final merge.
107114

@@ -173,11 +180,16 @@ Then add targeted checks based on touched files:
173180
| Security-sensitive parsing | Grep for unsafe APIs and confirm trust boundary documentation |
174181
| ADR/docs-only PR | Verify links, file paths, command references, and forbidden-territory claims |
175182

183+
Heimdall must also read CodeRabbit's review before applying `verified`.
184+
CodeRabbit is not authoritative, but unresolved blocking findings must prevent
185+
`verified`.
186+
176187
Heimdall comments with:
177188

178189
- Commit SHA verified.
179190
- Exact commands run.
180191
- Pass/fail result.
192+
- CodeRabbit triage summary: blocking / follow-up / false positive.
181193
- Any risk not covered by tests.
182194
- Final label action.
183195

@@ -187,7 +199,42 @@ and posts exact reproduction steps. Heimdall must not request merge.
187199

188200
---
189201

190-
## 7. Automation Mode
202+
## 7. CodeRabbit Protocol
203+
204+
CodeRabbit is part of review signal, not governance.
205+
206+
Required handling:
207+
208+
1. Wait for the CodeRabbit check or review comment when it appears on a PR.
209+
2. Read every CodeRabbit finding that applies to the current PR head.
210+
3. Classify each finding:
211+
- **Blocking:** correctness, security, public API drift, broken tests,
212+
packaging/release risk, forbidden-territory drift, or real maintainability
213+
issue inside the PR scope.
214+
- **Follow-up:** valid but outside the issue scope or not worth expanding
215+
the current PR.
216+
- **False positive:** inaccurate, contradicted by tests, or based on a
217+
misunderstanding of repo architecture.
218+
4. Blocking findings must be fixed by Gilfoyle before `verified`.
219+
5. Follow-up findings may become new issues if Vision agrees.
220+
6. False positives should be acknowledged in Heimdall or Vision's review
221+
summary so Aymen does not have to re-triage them.
222+
223+
CodeRabbit cannot:
224+
225+
- Override the canonical validation gate.
226+
- Approve a PR.
227+
- Request merge.
228+
- Bypass Code Owner review.
229+
- Expand an issue's scope.
230+
231+
If CodeRabbit is unavailable or delayed, Vision may proceed after Heimdall
232+
verification, but the PR summary must explicitly say CodeRabbit was unavailable
233+
or still pending. Do not pretend a missing review is green.
234+
235+
---
236+
237+
## 8. Automation Mode
191238

192239
Initial v0.3.0 execution should be manual-triggered, not recurring cron.
193240

@@ -215,7 +262,7 @@ stateDiagram-v2
215262

216263
---
217264

218-
## 8. First Wave
265+
## 9. First Wave
219266

220267
Start with the lowest-risk issues after the planning PR lands:
221268

@@ -230,18 +277,18 @@ the SECURITY.md prose boundary is clear.
230277

231278
---
232279

233-
## 9. Stop Conditions
280+
## 10. Stop Conditions
234281

235282
Pause the forge and remove `agent-ready` from the queue if any of these happen:
236283

237284
- A PR modifies forbidden territory without an explicit issue comment approving it.
238285
- Gilfoyle works on more than one issue in a cycle.
239286
- Heimdall verifies a different commit than the PR head.
287+
- A PR is marked `verified` while a CodeRabbit blocking finding is unresolved.
240288
- Any agent adds merge/approval language.
241289
- Any job uses Alto/Shopify/Vercel-specific assumptions.
242290
- The baseline canonical gate fails on `main`.
243291

244292
When paused, Vision writes a short incident note and fixes the protocol before
245293
new work resumes. Small pauses are cheaper than turning a public repo into a
246294
committee-authored incident report.
247-

0 commit comments

Comments
 (0)