Skip to content

[3447 by Claude Opus 5.5] Update a behind branch and wait for fresh CI before auto-merging - #3450

Merged
integry merged 8 commits into
mainfrom
3447/claude-opus-5-5-update-a-behind-branch-an-20261111-2200-q3e
Nov 12, 2026
Merged

integry merged 8 commits into
mainfrom
3447/claude-opus-5-5-update-a-behind-branch-an-20261111-2200-q3e

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3447

Branch: 3447/claude-opus-5-5-update-a-behind-branch-an-20261111-2200-q3e
Commits: ✅ Changes committed (bb091a6)


AI Processing Completed

Execution Details:

Summary:
ProPR can now update a behind branch before auto-merging, and merges only after CI passes on the updated head. It's off unless a repository sets auto_merge.require_up_to_date: true. npm run test:prepare, the typechecks, zero-warning eslint (root src/, packages/core, packages/cli) and 8 related test files via node scripts/run-test-suite.mjs all pass. Nothing has run against real GitHub; all the tests use mocked GitHub and Redis.

Config (autoMergePolicy.ts)

  • New keys: require_up_to_date (boolean, default false) and max_branch_updates_per_hour (whole number 1–30, default 3). They go through the validator, the editor JSON schema (with parity test cases added), the propr init scaffold, the docs and the CHANGELOG.
  • New decision reasons: updated_branch and waiting_for_ci_updated_head, plus waiting reasons for a pending update, another PR going first, the hourly limit, a conflict, another update failure, and a failed base comparison.

Merge path (checkRunHandler.ts and a new webhook/autoMergeUpToDate.ts)

  • The mergeability gate now also lets a behind PR through, but only so its branch can be updated; a head GitHub reports as behind is never merged.
  • After the policy allows the merge, ProPR compares the head with the latest base commit:
    • Up to date: it merges as before.
    • Behind: it calls GitHub's update-branch API with the evaluated head SHA instead of merging.
  • When the updated head merges: a later green check or a sweep re-evaluates the new head. It merges only once its own CI passes and it contains the base.
  • One PR at a time: per repository, the oldest eligible PR (lowest number) holds the update turn. It gives the turn up when it merges, closes, fails CI on the updated head, reaches its hourly limit, or after an hour with no progress. A PR that has hit its limit can't hold up younger ones.
  • Conflicts: if the update fails because of conflicts, ProPR queues the existing opt-in conflict resolution (new auto_merge trigger). If that isn't enabled, it posts one comment explaining why auto-merge is waiting.
  • Recording: every decision goes through recordAutoMergeDecisionEvent, which now accepts branch_updated and waiting actions. A repeated decision for the same head and base is recorded and commented only once, so the 60-second sweep doesn't flood the timeline.

Option off

  • A behind PR is still skipped and a clean PR still merges, both without any base comparison; tests check this.
  • One difference: a behind PR now gets as far as the active-work check and the policy read before being skipped, which costs a few more GitHub reads per evaluation. I did this because the option lives in the policy file.

Tests

  • New packages/core/test/autoMergeUpToDate.test.ts (11 tests) covers up-to-date, behind, waiting for an update that hasn't landed, waiting for CI, the one-at-a-time rule, recording once, rate limiting, failed CI ending the turn, conflicts with and without auto-resolve, a head that moved, a failed base comparison and other update failures.
  • test/checkRunHandler.test.ts gets 6 end-to-end cases, including option off. I also added recordAutoMergeDecisionEvent to its mock of the gate module, because the new module imports it.
  • I didn't add a sweep test: the sweep code is unchanged and just re-evaluates through the same path.

There are no visual changes, so I made no preview files.

Detailed Logs:

  • Conversation: 205 messages
  • Session: 695dcca9-0cde-4d30-8581-5e1f80631f32

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3447-2026-11-11T22-25-42-749Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3447-2026-11-11T22-25-42-749Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: ProPR can now update a behind branch before auto-merging, and merges only after CI passes on the updated head. It's off unless a repository sets `auto_merge.require_up_to_date: true`. `npm run test:pr...


This PR was created automatically by ProPR after processing issue #3447.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…only after CI passes on the updated head. It's off unless a repository sets `auto_merge.require_up_to_date: true`. `npm run test:prepare`, the typechecks, zero-warning eslint (root `src/`, `packages/core`, `packages/cli`) and 8 related test files via `node scripts/run-test-suite.mjs` all pass. Nothing has run against real GitHub; all the tests use mocked GitHub and Redis.

Config (`autoMergePolicy.ts`)
- New keys: `require_up_to_date` (boolean, default false) and `max_branch_updates_per_hour` (whole number 1–30, default 3). They go through the validator, the editor JSON schema (with parity test cases added), the `propr init` scaffold, the docs and the CHANGELOG.
- New decision reasons: `updated_branch` and `waiting_for_ci_updated_head`, plus waiting reasons for a pending update, another PR going first, the hourly limit, a conflict, another update failure, and a failed base comparison.

Merge path (`checkRunHandler.ts` and a new `webhook/autoMergeUpToDate.ts`)
- The mergeability gate now also lets a `behind` PR through, but only so its branch can be updated; a head GitHub reports as behind is never merged.
- After the policy allows the merge, ProPR compares the head with the latest base commit:
  - Up to date: it merges as before.
  - Behind: it calls GitHub's update-branch API with the evaluated head SHA instead of merging.
- When the updated head merges: a later green check or a sweep re-evaluates the new head. It merges only once its own CI passes and it contains the base.
- One PR at a time: per repository, the oldest eligible PR (lowest number) holds the update turn. It gives the turn up when it merges, closes, fails CI on the updated head, reaches its hourly limit, or after an hour with no progress. A PR that has hit its limit can't hold up younger ones.
- Conflicts: if the update fails because of conflicts, ProPR queues the existing opt-in conflict resolution (new `auto_merge` trigger). If that isn't enabled, it posts one comment explaining why auto-merge is waiting.
- Recording: every decision goes through `recordAutoMergeDecisionEvent`, which now accepts `branch_updated` and `waiting` actions. A repeated decision for the same head and base is recorded and commented only once, so the 60-second sweep doesn't flood the timeline.

Option off
- A behind PR is still skipped and a clean PR still merges, both without any base comparison; tests check this.
- One difference: a behind PR now gets as far as the active-work check and the policy read before being skipped, which costs a few more GitHub reads per evaluation. I did this because the option lives in the policy file.

Tests
- New `packages/core/test/autoMergeUpToDate.test.ts` (11 tests) covers up-to-date, behind, waiting for an update that hasn't landed, waiting for CI, the one-at-a-time rule, recording once, rate limiting, failed CI ending the turn, conflicts with and without auto-resolve, a head that moved, a failed base comparison and other update failures.
- `test/checkRunHandler.test.ts` gets 6 end-to-end cases, including option off. I also added `recordAutoMergeDecisionEvent` to its mock of the gate module, because the new module imports it.
- I didn't add a sweep test: the sweep code is unchanged and just re-evaluates through the same path.

There are no visual changes, so I made no preview files.
@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 11, 2026
@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR adds opt-in branch updates, CI re-evaluation, throttling, and decision reporting, but needs changes before merge: native auto-merge can bypass the option, and concurrent direct merges remain uncoordinated.

✅ Configuration parity — Validation, schema, scaffold, documentation, and parser tests consistently support both new options.

✅ Head-pinned updates — Update requests include expected_head_sha, and a successful update returns without merging the evaluated head.

✅ Failure coverage — Tests cover update rejection, conflicts, rate limits, and failed-CI turn release. The supplied current-head checks report 38 passed and no failures or pending checks.

The linked issue specification is explicitly truncated; this review relies on its visible requirements and the supplied code. No commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Native auto-merge bypasses the policy

  • Required behavior: When require_up_to_date is enabled, ProPR-managed auto-merge must update a behind head and wait for its new CI before merging.

  • Evidence: packages/core/src/workflow/autoMergePolicy.ts:decideAutoMerge; packages/core/src/services/autoMergeGate.ts:gateAutoMergeArming

    1. A repository enables require_up_to_date without requiring up-to-date branches through GitHub protection.
    2. An eligible PR passes policy evaluation. decideAutoMerge returns both arm: true and upToDate.
    3. gateAutoMergeArming still returns authorization and a merge method for native GitHub auto-merge; it never consumes upToDate.
    4. GitHub can consequently merge that PR when its checks pass even if its head is behind. The new comparison and update logic runs only in ProPR’s direct merge path.

    The supplied arming contract explicitly identifies this as authorization for native auto-merge. Re-evaluation does not close the bypass: reevaluateArmedAutoMergeOnNewHead immediately returns when decision.arm remains true. static trace: the new flag reaches the policy result but changes neither native arming nor withdrawal behavior.

  • Minimum fix: For this option, retain merge intent for ProPR’s guarded path without enabling native auto-merge. Also withdraw ProPR-owned native requests when applying the option to an already armed PR, preserving independently owned requests.

