Skip to content

feat: autonomous PR feedback-iteration loop - #15

Merged
robercano-ghbot merged 2 commits into
mainfrom
feat/pr-feedback-loop
Jun 25, 2026
Merged

feat: autonomous PR feedback-iteration loop#15
robercano-ghbot merged 2 commits into
mainfrom
feat/pr-feedback-loop

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

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 (latest CHANGES_REQUESTED review newer than the bot's last <!-- claude-addressed --> marker comment), skipping any PR already labeled claude-addressing. This loop guard is deterministic and independent of GitHub leaving reviewDecision=CHANGES_REQUESTED after a push.
  • settings.json — pre-approves bash .claude/scripts/pr-feedback.sh so cron firings don't block on a permission prompt.

The loop (notification cron, every 15 min)

  1. Poll for activity (notify-poll.sh).
  2. Auto-merge any PR that is APPROVED + MERGEABLE + CLEAN — gated on your approval.
  3. For each bot PR with unaddressed Request changes: label it claude-addressing and dispatch a background implementer to address comments -> run gates -> push -> post the marker comment -> re-request review. Never merges on its own.

Contract notes

  • Trigger is GitHub "Request changes", not plain comments.
  • Touches only robercano-ghbot-authored branches.
  • Merging remains gated strictly on your approval.

Generated with Claude Code

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>
@robercano-ghbot robercano-ghbot self-assigned this Jun 20, 2026
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 robercano left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good!

@robercano-ghbot
robercano-ghbot merged commit 8af1a82 into main Jun 25, 2026
6 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/pr-feedback-loop branch June 25, 2026 10:18
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>
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.

2 participants