Skip to content

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3)#160

Merged
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-96-rebase
Jul 20, 2026
Merged

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3)#160
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-96-rebase

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Summary

Adds automated recovery for bot-owned PR branches that become unmergeable after a sibling PR merges into main first:

  • New pr-rebase.sh — detects a PR whose branch has fallen behind/conflicts with main, rebases the bot branch onto main, and force-push-with-lease's the result.
  • loop-tick.sh / loop-daemon.sh / loop-event.sh wiring — the rebase step is slotted into the existing tick pipeline, participates in the same census/ceilings bookkeeping as the other recovery actions, and is exercised by the event-driven daemon loop.
  • Docs.claude/commands/pr-loop.md and .claude/self/pr-loop-self.md updated to describe the new rebase stage.
  • Testspr-rebase.test.sh (new) plus updates to loop-tick.test.sh, loop-daemon.test.sh, loop-event.test.sh, loop-census.test.sh, loop-ceilings.test.sh covering the new stage and its interaction with the existing ones.

Owner-bound decisions honored

  • Precedence order: feedback > comment-fix > ci-fix > rebase > advance. Rebase only fires once none of the higher-priority recovery actions apply.
  • --force-with-lease accepted as a deliberate, scoped policy exception, used only to force-push the bot's own branch after a rebase onto main — never touches main or any other branch.
  • Merge still requires a fresh owner re-approval after any rebase — this PR does not change or weaken that gate.

Gates

  • build / lint / test: green
  • Both review lenses (correctness, tests) approved, consensus=all, only non-blocking notes.

Closes #96

…able bot PRs (issue #96, part 3)

Adds pr-rebase.sh (detects bot PRs that went mergeable=CONFLICTING against
base, excluding feedback/comment-fix/ci-fix candidates, with a per-base-commit
anti-livelock budget of 2 attempts before escalating to needs-human) and wires
it into loop-tick.sh's verdict chain (rebase sits between ci-fix and advance),
loop-daemon.sh's transient unit naming, and loop-event.sh's driver-prompt
builder (label claude-rebasing, rebase onto base, force-push-with-lease on
clean, abort+escalate on conflict). Also threads rebase_prs into
loop-census.sh's cadence telemetry so a rebase-only backlog still ticks FAST,
and updates pr-loop.md/pr-loop-self.md's STEP 0 docs to match.
@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

26 similar comments
@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

26 similar comments
@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot

Copy link
Copy Markdown
Collaborator Author

feat(loop): rebase — automated conflict-after-sibling-merge recovery (issue #96, part 3) (not yet reviewed)

@robercano-ghbot
robercano-ghbot merged commit a32eda5 into main Jul 20, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-96-rebase branch July 20, 2026 06:10
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.

Loop: react to post-open PR events — remote CI failure fixing, review-comment convergence, conflict-after-sibling-merge

2 participants