F2: 🔴 Current heads bypass repository serialization

  • Required behavior: The changed behavior must prevent ProPR from merging independently tested PRs together without validating the later PR against the newly merged base.

  • Evidence: packages/core/src/webhook/autoMergeUpToDate.ts:ensureUpToDateBeforeMerge; packages/core/src/webhook/checkRunHandler.ts:headMayMerge

    1. Two eligible PRs target the same base commit, contain that commit, and have passing CI.
    2. Their evaluations overlap at the awaited comparison requests. Both comparisons return behindBy === 0 before either merge completes.
    3. Both calls return up_to_date without acquiring the repository turn; this branch actually releases any existing turn.
    4. Both handlers proceed to merge. After the first merge advances the base, the second still uses its earlier authorization and can merge without CI incorporating the first PR.

    The repository turn protects only behind-branch updates. It does not cover either current-head comparison or the subsequent merge. Pinning the PR head does not detect a changed base. This is an avoidable overlap between ProPR’s own operations, distinct from a maintainer independently changing the base. static trace: the zero-behind return precedes claimTurn, and the handler performs the merge after the gate returns. Existing tests exercise these outcomes sequentially.

  • Minimum fix: Serialize ProPR’s comparison-through-merge operation per repository, including already-current heads. Acquire ownership before comparing and retain it until the merge attempt finishes; the next candidate must compare against the resulting base.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise stalled CI expiry

The pending-CI path refreshes the turn every time it is observed, whereas the documentation describes expiry after an hour without progress. A clock-controlled test with recurring sweep observations would clarify the intended behavior for a permanently pending check. This is an optional operational follow-up rather than an additional blocker under the visible acceptance criteria.

Score

The configuration and sequential update paths are well covered, and current checks are green. Two gaps in enforcement prevent the advertised merge safety from holding across the supported paths.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 14s
  • Tokens: 63,205 (61,466 in / 1,739 out)
  • Cost: $0.59

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit ecde9b6

Addressed 1 AI review comment (IDs: 6808926565)

Addressed findings F1, F2

Summary of Changes

I fixed both findings. GitHub's own auto-merge is no longer turned on when require_up_to_date is set (F1). ProPR's base comparison and merge now run one at a time per repository, including for PRs that are already up to date (F2). The 11 related test files pass. Typecheck is clean for root and packages/core, eslint --max-warnings 0 is clean on packages/core and the two changed root files, and core was rebuilt. Nothing has run against real GitHub; the tests mock GitHub and Redis.

F1: GitHub's auto-merge bypassed the option

  • Arming: when the option is on, gateAutoMergeArming still allows the merge but returns a new directMergeOnly: true and no merge method. Both places that turned on GitHub's auto-merge now check for it:
    • issueJobPostProcessingHelpers.ts: it doesn't turn it on and leaves the merge to check events and the sweep.
    • ultrafixLoopGithub.ts: it doesn't turn it on and goes straight to ProPR's own merge path, since CI has usually finished by then.
  • Requests already on a PR: a new withdrawNativeAutoMergeForUpToDate turns off a GitHub auto-merge request that ProPR itself set up. It re-reads ownership just before turning it off, records an event and posts one comment. It runs in three places:
    • at arming time.
    • when the PR gets new commits or a new base (reevaluateArmedAutoMergeOnNewHead).
    • in the check-run and sweep merge path, which catches a repository that enables the option after a PR was already armed.
  • Requests set up by a person or another App are left alone.

F2: two current PRs could merge together

  • A new mergeWhenUpToDate in autoMergeUpToDate.ts takes a per-repository Redis lock before comparing the PR with its base and holds it until the merge attempt finishes, even if the merge throws.
  • A second PR that finds the lock taken records a "serialized" waiting decision and doesn't compare. Its next check event or sweep compares it against the base the first merge produced, so it gets its branch updated instead of merged.
  • Only ProPR's own lock is released, and an abandoned lock expires after 5 minutes. With the option off, the merge path behaves as before and takes no lock.

