Repository navigation
Description
Problem
ProPR's auto-merge requires GitHub to report the PR as clean. A PR that is merely behind its base is skipped until something else changes it, so with several agents merging into one repository PRs stall. Where branch protection does not require up-to-date branches, two PRs that each pass alone can merge and break the base together.
Goal
Merge-queue-like behaviour for ProPR-managed auto-merge.
Acceptance criteria
- A new
auto_merge.require_up_to_dateoption in.propr/workflow.yml(default false), following the optional-key pattern (validator, schema parity, scaffold, docs). - When enabled and an auto-merge candidate passes every other gate but its head does not contain the latest base commit, ProPR updates the branch through GitHub's update-branch API (with the expected head SHA) instead of merging, and does not merge that head.
- The merge is attempted again only when CI has passed on the updated head; the existing check-run and sweep paths provide the re-evaluation.
- If the update fails because of conflicts, the existing opt-in conflict-resolution flow is used when enabled; otherwise the PR is left with a comment explaining why auto-merge is waiting.
- Updates are rate-limited per PR (no more than a configured number per hour) so a busy base branch cannot cause an update loop; per-repository updates are serialised so only the oldest eligible PR is updated at a time.
- Every decision is recorded with the existing auto-merge decision event (new reasons for "updated branch" and "waiting for CI on updated head").
- With the option off, behaviour is unchanged.
- Tests cover behind, up-to-date, conflict, rate limit, serialisation and option off.
Implementation
Key files: packages/core/src/webhook/checkRunHandler.ts (processPRAutoMerge, between the mergeable-state gate and mergePR), packages/core/src/webhook/checkRunHelpers.ts (getCiMergeReadiness, mergePR, hasActiveTasksForPR), packages/core/src/workflow/autoMergePolicy.ts (config, reasons), packages/core/src/services/autoMergeGate.ts (recordAutoMergeDecisionEvent), src/daemon/autoMergeSweep.ts, packages/core/src/webhook/mergeConflictAutoResolve.ts, packages/api/mcp/toolsPullRequests.ts (update_pull_request_branch uses the same GitHub call), docs/docs/features/repository-workflow.md. Tests: test/checkRunHandler.test.ts, test/autoMergeSweep.test.ts, packages/core/test/autoMergePolicy.test.ts. Verify with npm run test:prepare, npm run typecheck, the changed test files via node scripts/run-test-suite.mjs, and eslint --max-warnings 0 per touched package.
Activity
propr-dev commentedon Nov 11, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53447/claude-opus-5-5-update-a-behind-branch-an-20261111-2200-q3emainissue-3447-20261111-2200-claude-opus-5-5-q3e🔍 Track Task Execution