auto-rebase deadlock: 'review-ready' gate skips unapproved PRs but the auto-rebase:ready label is never applied (#465 gap) #711
Description
Summary
The auto-rebase eligibility gate (#465) skips any PR that isn't review-ready = non-draft AND (has a current APPROVED review OR carries the ready_label, default auto-rebase:ready). The auto-rebase:ready label half was never implemented: no workflow or dev-lead step applies it, it isn't defined in any labels.yml, and 0 of 55 currently-open org PRs carry it. So in practice the only path to eligibility is an approval.
That deadlocks the exact PRs auto-rebase exists to help — dev-lead compliance/feature PRs that fall behind before they're approved:
PR falls behind main
→ auto-rebase skips it ("not eligible under 'review-ready' (draft=false approved=false label=false)")
→ PR drifts into a merge conflict as main advances
→ pr-review-agent won't approve a conflicting / red PR
→ no approval → never eligible → never rebased ⟳ (rots indefinitely)
Evidence
Live auto-rebase run 29297648847 (bmad-bgreat-suite, 2026-07-14):
PR #205 (add/ci-failure-analyst-v2) not eligible under 'review-ready' (draft=false approved=false label=false) — skipping
PR #352 (dev-lead/issue-351-...) not eligible under 'review-ready' (draft=false approved=false label=false) — skipping
PR #345 (dev-lead/issue-322-...) not eligible under 'review-ready' (draft=false approved=false label=false) — skipping
PR #362 (dev-lead/issue-361-...) 12 behind — updating branch → merge conflict → Posting conflict resolution request ✅ (approved, eligible)
Stuck cohort (conflicting + REVIEW_REQUIRED, no activity for weeks; divergence from main):
| PR | ahead/behind | note |
|---|---|---|
| bmad-bgreat-suite#205 | 2 / 22 | last touched 2026-06-23; salvageable |
| .github#217 | 45 / 66 | heavily diverged |
| .github#292 | 92 / 106 | hopelessly diverged — recreate |
| markets#207 | — | head branch deleted (compare 404) — zombie, close |
The eligible-PR path works correctly (conflict → sentinel → dev-lead). The gap is purely that non-approved in-flight PRs never become eligible.
Fix options
A — wire up the label (recommended, matches the gate's own design):
- Define
auto-rebase:readyin the standardlabels.ymland sync it fleet-wide. - Have dev-lead apply
auto-rebase:readyto every non-draft PR it opens/manages (a PR dev-lead intends to merge is by definition review-bound). Optionally pr-review-agent adds it when it starts a review. - Result: dev-lead PRs are eligible from creation, get kept current, and reach the conflict→dev-lead handoff before divergence becomes intractable.
B — broaden the predicate: treat a non-draft PR as eligible if it is in the merge pipeline (has an open review request or an auto-rebase-conflict sentinel), not only when APPROVED. Avoids a new producer but widens fan-out.
C — escalate skipped-but-conflicting PRs: even when a PR is gate-skipped, if it is CONFLICTING still surface it once (label needs-manual-rebase / ping) so it can't rot invisibly. Complementary to A/B, not a replacement.
Recommendation: A + C — A closes the deadlock at the source; C guarantees nothing rots silently if a future gap reappears.
Acceptance
- A non-draft dev-lead PR is auto-rebase-eligible without waiting for approval.
- The stuck cohort above is triaged (salvage Implement Deepsec Org Scan #205; recreate fix: replace standalone dependency-audit.yml with org standard thin caller stub #217/fix(claude-code): wire agentic responses to trusted bot reviews and CI failures #292; close Org Status — 2026-05-08 #207).
- No regression to the Restrict auto-rebase fan-out to review-ready PRs (free, plan-independent mitigation) #465 fan-out reduction for drafts / abandoned PRs.
Related: #465 (eligibility gate), auto-rebase-reusable.yml, lib/eligibility.sh.
Activity
don-petry commentedon Jul 14, 2026
Validation + second failure mode (2026-07-14)
Applied
auto-rebase:readyto bmad-bgreat-suite#205 and dispatched auto-rebase (run 29298232627). The label fix works — #205 flipped fromnot eligible ... — skippingto:So Option A (wire up
auto-rebase:ready) demonstrably breaks the deadlock: a non-approved PR becomes eligible and reaches the conflict path.But a second failure mode surfaced on that same run:
The conflict sentinel that triggers dev-lead could not be posted — #205 has hit GitHub's ~2500-comment cap (see
lib/comments.sh, which correctly swallows the error so it can't starve other PRs). Consequence: on long-lived, heavily-churned PRs the dev-lead handoff is blocked even once the PR is eligible.Implications for the fix:
needs-manual-rebasewhen the sentinel can't post) so a capped PR surfaces to a human instead of silently no-op'ing.auto-rebase:readyat PR creation (per A) avoids this entirely for new PRs — they never accumulate 2500 comments before becoming eligible. The cap only bites PRs that were already stuck for a long time.Revised triage for #205: not salvageable via automation (comment cap + 22-behind conflict). Recommend recreate from a fresh branch (cherry-pick the 2 ahead commits) rather than resolve in place.
don-petry commentedon Jul 14, 2026
Status update — fixes shipped (2026-07-13)
Part A (label new PRs ready) — SHIPPED:
auto-rebase:ready.aw-standards-sync+aw-readme-refresh. (release-notes.shexcluded — self-repo changelog PRs that merge immediately.)Part C (surface skipped-but-conflicting PRs) — SHIPPED:
mergeable_state=dirty, post a one-time<!-- auto-rebase-stuck -->notice (idempotent, zero extra API cost, comment-cap-safe). This is the safety net for anything Part A misses (legacy PRs, comment-capped PRs).Stuck-cohort triage — resolved (all superseded, none recreated):
claude.yml(claude workflow deprecation #456).dependency-audit.ymlexists, but.github's own workflow still uses inline steps, so its 'replace standalone with org standard' goal may be partially unmet. Recommend verifying + closing or re-scoping.Remaining follow-up: standardize
auto-rebase:readyin label management (nostandards/labels.ymlexists in this repo today; the label is currently created idempotently by the producers). Low priority now that Parts A+C are in.fix(dev-lead): label opened PRs auto-rebase:ready to break the #711 r…
fix(auto-rebase): surface skipped-but-conflicting PRs instead of sile…