feat: autonomous PR feedback-iteration loop - #15
Merged
Conversation
Add pr-feedback.sh, which lists open bot-authored PRs whose latest CHANGES_REQUESTED review is newer than the bot's last <!-- claude-addressed --> marker comment (so handled feedback is not re-dispatched despite GitHub keeping reviewDecision=CHANGES_REQUESTED), skipping any PR already labeled claude-addressing. The notification cron runs it each firing and dispatches a background implementer per PR to address comments, run gates, push, and re-request review — merging stays gated on the human's approval. Pre-approve `bash .claude/scripts/pr-feedback.sh` so cron firings don't block on a permission prompt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gojq renders `null|"\(.submitted_at)\t\(.user.login)"` as the literal "null\tnull" when there are no CHANGES_REQUESTED reviews, so the empty guard never tripped and every open bot PR was flagged. Add `select(.!=null)` after `last` so the extract is truly empty when no changes were requested. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
robercano
added a commit
that referenced
this pull request
Jun 25, 2026
… loop docs Backports the missing *merge* step of the autonomous PR loop from the reDeploy instance. Complements the existing notify-poll.sh (poll) and pr-feedback.sh (address change-requests, from #15): nothing yet merged owner-approved PRs. - merge-ready.sh (new): merges every open PR the owner has APPROVED that is mergeable and CI-green, then deletes the branch. The human Approve is the only gate — the script never approves. Safety: merges only if the approval was submitted at/after the PR's last commit, so a free private repo (no branch protection to dismiss stale approvals) never auto-merges unreviewed commits. Generic: repo via git remote (or $1), approver = repo owner (or $MERGE_APPROVER), base from gates.json merge.baseBranch. Uses ambient gh auth (merging is an owner action; only PR creation uses the bot). - notify-poll.sh: adds a cursor-independent "open pr status" section (per PR: latest owner review, CI rollup, mergeable) — merge-readiness is a state, not an event. - settings.json: pre-approve merge-ready.sh. - docs/USAGE.md: document the full 3-script loop (poll → pr-feedback → merge-ready) and the serialized "advance to next issue only when no PRs open" step. - docs/GETTING_STARTED.md: note that required status checks need a paid plan on private repos; convention-based enforcement via approval+green still holds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Wires the third phase of the PR loop: Claude autonomously addresses review feedback and iterates until the human approves.
What this adds
.claude/scripts/pr-feedback.sh— prints open, bot-authored PRs with unaddressed change requests (latestCHANGES_REQUESTEDreview newer than the bot's last<!-- claude-addressed -->marker comment), skipping any PR already labeledclaude-addressing. This loop guard is deterministic and independent of GitHub leavingreviewDecision=CHANGES_REQUESTEDafter a push.bash .claude/scripts/pr-feedback.shso cron firings don't block on a permission prompt.The loop (notification cron, every 15 min)
notify-poll.sh).APPROVED + MERGEABLE + CLEAN— gated on your approval.Request changes: label itclaude-addressingand dispatch a backgroundimplementerto address comments -> run gates -> push -> post the marker comment -> re-request review. Never merges on its own.Contract notes
robercano-ghbot-authored branches.Generated with Claude Code