New tests

  • New file packages/core/test/autoMergeGateUpToDate.test.ts: no merge method under the option; ProPR's request withdrawn at arming time and on new commits; requests from others kept, including one taken over by a maintainer during evaluation.
  • In autoMergeUpToDate.test.ts: the reported overlap reproduced (PR 8 checked while PR 7's comparison is still waiting on GitHub), plus a test that a failed merge releases the lock and that a PR never releases another's lock.
  • In checkRunHandler.test.ts: the merge runs while holding the lock; a PR waits without comparing when another holds it; withdrawal happens on the check-merge path.
  • The two caller test files check that GitHub's auto-merge isn't turned on.

I also updated the docs (repository-workflow.md) and the CHANGELOG entry.

Limits of the fix (not changed):

  • A GitHub auto-merge request set up by a person or another App can still merge a PR that is behind. That follows the finding's "preserve independently owned requests".
  • If GitHub's auto-merge fires before ProPR next looks at an already-armed PR, ProPR can't stop it. That's a race with GitHub, so I didn't try to make it atomic.
  • Merges that don't go through ProPR's auto-merge path, such as a person merging by hand or the MCP merge tool, don't take the lock.
  • The lock release is a read followed by a delete, not one atomic step. It only matters if the 5-minute expiry passes at exactly that moment.
  • At arming time the timeline still says "Auto-merge armed" under the option, even though GitHub's auto-merge isn't turned on; the withdrawal events carry an explanatory detail.

No visual changes, so there are no previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 11m 8s
  • Tokens: 4,323,942 (4,287,115 in / 36,827 out)
  • Cost: $2.26

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… turned on when `require_up_to_date` is set (F1). ProPR's base comparison and merge now run one at a time per repository, including for PRs that are already up to date (F2). The 11 related test files pass. Typecheck is clean for root and `packages/core`, `eslint --max-warnings 0` is clean on `packages/core` and the two changed root files, and core was rebuilt. Nothing has run against real GitHub; the tests mock GitHub and Redis.

I fixed both findings. GitHub's own auto-merge is no longer turned on when `require_up_to_date` is set (F1). ProPR's base comparison and merge now run one at a time per repository, including for PRs that are already up to date (F2). The 11 related test files pass. Typecheck is clean for root and `packages/core`, `eslint --max-warnings 0` is clean on `packages/core` and the two changed root files, and core was rebuilt. Nothing has run against real GitHub; the tests mock GitHub and Redis.

**F1: GitHub's auto-merge bypassed the option**
- **Arming:** when the option is on, `gateAutoMergeArming` still allows the merge but returns a new `directMergeOnly: true` and no merge method. Both places that turned on GitHub's auto-merge now check for it:
  - `issueJobPostProcessingHelpers.ts`: it doesn't turn it on and leaves the merge to check events and the sweep.
  - `ultrafixLoopGithub.ts`: it doesn't turn it on and goes straight to ProPR's own merge path, since CI has usually finished by then.
- **Requests already on a PR:** a new `withdrawNativeAutoMergeForUpToDate` turns off a GitHub auto-merge request that ProPR itself set up. It re-reads ownership just before turning it off, records an event and posts one comment. It runs in three places:
  - at arming time.
  - when the PR gets new commits or a new base (`reevaluateArmedAutoMergeOnNewHead`).
  - in the check-run and sweep merge path, which catches a repository that enables the option after a PR was already armed.
- **Requests set up by a person or another App** are left alone.

**F2: two current PRs could merge together**
- A new `mergeWhenUpToDate` in `autoMergeUpToDate.ts` takes a per-repository Redis lock before comparing the PR with its base and holds it until the merge attempt finishes, even if the merge throws.
- A second PR that finds the lock taken records a "serialized" waiting decision and doesn't compare. Its next check event or sweep compares it against the base the first merge produced, so it gets its branch updated instead of merged.
- Only ProPR's own lock is released, and an abandoned lock expires after 5 minutes. With the option off, the merge path behaves as before and takes no lock.

**New tests**
- New file `packages/core/test/autoMergeGateUpToDate.test.ts`: no merge method under the option; ProPR's request withdrawn at arming time and on new commits; requests from others kept, including one taken over by a maintainer during evaluation.
- In `autoMergeUpToDate.test.ts`: the reported overlap reproduced (PR 8 checked while PR 7's comparison is still waiting on GitHub), plus a test that a failed merge releases the lock and that a PR never releases another's lock.
- In `checkRunHandler.test.ts`: the merge runs while holding the lock; a PR waits without comparing when another holds it; withdrawal happens on the check-merge path.
- The two caller test files check that GitHub's auto-merge isn't turned on.

I also updated the docs (`repository-workflow.md`) and the CHANGELOG entry.

**Limits of the fix (not changed):**
- A GitHub auto-merge request set up by a person or another App can still merge a PR that is behind. That follows the finding's "preserve independently owned requests".
- If GitHub's auto-merge fires before ProPR next looks at an already-armed PR, ProPR can't stop it. That's a race with GitHub, so I didn't try to make it atomic.
- Merges that don't go through ProPR's auto-merge path, such as a person merging by hand or the MCP merge tool, don't take the lock.
- The lock release is a read followed by a delete, not one atomic step. It only matters if the 5-minute expiry passes at exactly that moment.
- At arming time the timeline still says "Auto-merge armed" under the option, even though GitHub's auto-merge isn't turned on; the withdrawal events carry an explanatory detail.

No visual changes, so there are no previews.

PR: #3450
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds branch updates, per-repository serialization, and policy-controlled direct merging, but needs changes before merge.

✅ Configuration parity — The validator, schema, scaffold, documentation, and policy tests consistently expose both new options.

✅ Head-pinned updates — Branch updates pass expected_head_sha, and successful update requests return without merging the evaluated head.

The linked issue excerpt is truncated; this review assesses the visible requirements and supplied code. Current checks show 12 pending, 0 failed, 0 passed, and 9 neutral/skipped.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F3: 🔴 Withdraw native auto-merge before CI gating

  • Required behavior: With require_up_to_date enabled, ProPR-owned auto-merge must not merge a behind head through GitHub’s native auto-merge.

  • Evidence: packages/core/src/webhook/checkRunHandler.ts:processPRAutoMerge — native withdrawal occurs after the CI readiness return.

    1. ProPR previously armed native auto-merge on a PR whose CI remains pending.
    2. The base branch enables require_up_to_date and advances beyond that PR’s head; branch protection does not require an up-to-date branch.
    3. The sweep evaluates the PR while CI is pending. getCiMergeReadiness returns not ready, so execution returns before policy evaluation and native withdrawal.
    4. CI finishes successfully, allowing GitHub’s still-armed native request to merge the behind head without ProPR’s comparison or branch update.

    The repository merge lock only protects ProPR’s direct merge path. The new-head withdrawal handler does not cover this sequence because the PR head did not change. This leaves an avoidable window across every pending-CI sweep, independently of the residual race when CI finishes during withdrawal. static trace: the supplied handler ordering and new-head event conditions establish this sequence.

  • Minimum fix: Evaluate whether native withdrawal is needed and withdraw ProPR-owned requests before returning for pending CI or other merge-only gates. Keep branch updates and direct merging behind all existing readiness gates.

F4: 🔴 Stop renewing turns without progress

  • Required behavior: The new update queue must release a stalled turn after an hour without progress, as documented, so one PR cannot indefinitely prevent other behind PRs from updating.

  • Evidence: packages/core/src/webhook/autoMergeUpToDate.ts:noteCiWaitAfterBranchUpdate — every pending-CI observation renews the turn for another hour.

    1. PR A receives a successful branch update and holds the repository turn.
    2. Its updated head has a blocking check that remains pending.
    3. The minute-by-minute sweep calls noteCiWaitAfterBranchUpdate; checksFailed remains false, and each call refreshes UPDATE_TURN_TTL_SECONDS.
    4. PR B passes its other gates but is behind. claimTurn repeatedly sees A’s live turn and refuses B, even after hours without any progress on A.

    Decision deduplication does not prevent renewal: expiry is refreshed before recording the repeated decision. No elapsed-progress bound exists, so routine polling itself prevents the advertised timeout. static trace: the supplied sweep cadence, pending-CI path, renewal, and turn refusal establish indefinite blocking while A remains pending.

  • Minimum fix: Bound turn ownership using actual progress timestamps or an absolute deadline. Repeated observations of the same pending head must not extend ownership indefinitely; after expiry, allow another eligible PR to update.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Exercise merge ownership expiry

The fake Redis explicitly does not simulate TTLs. Add coverage for ownership expiry during comparison and takeover before the merge callback, including atomic owner-checked release. This would strengthen confidence in the serialization guarantee; the supplied context does not establish a production timing sequence sufficient to classify this separately as a blocker.

Score

The configuration and normal-path coverage are strong, but native auto-merge can bypass the new policy and stalled CI can indefinitely block branch updates. Current CI remains pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 3m 0s
  • Tokens: 73,604 (72,268 in / 1,336 out)
  • Cost: $0.68

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F3 F4 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit ad02a4f

Addressed 1 AI review comment (IDs: 6809213665)

Addressed findings F3, F4

Summary of Changes

I fixed F3 and F4. The new tests fail on the old code and pass with the fixes. Nothing has run against real GitHub; the tests mock GitHub and Redis.

F3: native auto-merge is now withdrawn before ProPR's own gates can return early

  • When GitHub reports native auto-merge as armed on an open, non-draft PR, processPRAutoMerge (packages/core/src/webhook/checkRunHandler.ts) now runs a new helper before the label/Ultrafix, head-match, CI and mergeability checks and the active-work check.
  • The helper, withdrawNativeAutoMergeIfUpToDateRequired (packages/core/src/services/autoMergeGate.ts), checks the base branch's policy. If the merge is allowed only with require_up_to_date, it withdraws the native request. As before, only a request ProPR armed is withdrawn; ownership is re-read just before withdrawing, and the helper never throws.
  • So a sweep that sees pending CI now withdraws the native request instead of returning and leaving it armed. Branch updates and direct merges still sit behind every existing gate.
  • To avoid checking the policy on every sweep, PRAutoMergeInfo now has an autoMergeArmed flag, read from the PR data ProPR already fetches. The policy is only checked when that flag is set.
  • The later withdrawal after the policy check is kept, for a request armed between the two reads.
  • One race can't be avoided: CI finishing while the withdrawal request is in flight.

F4: waiting for CI no longer keeps a PR's update turn alive

  • In packages/core/src/webhook/autoMergeUpToDate.ts, noteCiWaitAfterBranchUpdate and the "already holds the turn" branch of claimTurn no longer extend the turn's expiry.
  • Only a successful branch update by the PR holding the turn extends it, and only if that PR still holds it. A turn that already expired, and may have passed to another PR, is not taken back.
  • A PR whose updated head stays pending therefore loses the turn an hour after its last update, and the next eligible PR can be updated. This now matches the documented "an hour passes without progress".

New tests

  • packages/core/test/autoMergeUpToDate.test.ts: the fake Redis can now expire keys against the test clock (only the new tests turn this on). One test simulates a minute-by-minute sweep: PR 10 waits while PR 5's head is pending and gets updated once the hour is up. Another checks that a second branch update by the holder extends its turn by an hour.
  • packages/core/test/autoMergeGateUpToDate.test.ts: the new helper withdraws a request ProPR armed under require_up_to_date. It leaves alone a policy without the option, a request a maintainer armed, and a PR the policy won't merge.
  • test/checkRunHandler.test.ts: pending CI and a non-clean mergeable state each still withdraw the native request, with no branch update or merge. Nothing is withdrawn without the option, and the policy isn't checked when no request is armed. The module mock now includes the new export.

Checks run

  • The two core test files pass (22/22).
  • The four root files pass via scripts/run-test-suite.mjs (checkRunHandler, taskIntentWithdrawal, ultrafixAutoMergeFallback, submissionPrUltrafix).
  • tsc --noEmit is clean for root and packages/core. Zero-warning eslint is clean on the four changed core source files; I tightened one import to keep checkRunHandler.ts under the 400-line limit.
  • Core was rebuilt.

There is no visual change, so I made no preview.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 10m 19s
  • Tokens: 2,718,446 (2,698,400 in / 20,046 out)
  • Cost: $1.47
  • Subscription usage: Weekly +1%, Fable +2%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ass with the fixes. Nothing has run against real GitHub; the tests mock GitHub and Redis.

I fixed F3 and F4. The new tests fail on the old code and pass with the fixes. Nothing has run against real GitHub; the tests mock GitHub and Redis.

**F3: native auto-merge is now withdrawn before ProPR's own gates can return early**
- When GitHub reports native auto-merge as armed on an open, non-draft PR, `processPRAutoMerge` (`packages/core/src/webhook/checkRunHandler.ts`) now runs a new helper before the label/Ultrafix, head-match, CI and mergeability checks and the active-work check.
- The helper, `withdrawNativeAutoMergeIfUpToDateRequired` (`packages/core/src/services/autoMergeGate.ts`), checks the base branch's policy. If the merge is allowed only with `require_up_to_date`, it withdraws the native request. As before, only a request ProPR armed is withdrawn; ownership is re-read just before withdrawing, and the helper never throws.
- So a sweep that sees pending CI now withdraws the native request instead of returning and leaving it armed. Branch updates and direct merges still sit behind every existing gate.
- To avoid checking the policy on every sweep, `PRAutoMergeInfo` now has an `autoMergeArmed` flag, read from the PR data ProPR already fetches. The policy is only checked when that flag is set.
- The later withdrawal after the policy check is kept, for a request armed between the two reads.
- One race can't be avoided: CI finishing while the withdrawal request is in flight.

**F4: waiting for CI no longer keeps a PR's update turn alive**
- In `packages/core/src/webhook/autoMergeUpToDate.ts`, `noteCiWaitAfterBranchUpdate` and the "already holds the turn" branch of `claimTurn` no longer extend the turn's expiry.
- Only a successful branch update by the PR holding the turn extends it, and only if that PR still holds it. A turn that already expired, and may have passed to another PR, is not taken back.
- A PR whose updated head stays pending therefore loses the turn an hour after its last update, and the next eligible PR can be updated. This now matches the documented "an hour passes without progress".

**New tests**
- `packages/core/test/autoMergeUpToDate.test.ts`: the fake Redis can now expire keys against the test clock (only the new tests turn this on). One test simulates a minute-by-minute sweep: PR 10 waits while PR 5's head is pending and gets updated once the hour is up. Another checks that a second branch update by the holder extends its turn by an hour.
- `packages/core/test/autoMergeGateUpToDate.test.ts`: the new helper withdraws a request ProPR armed under `require_up_to_date`. It leaves alone a policy without the option, a request a maintainer armed, and a PR the policy won't merge.
- `test/checkRunHandler.test.ts`: pending CI and a non-clean mergeable state each still withdraw the native request, with no branch update or merge. Nothing is withdrawn without the option, and the policy isn't checked when no request is armed. The module mock now includes the new export.

**Checks run**
- The two core test files pass (22/22).
- The four root files pass via `scripts/run-test-suite.mjs` (`checkRunHandler`, `taskIntentWithdrawal`, `ultrafixAutoMergeFallback`, `submissionPrUltrafix`).
- `tsc --noEmit` is clean for root and `packages/core`. Zero-warning eslint is clean on the four changed core source files; I tightened one import to keep `checkRunHandler.ts` under the 400-line limit.
- Core was rebuilt.

There is no visual change, so I made no preview.

PR: #3450
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements branch updates, fresh-head reevaluation, rate limits, and repository-level serialization. It needs changes before merge because waiting candidates can lose their retry path, and merge ownership can expire without stopping its holder.

✅ Configuration parity — Runtime validation, editor schema, scaffold, and documentation consistently expose both new options.

✅ Head-pinned updates — Branch updates pass expected_head_sha, and successful updates return without merging the evaluated head.

✅ Focused coverage — Added tests exercise rate limits, native auto-merge withdrawal, conflict responses, and overlapping merge attempts.

The supplied issue excerpt is truncated; this review relies on its visible requirements and the complete supplied diff. Current checks show 36 passed, one pending, and no failures. No commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F5: 🔴 Waiting candidates can lose all retries

  • Required behavior: Candidates deferred by the new serialization must remain eligible for eventual reevaluation and auto-merge.

  • Evidence: packages/core/src/webhook/autoMergeUpToDate.ts, claimTurn and mergeWhenUpToDate.

    1. Two labelled PRs pass the merge gates with require_up_to_date enabled. PR B has no linked plan_issues row; the check-event merge path does not require one.
    2. PR A holds the repository update turn or comparison-through-merge ownership when B's final successful CI event is processed.
    3. B records waiting_branch_update_serialized and returns without updating its branch or scheduling another evaluation.
    4. A finishes. B receives no further check events, and loadAutoMergeSweepCandidates selects only linked plan PRs, so it never selects B.

    B remains open indefinitely despite passing its gates. The eligible sorted set does not schedule work, and expiration of the ownership or turn key does not wake B. static trace: the new waiting returns and the supplied sweep query establish this sequence. proposed regression: defer a non-plan PR on its last check event, release the holder, and verify automatic reevaluation without another webhook.

  • Minimum fix: Persist and retry candidates deferred by this feature, including non-plan PRs, or enqueue a delayed reevaluation through the existing guarded merge path.

F6: 🔴 Expired ownership still permits merging

  • Required behavior: Comparison through merge must remain serialized so two candidates cannot merge based on the same base commit.

  • Evidence: packages/core/src/webhook/autoMergeUpToDate.ts, MERGE_OWNERSHIP_TTL_SECONDS and mergeWhenUpToDate; packages/core/src/webhook/checkRunHandler.ts, mergeEvaluatedHead.

    1. PR A acquires the five-minute ownership key and compares successfully against base commit X.
    2. A is interrupted after that comparison—for example, while awaiting resolveDirectMergeMethod—and remains suspended beyond the key's expiration. This ownership has no renewal mechanism.
    3. Another worker evaluates PR B, acquires the now-absent key, compares against X, and merges B, advancing the base.
    4. A resumes and invokes its merge using the earlier comparison. Neither mergeWhenUpToDate nor its merge callback checks whether A still owns the key.

    A can merge without CI incorporating B's changes. The expected head SHA protects A's head, which has not changed; it does not protect the base. The token comparison in finally only controls cleanup after the merge. static trace: the fixed expiration, absence of renewal or ownership-loss handling, and unconditional callback establish the failure. proposed regression: expire A's ownership after comparison, let B merge, then resume A and assert that A does not merge.

  • Minimum fix: Maintain ownership throughout comparison and merge, abort the merge path when ownership is lost, and use atomic token-checked renewal and release. A resumed attempt must reacquire ownership and compare again before merging.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Clarify decision deduplication scope

recordDecision stores only the latest fingerprint. Alternating reasons can therefore repeat an earlier event or conflict comment for the same head and base, despite the documentation promising “at most once.” Consider retaining fingerprints independently or narrowing that wording. This is an observability improvement rather than a merge-safety blocker.

Score

The configuration and normal-path tests are thorough, but retry coverage and ownership lifetime leave correctness gaps in the new queue behavior. The remaining pending check is not itself a blocker.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 1s
  • Tokens: 75,541 (74,002 in / 1,539 out)
  • Cost: $0.71

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F5 F6 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit d789c32

Addressed 1 AI review comment (IDs: 6809772720)

Addressed findings F5, F6

Summary of Changes

I fixed F5 and F6. The new tests fail on the old code and pass with the fixes. Nothing has run against real GitHub or Redis; the tests mock both.

F5 — deferred PRs could lose all retries. Every time require_up_to_date makes a PR wait, ProPR now records it for retry in Redis. That covers waiting for another PR's turn or merge, a pending or just-made branch update, the rate limit, an unavailable base comparison, a failed update, and a head that moved. The new code is in packages/core/src/webhook/autoMergeUpToDateRetry.ts.

  • The auto-merge sweep (src/daemon/autoMergeSweep.ts) now re-checks these PRs as well as plan PRs, about once a minute, through the same guarded merge path. PR B from the finding gets re-checked even if it has no plan row and gets no further webhook.
  • A PR leaves the retry list only after a successful re-check that didn't make it wait again. If the re-check throws, the PR stays on the list. An entry that hasn't been refreshed for 24 hours is dropped.
  • Merge conflicts are not retried: nothing can change until someone pushes, and that push brings its own CI events.

F6 — expired ownership still let a PR merge.

  • Atomic renew and release: both now run as Redis scripts that check the owner's token, so a PR can't renew or release another PR's ownership.
  • Renewal while working: the owner renews its ownership every 100 seconds (a third of the five-minute expiry) while the comparison and merge run.
  • Check just before merging: ProPR checks ownership once after the comparison and again in performMergeAndPostActions immediately before mergePR. That puts the check after every await on the way to the merge, including resolveDirectMergeMethod. If the Redis call fails, ProPR assumes ownership is lost and doesn't merge.
  • A PR that lost ownership: it doesn't merge. ProPR records a waiting decision ("the merge ownership expired before the merge; comparing again with the latest base") and adds the PR to the retry list. The retry takes ownership again and compares against the new base.
  • Unavoidable race: a short gap remains between the last ownership check and GitHub actually processing the merge request; Redis and GitHub can't be locked together. Because the check resets the expiry to five minutes, the ownership would only lapse if the process stalled for longer than that between the Redis reply and GitHub receiving the request.

Tests and checks:

  • F5 regression: a PR that isn't in a plan is made to wait on its last check event; after the holder finishes, the retry updates and then merges it with no new webhook.
  • F6 regression: PR A's ownership expires after its comparison, PR B merges, and when A resumes it doesn't merge; its retry updates the branch instead.
  • Other new tests: live renewal, a PR that found the ownership taken, conflicts left out of the retry list with 24-hour cleanup, de-duplication and settling in the sweep, and a check-run test where ownership is lost while resolving the merge method.
  • Results: typecheck is clean for root and packages/core. Zero-warning eslint is clean on the changed files, after I moved the retry code into its own module and trimmed checkRunHandler.ts to fit the 400-line limit. I rebuilt core. Seven related test files pass: 74 tests in core, and 2 + 135 + 4 + 7 at the root.

I also updated the docs page docs/docs/features/repository-workflow.md and the CHANGELOG to describe the retry and ownership behaviour. I found no other problems outside F5 and F6.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 10m 53s
  • Tokens: 2,986,932 (2,950,203 in / 36,729 out)
  • Cost: $1.86

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ass with the fixes. Nothing has run against real GitHub or Redis; the tests mock both.

I fixed F5 and F6. The new tests fail on the old code and pass with the fixes. Nothing has run against real GitHub or Redis; the tests mock both.

**F5 — deferred PRs could lose all retries.** Every time `require_up_to_date` makes a PR wait, ProPR now records it for retry in Redis. That covers waiting for another PR's turn or merge, a pending or just-made branch update, the rate limit, an unavailable base comparison, a failed update, and a head that moved. The new code is in `packages/core/src/webhook/autoMergeUpToDateRetry.ts`.
- The auto-merge sweep (`src/daemon/autoMergeSweep.ts`) now re-checks these PRs as well as plan PRs, about once a minute, through the same guarded merge path. PR B from the finding gets re-checked even if it has no plan row and gets no further webhook.
- A PR leaves the retry list only after a successful re-check that didn't make it wait again. If the re-check throws, the PR stays on the list. An entry that hasn't been refreshed for 24 hours is dropped.
- Merge conflicts are not retried: nothing can change until someone pushes, and that push brings its own CI events.

**F6 — expired ownership still let a PR merge.**
- **Atomic renew and release:** both now run as Redis scripts that check the owner's token, so a PR can't renew or release another PR's ownership.
- **Renewal while working:** the owner renews its ownership every 100 seconds (a third of the five-minute expiry) while the comparison and merge run.
- **Check just before merging:** ProPR checks ownership once after the comparison and again in `performMergeAndPostActions` immediately before `mergePR`. That puts the check after every await on the way to the merge, including `resolveDirectMergeMethod`. If the Redis call fails, ProPR assumes ownership is lost and doesn't merge.
- **A PR that lost ownership:** it doesn't merge. ProPR records a waiting decision ("the merge ownership expired before the merge; comparing again with the latest base") and adds the PR to the retry list. The retry takes ownership again and compares against the new base.
- **Unavoidable race:** a short gap remains between the last ownership check and GitHub actually processing the merge request; Redis and GitHub can't be locked together. Because the check resets the expiry to five minutes, the ownership would only lapse if the process stalled for longer than that between the Redis reply and GitHub receiving the request.

**Tests and checks:**
- **F5 regression:** a PR that isn't in a plan is made to wait on its last check event; after the holder finishes, the retry updates and then merges it with no new webhook.
- **F6 regression:** PR A's ownership expires after its comparison, PR B merges, and when A resumes it doesn't merge; its retry updates the branch instead.
- **Other new tests:** live renewal, a PR that found the ownership taken, conflicts left out of the retry list with 24-hour cleanup, de-duplication and settling in the sweep, and a check-run test where ownership is lost while resolving the merge method.
- **Results:** typecheck is clean for root and `packages/core`. Zero-warning eslint is clean on the changed files, after I moved the retry code into its own module and trimmed `checkRunHandler.ts` to fit the 400-line limit. I rebuilt core. Seven related test files pass: 74 tests in core, and 2 + 135 + 4 + 7 at the root.

I also updated the docs page `docs/docs/features/repository-workflow.md` and the CHANGELOG to describe the retry and ownership behaviour. I found no other problems outside F5 and F6.

PR: #3450
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds opt-in branch updates, serialized merge attempts, and deferred retries. It needs a localized correctness fix before merging: the sweep can discard a retry obligation without resolving it.

✅ Configuration parity — Validation, editor schema, scaffold, and documentation consistently expose both new options.

✅ Guarded merge execution — Updates use the evaluated head SHA; merge ownership is renewed and checked immediately before merging.

✅ Focused coverage — Added tests cover serialization, rate limits, ownership takeover, and native auto-merge withdrawal. Current checks report 38 passed and no failures or pending checks.

The supplied issue specification is explicitly truncated; this review assesses its visible requirements and the changed implementation.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F7: 🔴 Preserve retries across inconclusive evaluations

  • Required behavior: Deferred candidates must remain recoverable through the sweep when no further check event arrives, including PRs outside a plan.

  • Evidence: src/daemon/autoMergeSweep.ts, sweepAutoMergeCandidates; packages/core/src/webhook/checkRunHandler.ts, processPRAutoMerge.

    1. A green, non-plan PR encounters another PR's merge ownership. mergeWhenUpToDate records it in the deferred set.
    2. The sweep loads that entry and reevaluates it. CI readiness returns ready: false with reason unavailable, a condition explicitly handled by processPRAutoMerge.
    3. That branch returns normally without refreshing the deferred entry. The sweep treats normal completion as settlement and removes the entry.
    4. CI access recovers, but the unchanged head produces no further check event. The PR is outside the plan candidate list and no longer appears in deferred candidates, so automatic merging stalls indefinitely.

    The timestamp comparison protects entries that were deferred again; this early-return path never refreshes them. The sweep's exception handler also cannot help because unavailable CI produces a normal return. Other inconclusive early returns, including temporarily unknown mergeability, have the same settlement problem.

    static trace: traced the explicit CI-unavailable return through unconditional settlement after reevaluate. Existing sweep tests distinguish thrown errors from successful returns but do not distinguish an inconclusive evaluation from a resolved obligation.

  • Minimum fix: Return an explicit evaluation outcome and retain deferred entries for unavailable CI and other transient gates. Settle only after a confirmed terminal or otherwise resolved outcome. Add a regression covering a non-plan deferred PR whose first sweep encounters unavailable CI and whose next sweep succeeds without another webhook.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The implementation has substantial focused coverage and passing current checks, but premature retry settlement undermines the recovery behavior central to this change.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 1s
  • Tokens: 76,424 (75,302 in / 1,122 out)
  • Cost: $0.68

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F7

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 5af870b

Addressed 1 AI review comment (IDs: 6810382588)

Addressed finding F7

Summary of Changes

I fixed F7. A PR that's waiting in the retry list is now only removed once an evaluation actually settles it. If an evaluation can't decide, the PR stays on the list and the next sweep tries it again.

What changed

  • reevaluatePRAutoMerge and processPRAutoMerge now return 'resolved' or 'inconclusive' instead of nothing. The sweep (src/daemon/autoMergeSweep.ts) removes a waiting PR only on 'resolved'. Thrown errors still keep it, as before.
  • The sorting rules live in a new file, packages/core/src/webhook/autoMergeEvaluation.ts, because checkRunHandler.ts was already at the 400-line lint limit.
    • Resolved: the PR merged, closed, is a draft, has no label, has a failed Ultrafix run, has failing or still-running checks (those produce their own check event), or the policy turned it down on purpose.
    • Inconclusive: CI couldn't be read; CI hasn't registered yet (this includes a repository with no CI that is still in its grace period); GitHub hasn't worked out mergeability yet; the PR or its head couldn't be read; the head moved; other work or Ultrafix is still running on the PR; the policy file or diff couldn't be read; or the merge was skipped, refused, failed or put off.
  • Same bug in two shared helpers: both treated a failed read as a real answer, which would also have dropped a PR from the list. getPRAutoMergeInfo now marks a failed PR read as unavailable. The new readLinkedIssueAutoMergeLabel returns null when the linked issue can't be read, so "no label" and "couldn't read the label" are no longer the same. linkedIssueHasAutoMergeLabel and shouldAutoMergePR still return the same booleans as before.
  • performMergeAndPostActions now reports whether the merge happened, so only a real merge counts as resolved.
  • The require_up_to_date docs page now explains when a PR stays on the retry list and that it's dropped after a day without being added again.

Tests

  • test/checkRunHandler.test.ts gets the regression the finding asked for. A green PR that isn't part of a plan is put on the retry list because another PR holds the merge lock. The first sweep finds CI unavailable, and in a second version mergeability not computed yet. The second sweep, with no webhook in between, merges it and removes it from the list. This runs the real sweep and the real Redis retry functions; GitHub and Redis are mocked. Other cases check that a failed check and a closed PR count as resolved, and that an unreadable PR or linked issue counts as inconclusive.
  • test/autoMergeSweep.test.ts gets a sweep-only version of the same two-sweep scenario.
  • With the previous source files swapped back in, all the new tests fail. The two-sweep tests fail on "the inconclusive evaluation keeps the retry entry", which is the reported bug.

Checks: typecheck is clean for root and packages/core, and eslint --max-warnings 0 is clean on the changed files. Core was rebuilt. The 13 related test files pass via node scripts/run-test-suite.mjs. test/taskIntentWithdrawal.test.ts used 81% of its 180s timeout. Nothing has run against real GitHub or Redis.

Not changed: a PR held back by a merge-blocking state such as blocked or dirty still counts as resolved. It waits for a review or a push, and either one produces its own event. A policy file that is truly invalid can't be told apart from one that couldn't be read, so both are inconclusive. Such a PR is re-checked about once a minute for up to the existing one-day limit; these checks don't post comments.

There are no previews because nothing visible changed.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 15m 40s
  • Tokens: 5,502,547 (5,458,515 in / 44,032 out)
  • Cost: $2.63
  • Subscription usage: Weekly +1%, Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ly removed once an evaluation actually settles it. If an evaluation can't decide, the PR stays on the list and the next sweep tries it again.

I fixed F7. A PR that's waiting in the retry list is now only removed once an evaluation actually settles it. If an evaluation can't decide, the PR stays on the list and the next sweep tries it again.

**What changed**
- `reevaluatePRAutoMerge` and `processPRAutoMerge` now return `'resolved'` or `'inconclusive'` instead of nothing. The sweep (`src/daemon/autoMergeSweep.ts`) removes a waiting PR only on `'resolved'`. Thrown errors still keep it, as before.
- The sorting rules live in a new file, `packages/core/src/webhook/autoMergeEvaluation.ts`, because `checkRunHandler.ts` was already at the 400-line lint limit.
  - **Resolved:** the PR merged, closed, is a draft, has no label, has a failed Ultrafix run, has failing or still-running checks (those produce their own check event), or the policy turned it down on purpose.
  - **Inconclusive:** CI couldn't be read; CI hasn't registered yet (this includes a repository with no CI that is still in its grace period); GitHub hasn't worked out mergeability yet; the PR or its head couldn't be read; the head moved; other work or Ultrafix is still running on the PR; the policy file or diff couldn't be read; or the merge was skipped, refused, failed or put off.
- **Same bug in two shared helpers:** both treated a failed read as a real answer, which would also have dropped a PR from the list. `getPRAutoMergeInfo` now marks a failed PR read as `unavailable`. The new `readLinkedIssueAutoMergeLabel` returns `null` when the linked issue can't be read, so "no label" and "couldn't read the label" are no longer the same. `linkedIssueHasAutoMergeLabel` and `shouldAutoMergePR` still return the same booleans as before.
- `performMergeAndPostActions` now reports whether the merge happened, so only a real merge counts as resolved.
- The `require_up_to_date` docs page now explains when a PR stays on the retry list and that it's dropped after a day without being added again.

**Tests**
- `test/checkRunHandler.test.ts` gets the regression the finding asked for. A green PR that isn't part of a plan is put on the retry list because another PR holds the merge lock. The first sweep finds CI unavailable, and in a second version mergeability not computed yet. The second sweep, with no webhook in between, merges it and removes it from the list. This runs the real sweep and the real Redis retry functions; GitHub and Redis are mocked. Other cases check that a failed check and a closed PR count as resolved, and that an unreadable PR or linked issue counts as inconclusive.
- `test/autoMergeSweep.test.ts` gets a sweep-only version of the same two-sweep scenario.
- With the previous source files swapped back in, all the new tests fail. The two-sweep tests fail on "the inconclusive evaluation keeps the retry entry", which is the reported bug.

**Checks:** typecheck is clean for root and `packages/core`, and `eslint --max-warnings 0` is clean on the changed files. Core was rebuilt. The 13 related test files pass via `node scripts/run-test-suite.mjs`. `test/taskIntentWithdrawal.test.ts` used 81% of its 180s timeout. Nothing has run against real GitHub or Redis.

**Not changed:** a PR held back by a merge-blocking state such as `blocked` or `dirty` still counts as resolved. It waits for a review or a push, and either one produces its own event. A policy file that is truly invalid can't be told apart from one that couldn't be read, so both are inconclusive. Such a PR is re-checked about once a minute for up to the existing one-day limit; these checks don't post comments.

There are no previews because nothing visible changed.

PR: #3450
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 5af870b are holding the loop back:

  • Full Test Suite Shard 1/4 — not finished
  • Full Test Suite Shard 3/4 — not finished
  • Full Test Suite Shard 2/4 — not finished
  • Full Test Suite Shard 4/4 — not finished
  • Review dependency changes — not finished
  • Analyze JavaScript and TypeScript — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Validate Changes — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds opt-in branch updates, per-repository merge serialization, and deferred retries. It needs a targeted correction before merge: a deferred non-plan PR can lose its retry entry while CI runs and then stall permanently after its final check event.

✅ Configuration parity — Runtime validation, editor schema, scaffold, documentation, and tests consistently cover both new options.

✅ Guarded merges — Branch updates include the expected head SHA; merge ownership is renewed, token-checked, and checked again before merging.

✅ Focused coverage — Tests cover overlapping merges, ownership loss, rate limits, and transient reads. The supplied current checks report 38 passed, none failed or pending.

The linked issue specification is explicitly truncated; this review does not infer requirements from its omitted portion.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F8: 🔴 Preserve retries through running CI

  • Required behavior: A PR deferred by require_up_to_date, including one outside a plan, must remain recoverable when no further event will arrive.

  • Evidence: packages/core/src/webhook/autoMergeEvaluation.ts:ciRefusalOutcome, src/daemon/autoMergeSweep.ts:sweepAutoMergeCandidates, and packages/core/src/webhook/checkRunHandler.ts:processPRAutoMerge.

    1. A labelled non-plan PR passes the gates while behind its base. ProPR updates its branch and records it in the deferred retry set.
    2. A sweep evaluates the updated head while its CI is running. ciRefusalOutcome classifies checks_not_passing as resolved. noteCiWaitAfterBranchUpdate records the wait but does not refresh the deferred entry.
    3. The sweep settles and removes that entry because the evaluation returned resolved.
    4. The final successful check event arrives. Its evaluation encounters a transient refusal—for example, GitHub reports mergeable: null and mergeableState: 'unknown'. processPRAutoMerge returns inconclusive before reaching mergeWhenUpToDate, without restoring the retry entry.
    5. Mergeability subsequently resolves without another check event. The PR remains open indefinitely: it is neither a plan candidate nor a deferred candidate.

    static trace: The supplied code explicitly handles unknown mergeability as transient, but preserving an existing retry entry is insufficient after step 3 has deleted it. The repository ownership lock is never reached in step 4. Existing retry tests retain the entry before injecting transient failures, so they do not cover this transition. proposed regression: Exercise update → sweep during pending CI → final green event with unknown mergeability → recovery sweep, and assert the PR eventually merges.

  • Minimum fix: Keep deferred candidates recorded while checks are running, distinguishing pending checks from terminal failures, or durably restore their retry obligation when a subsequent event evaluation is inconclusive. Add coverage for the complete transition above.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The implementation has substantial safeguards and passing checks, but its retry lifecycle still permits a newly updated PR to stall. A localized recovery fix is required before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 49s
  • Tokens: 81,055 (79,991 in / 1,064 out)
  • Cost: $0.74

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F8

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 97fb611

Addressed 1 AI review comment (IDs: 6811122075)

Addressed finding F8

Summary of Changes

I fixed F8. A PR that ProPR has updated and put on the retry list now stays on it while CI is still running on the new head. Only a failed blocking check takes it off the list, so the sweep can still merge it if the final green check runs into a temporary refusal.

What changed

  • packages/core/src/webhook/checkRunHelpers.ts: when checks aren't passing, getCiMergeReadiness now also says whether a blocking check failed (checksFailed). Before, running and failed checks gave the same answer. The reason names are unchanged.
  • packages/core/src/webhook/autoMergeEvaluation.ts: ciRefusalOutcome returns resolved only when a blocking check has failed, including when other checks are still running. A failure waits on a new head or a re-run, and either one sends its own event. Running checks now return inconclusive, so the sweep keeps the entry. I updated the doc comments to match.
  • src/daemon/autoMergeSweep.ts and docs/docs/features/repository-workflow.md: the docs had said running checks take a PR off the list; they now describe the new behaviour. An entry still drops off after a day without a new deferral, so CI that hangs forever can't keep it on the list.

Tests (in test/checkRunHandler.test.ts)

  • A full replay of the review's scenario for a non-plan PR:
    1. A green check on the behind head makes ProPR update the branch and add the PR to the list.
    2. A sweep while CI is pending keeps the entry.
    3. The final green check arrives while GitHub reports mergeable: null / unknown. Nothing merges and the entry stays.
    4. The next sweep merges the updated head and removes the entry.
  • Running checks keep the entry; a failed check removes it, even with another check still running.
  • getCiMergeReadiness reports checksFailed: false for pending checks and true for failures, alone or alongside running checks.

With the old ciRefusalOutcome put back, both new sweep tests fail; with the fix they pass.

Checks run

  • I rebuilt core, then ran node scripts/run-test-suite.mjs on test/checkRunHandler.test.ts, test/autoMergeSweep.test.ts, packages/core/test/autoMergeUpToDate.test.ts and packages/core/test/autoMergeGateUpToDate.test.ts: 172 tests, all passing.
  • Typecheck is clean for root and packages/core.
  • eslint --max-warnings 0 is clean on the changed core files and src/daemon/autoMergeSweep.ts. The root lint config doesn't cover the test file, so it wasn't linted.
  • Nothing has run against real GitHub or Redis; the tests mock both.

There's nothing visual in this change, so I made no previews.

Something I found but didn't change: mergeabilityRefusalOutcome treats a mergeable state of blocked as resolved. GitHub can report blocked when the checks that have registered are green but a required check hasn't registered yet. That PR would then come off the list. If the late required check's green event then sees unknown mergeability, it gets stuck the same way F8 describes. Fixing it needs a way to tell a missing required check apart from a missing review, which is beyond F8, so I left it.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 6m 21s
  • Tokens: 1,414,689 (1,401,873 in / 12,816 out)
  • Cost: $1.00

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…y list now stays on it while CI is still running on the new head. Only a failed blocking check takes it off the list, so the sweep can still merge it if the final green check runs into a temporary refusal.

I fixed F8. A PR that ProPR has updated and put on the retry list now stays on it while CI is still running on the new head. Only a failed blocking check takes it off the list, so the sweep can still merge it if the final green check runs into a temporary refusal.

**What changed**
- `packages/core/src/webhook/checkRunHelpers.ts`: when checks aren't passing, `getCiMergeReadiness` now also says whether a blocking check failed (`checksFailed`). Before, running and failed checks gave the same answer. The reason names are unchanged.
- `packages/core/src/webhook/autoMergeEvaluation.ts`: `ciRefusalOutcome` returns `resolved` only when a blocking check has failed, including when other checks are still running. A failure waits on a new head or a re-run, and either one sends its own event. Running checks now return `inconclusive`, so the sweep keeps the entry. I updated the doc comments to match.
- `src/daemon/autoMergeSweep.ts` and `docs/docs/features/repository-workflow.md`: the docs had said running checks take a PR off the list; they now describe the new behaviour. An entry still drops off after a day without a new deferral, so CI that hangs forever can't keep it on the list.

**Tests** (in `test/checkRunHandler.test.ts`)
- A full replay of the review's scenario for a non-plan PR:
  1. A green check on the behind head makes ProPR update the branch and add the PR to the list.
  2. A sweep while CI is pending keeps the entry.
  3. The final green check arrives while GitHub reports `mergeable: null` / `unknown`. Nothing merges and the entry stays.
  4. The next sweep merges the updated head and removes the entry.
- Running checks keep the entry; a failed check removes it, even with another check still running.
- `getCiMergeReadiness` reports `checksFailed: false` for pending checks and `true` for failures, alone or alongside running checks.

With the old `ciRefusalOutcome` put back, both new sweep tests fail; with the fix they pass.

**Checks run**
- I rebuilt core, then ran `node scripts/run-test-suite.mjs` on `test/checkRunHandler.test.ts`, `test/autoMergeSweep.test.ts`, `packages/core/test/autoMergeUpToDate.test.ts` and `packages/core/test/autoMergeGateUpToDate.test.ts`: 172 tests, all passing.
- Typecheck is clean for root and `packages/core`.
- `eslint --max-warnings 0` is clean on the changed core files and `src/daemon/autoMergeSweep.ts`. The root lint config doesn't cover the test file, so it wasn't linted.
- Nothing has run against real GitHub or Redis; the tests mock both.

There's nothing visual in this change, so I made no previews.

**Something I found but didn't change:** `mergeabilityRefusalOutcome` treats a mergeable state of `blocked` as `resolved`. GitHub can report `blocked` when the checks that have registered are green but a required check hasn't registered yet. That PR would then come off the list. If the late required check's green event then sees unknown mergeability, it gets stuck the same way F8 describes. Fixing it needs a way to tell a missing required check apart from a missing review, which is beyond F8, so I left it.

PR: #3450
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR adds opt-in branch updates, serialized comparison and merging, and sweep recovery. It needs a localized recovery fix before merging.

✅ Configuration parity — Validation, editor schema, scaffold, and documentation consistently expose the optional settings and bounded update allowance.

✅ Merge ownership protection — Ownership renewal, token-checked release, and a final ownership check prevent a displaced holder from merging using its earlier comparison.

✅ Focused coverage — Tests cover expected-head updates, serialization, ownership takeover, and several transient recovery paths. The supplied current checks show 38 passed, none failed or pending.

This review uses static analysis of the supplied diff and context; no commands were run. The linked issue specification is explicitly truncated, so conclusions rely on its visible requirements and changed behavior.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F9: 🔴 Preserve recovery across failed-check reruns

  • Required behavior: A branch updated by ProPR must remain recoverable until fresh CI and the remaining merge gates permit merging; an intermediate failed check must not permanently lose automatic recovery.

  • Evidence: packages/core/src/webhook/autoMergeEvaluation.ts, ciRefusalOutcome; src/daemon/autoMergeSweep.ts, sweepAutoMergeCandidates; packages/core/src/webhook/checkRunHandler.ts, processPRAutoMerge.

    1. A labelled, non-plan PR passes its gates while behind. ProPR updates its branch and records it in the deferred retry set.
    2. CI fails on the updated head. A sweep calls ciRefusalOutcome, receives resolved, and settles the retry entry. Nothing has refreshed its deferred timestamp.
    3. The failed check is rerun successfully on the same head. Its final green event reaches processPRAutoMerge while active work still exists for that PR, or while GitHub reports unknown mergeability.
    4. That evaluation returns inconclusive before reaching mergeWhenUpToDate, without restoring the retry entry.
    5. Active work finishes or mergeability resolves. With no further check event and no plan record, subsequent sweeps never select this PR. The updated, passing PR remains unmerged.

    The newly added native-auto-merge suppression removes GitHub's waiting mechanism, making the deferred entry the recovery mechanism for this case. Returning inconclusive preserves only an existing entry; it cannot restore the entry deleted in step 2. The tests explicitly verify removal on failure and recovery through continuously pending checks, but do not cover failure followed by a successful rerun and transient refusal. static trace: the sequence follows the changed outcome classification, sweep settlement, and early-return paths; it was not executed.

  • Minimum fix: Preserve the deferred entry across failed checks while the PR remains an auto-merge candidate, or reliably restore it when a subsequent evaluation encounters a transient gate. Add a regression covering an updated non-plan PR whose failed check is rerun successfully, whose green event encounters active work or unknown mergeability, and which subsequently merges through the sweep.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The implementation has substantial focused coverage and all supplied checks pass. One demonstrated recovery gap can still strand an updated PR after CI recovers, so it is not yet merge-ready.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 2s
  • Tokens: 84,878 (83,629 in / 1,249 out)
  • Cost: $0.79

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F9

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit ff13978

Addressed 1 AI review comment (IDs: 6811608797)

Addressed finding F9

Summary of Changes

I fixed F9. When CI fails on a branch ProPR updated, the PR now stays on the retry list. So when a re-run turns green and that green event hits unknown mergeability or active work, a later sweep still merges it. The tests mock GitHub and Redis; nothing ran against the real services.

What changed

  • Failed checks keep the retry entry (packages/core/src/webhook/checkRunHandler.ts): any CI refusal, running or failed, now returns inconclusive. I removed ciRefusalOutcome. A failed check still gives up the repository's update turn, so other PRs can be updated in the meantime.
  • Mergeability refusals keep it too: this is the same mistake one gate later. A PR that was blocked, dirty or unstable was taken off the list on the assumption that a later event would merge it. That fails in two ways: a re-approval sends no check event, and the green event after a conflict fix or a re-run can hit the same transient refusal. F9 asks for recovery until "the remaining merge gates permit merging", and the F8 fix had already flagged blocked without changing it. I removed mergeabilityRefusalOutcome.
  • Removed checksFailed: CiMergeReadiness got this field in the F8 fix only for ciRefusalOutcome. Nothing reads it now, so getCiMergeReadiness is back to main's shape.
  • Docs: the code comments, the sweep doc comment and the retry paragraph in docs/docs/features/repository-workflow.md now describe the new behaviour.

A PR still leaves the list when it merges or closes, becomes a draft, loses the label, its Ultrafix loop fails, or the policy leaves it for a person.

Tests (test/checkRunHandler.test.ts)

  • The F9 scenario, end to end, for a non-plan PR:
    1. ProPR updates the behind branch and puts the PR on the list.
    2. CI fails. Two sweeps keep the entry and the turn is released.
    3. A green re-run on the same head arrives while mergeability is unknown.
    4. The next sweep merges updated-head and removes the entry.
  • One test each for blocked, dirty and unstable: the PR stays on the list and merges once GitHub reports it clean. The dirty and unstable cases also send a green event that hits unknown mergeability first.
  • Two existing tests changed: they had asserted that a failed check settles the entry. That one test is replaced by the F9 test, and the other now expects inconclusive.
  • On the previous code, the 4 new tests fail: the F9 test fails at step 2 ("a failed check does not settle the retry"), and each mergeability test fails on its first sweep. With the fix they pass.
  • Active work is not exercised. This test file can't make the active-work check report anything; the queue and DB mocks fail first. I used unknown mergeability instead, which the finding allows, and both return the same way.

Checks run

  • The 7 related test files pass (including checkRunHandler with 145 tests, the sweep suite, and core's autoMergeUpToDate, autoMergeGateUpToDate and autoMergePolicy).
  • Core was rebuilt. Typecheck is clean for root and packages/core.
  • eslint --max-warnings 0 is clean on the changed core files and on src/daemon/autoMergeSweep.ts.

Limits that still apply

  • An entry still drops off a day after it was last added. So if CI stays failed (or the PR stays blocked) for more than a day, a later green event that hits a temporary refusal is still lost. That one-day limit is how the list cleans itself up, and changing it would mean polling failing PRs without end.
  • Until then, the sweep re-checks a failing or blocked PR on the list about once a minute, as it already does for plan PRs.

Found but not changed

  • Draft PRs leave the list: a PR turned into a draft is taken off. Nothing re-checks auto-merge when it is marked ready for review, so a non-plan PR can stall there.
  • Conflicts never add a PR to the list: when the branch update fails with a conflict, the PR isn't added. If the conflict fix's green event then hits a temporary refusal, a non-plan PR that wasn't already on the list stalls.

Nothing visual changed, so there are no previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (xhigh)
  • Requested By: @propr-ultrafix
  • Time: 14m 51s
  • Tokens: 6,399,170 (6,343,247 in / 55,923 out)
  • Cost: $3.24

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

@integry integry removed the ultrafix label Nov 12, 2026
… now stays on the retry list. So when a re-run turns green and that green event hits unknown mergeability or active work, a later sweep still merges it. The tests mock GitHub and Redis; nothing ran against the real services.

I fixed F9. When CI fails on a branch ProPR updated, the PR now stays on the retry list. So when a re-run turns green and that green event hits unknown mergeability or active work, a later sweep still merges it. The tests mock GitHub and Redis; nothing ran against the real services.

**What changed**
- **Failed checks keep the retry entry** (`packages/core/src/webhook/checkRunHandler.ts`): any CI refusal, running or failed, now returns `inconclusive`. I removed `ciRefusalOutcome`. A failed check still gives up the repository's update turn, so other PRs can be updated in the meantime.
- **Mergeability refusals keep it too**: this is the same mistake one gate later. A PR that was `blocked`, `dirty` or `unstable` was taken off the list on the assumption that a later event would merge it. That fails in two ways: a re-approval sends no check event, and the green event after a conflict fix or a re-run can hit the same transient refusal. F9 asks for recovery until "the remaining merge gates permit merging", and the F8 fix had already flagged `blocked` without changing it. I removed `mergeabilityRefusalOutcome`.
- **Removed `checksFailed`**: `CiMergeReadiness` got this field in the F8 fix only for `ciRefusalOutcome`. Nothing reads it now, so `getCiMergeReadiness` is back to main's shape.
- **Docs**: the code comments, the sweep doc comment and the retry paragraph in `docs/docs/features/repository-workflow.md` now describe the new behaviour.

A PR still leaves the list when it merges or closes, becomes a draft, loses the label, its Ultrafix loop fails, or the policy leaves it for a person.

**Tests** (`test/checkRunHandler.test.ts`)
- **The F9 scenario, end to end, for a non-plan PR**:
  1. ProPR updates the behind branch and puts the PR on the list.
  2. CI fails. Two sweeps keep the entry and the turn is released.
  3. A green re-run on the same head arrives while mergeability is unknown.
  4. The next sweep merges `updated-head` and removes the entry.
- **One test each for `blocked`, `dirty` and `unstable`**: the PR stays on the list and merges once GitHub reports it clean. The `dirty` and `unstable` cases also send a green event that hits unknown mergeability first.
- **Two existing tests changed**: they had asserted that a failed check settles the entry. That one test is replaced by the F9 test, and the other now expects `inconclusive`.
- **On the previous code, the 4 new tests fail**: the F9 test fails at step 2 ("a failed check does not settle the retry"), and each mergeability test fails on its first sweep. With the fix they pass.
- **Active work is not exercised.** This test file can't make the active-work check report anything; the queue and DB mocks fail first. I used unknown mergeability instead, which the finding allows, and both return the same way.

**Checks run**
- The 7 related test files pass (including `checkRunHandler` with 145 tests, the sweep suite, and core's `autoMergeUpToDate`, `autoMergeGateUpToDate` and `autoMergePolicy`).
- Core was rebuilt. Typecheck is clean for root and `packages/core`.
- `eslint --max-warnings 0` is clean on the changed core files and on `src/daemon/autoMergeSweep.ts`.

**Limits that still apply**
- An entry still drops off a day after it was last added. So if CI stays failed (or the PR stays blocked) for more than a day, a later green event that hits a temporary refusal is still lost. That one-day limit is how the list cleans itself up, and changing it would mean polling failing PRs without end.
- Until then, the sweep re-checks a failing or blocked PR on the list about once a minute, as it already does for plan PRs.

**Found but not changed**
- **Draft PRs leave the list**: a PR turned into a draft is taken off. Nothing re-checks auto-merge when it is marked ready for review, so a non-plan PR can stall there.
- **Conflicts never add a PR to the list**: when the branch update fails with a conflict, the PR isn't added. If the conflict fix's green event then hits a temporary refusal, a non-plan PR that wasn't already on the list stalls.

Nothing visual changed, so there are no previews.

PR: #3450
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from main into 3447/claude-opus-5-5-update-a-behind-branch-an-20261111-2200-q3e in commit de9a963

Conflicting Files

  • packages/cli/src/commands/initCommands.ts
  • packages/core/test/repositoryWorkflow.test.ts

Resolution Summary

Both conflicts are resolved and no conflict markers remain anywhere in the repository.

1. packages/cli/src/commands/initCommands.ts, the starter workflow.yml that init writes

  • What it was about: Both branches added commented-out example lines at the same spot, right after the auto_merge example.
    • The PR added two auto_merge options: require_up_to_date: false and max_branch_updates_per_hour: 3.
    • main added a top-level on_blocker: report option, with a comment explaining it.
  • How I resolved it: I kept both. The PR's two lines come first so they stay inside the auto_merge: block. The on_blocker lines follow at the top level, where they belong.
  • Why: The two changes are separate features, so neither should replace the other. The order matters for indentation: if the auto_merge lines came after on_blocker, uncommenting them would make invalid YAML.

2. packages/core/test/repositoryWorkflow.test.ts, the test that checks the editor schema and the runtime parser agree

  • What it was about: Both branches added sample configs to the same list in this test. The PR added valid and invalid auto_merge.require_up_to_date and max_branch_updates_per_hour cases. main added on_blocker cases.
  • How I resolved it: I kept both sets of cases.
  • Why: The merged JSON schema and the runtime parser already support both features, so both sets of checks should keep running.

Checks I ran:

  • repositoryWorkflow.test.ts passes, including the combined schema/runtime check and main's on_blocker tests.
  • test/cliInitCommand.test.ts passes (4/4), including main's check that the on_blocker example parses once uncommented.
  • The CLI package type-checks with no errors.
  • test/epicQueueBlockedHead.test.ts (a file the PR adds) failed in my run with mock.module is not a function. That most likely happened because I ran it without the Node flag that enables module mocking, not because of the merge. I didn't rerun it with that flag.

🤖 Resolution Details

  • Model: Claude Opus 5.5
  • Time: 3m 54s

View Task Execution


System-triggered merge conflict resolution

…-behind-branch-an-20261111-2200-q3e

Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- packages/cli/src/commands/initCommands.ts
- packages/core/test/repositoryWorkflow.test.ts

PR: #3450
Model: Claude Opus 5.5
@integry

integry commented Nov 12, 2026

Copy link
Copy Markdown
Owner

/ultrafix

@propr-dev propr-dev Bot added the ultrafix label Nov 12, 2026
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR is merge-ready within the supplied scope. It adds the optional policy, guarded branch updates, merge serialization, and sweep recovery with substantial targeted coverage.

✅ Configuration parity — Runtime validation, editor schema, scaffold, and documentation consistently expose both new options and their defaults.

✅ Head-bound operations — Branch updates use expected_head_sha; merges use the evaluated head SHA and confirm merge ownership immediately before submission.

✅ Recovery coverage — Tests exercise overlapping merges, ownership loss, rate limits, native auto-merge withdrawal, and deferred non-plan PRs.

This was a static review; no commands were run. The supplied checks report 38 passed and none failed or pending. The issue specification is explicitly truncated, so requirements beyond its visible portion could not be assessed.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S4: 🟢 Cover retry expiry during waiting

In autoMergeUpToDateRetry.ts, entries expire 24 hours after their last deferral. Inconclusive sweep evaluations retain entries but do not refresh that timestamp. Consequently, a non-plan PR awaiting approval or prolonged CI can eventually lose sweep recovery. This is explicitly documented, so it is not a blocker; a focused test covering prolonged waiting would help preserve the intended expiry semantics.

S5: 🟢 Clarify repositories without CI

The new documentation promises merging after CI passes, while checkRunHandler.ts retains the existing readiness path that permits heads with no CI after its grace period. Explicitly documenting that exception would make the feature’s guarantees clearer. This is optional clarification of intentionally preserved behavior.

Score

The implementation has strong safeguards and targeted tests, with no verified merge blocker in the supplied changes. Current-head checks are green; verification here was static.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 4s
  • Tokens: 86,564 (85,449 in / 1,115 out)
  • Cost: $0.80

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S4 S5

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 12, 2026
@integry
integry merged commit 6215df9 into main Nov 12, 2026
58 checks passed
@integry
integry deleted the 3447/claude-opus-5-5-update-a-behind-branch-an-20261111-2200-q3e branch November 12, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update a behind branch and wait for fresh CI before auto-merging

1 participant