Make pr-reviewer agent iterate to an ideal merge candidate#707
Open
aram356 wants to merge 1 commit into
Open
Conversation
The pr-reviewer agent now iterates review → implement → re-review on a stacked fix-up PR until a full pass surfaces no actionable findings, rather than producing a single read-only review. Key workflow changes: - Re-resolve the PR's current head at the start of every pass; work against origin/<headRefName> rather than a previously checked-out copy - Triage each finding twice: include in review, and implement as code - One fix-up branch / PR per review engagement, reused across passes: branch `review/<timestamp>-<pr-number>` (UTC YYYYMMDD-HHMMSS), title `<timestamp> Review fixes for #<pr-number>`, base = the PR's head - Inline comments and the review-body summary reference the fix-up PR for findings that were implemented; verdict no longer forces REQUEST_CHANGES when all wrenches are addressed in the fix-up PR - Stop conditions: no new actionable findings (ideal merge candidate), blocked on author, or user says so - Rules forbid pushing or submitting without explicit user approval, targeting `main` from a fix-up PR, or skipping --force-with-lease after a rebase Closes #706
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
pr-revieweragent to iterate review → implement → re-review on a stacked fix-up PR, rather than emit a single read-only review the author has to translate by hand.review/<timestamp>-<pr-number>) and fix-up PR title (<timestamp> Review fixes for #<pr-number>), with the same PR reused across passes.Changes
.claude/agents/pr-reviewer.md## Goalsection (ideal-merge-candidate target). Step 1 re-fetchesorigin/<headRefName>and works against it. Step 6 now collects two decisions per finding: include in review, and implement as code. New Step 7 manages the stacked fix-up branch/PR — branch and title use<timestamp>fixed at engagement start, the same PR is reused across passes (rebased onto current head + force-push-with-lease), per-pass CI gates run before push. Step 8 updates the verdict matrix (🔧 fixed in fix-up PR no longer forces REQUEST_CHANGES) and adds an inline-comment format that references the fix-up PR for implemented findings. New Step 9 documents the re-review loop and the stop conditions (no new actionable findings, blocked on author, user says so). Step 10 (Report) lists both PRs and tags implemented vs. already-fixed-upstream findings. Rules forbid pushing fix-up commits without explicit user approval, targetingmainfrom a fix-up PR, and force-pushing without--force-with-leaseafter a rebase.Closes
Closes #706
Test plan
This change is documentation-only inside
.claude/agents/— none of the CI gates exercise this file directly. The workflow was validated end-to-end on PR #621:registry.rsandmain.rsby taking the author's behavior change and re-deriving the struct refactor on top), and landed the remaining fixes in fix-up PR 20260514-172210 Review fixes for #621 #705.No code is affected; no need to run the Rust/JS gates.
cargo test --workspace— n/acargo clippy --workspace --all-targets --all-features -- -D warnings— n/acargo fmt --all -- --check— n/acd crates/js/lib && npx vitest run— n/acd crates/js/lib && npm run format— n/acd docs && npm run format— n/a (file outsidedocs/)Checklist
unwrap()in production code — n/a (docs only)tracingmacros (notprintln!) — n/a (docs only)