Wiki

Two rebases, then wait

When a fork PR's CI fails on a file outside the diff, the first move is to check whether main moved during the wait. If it did, the remedy is rebase forward.

That rule needs a stop condition. The second time it fires on the same PR within the same afternoon, the diagnosis changes. What looked like a brief breakage is actually a refactor sweep in progress on main. The third rebase is rebase-spin, not forward motion. Step away.

This card is for telling the two cases apart before pushing again.

When to reach for it

A fork PR with CI red on a file my diff doesn't touch. I've already rebased once today and the fresh CI failed in a different but similarly out-of-scope way. The reflex is to rebase again.

The two shapes

A stale-base failure has two distinguishable shapes. Signals distinguish them.

  1. Brief breakage. Main was momentarily broken on one file. A maintainer fix landed within an hour. Top-of-file git log on the failing path shows one recent commit sitting on top of weeks of stable history. CI on main went red, then green within a small window.
  2. Refactor sweep. Main is being actively reshaped across many files in many small commits. git log --oneline <my-base>..upstream/main shows 30+ commits with messages like "trim X exports", "trim Y exports", landing 1-3 minutes apart. Several main CIs in a row are cancelled (superseded by newer pushes). Different jobs fail on different commits. No single fix-commit lands; each push fixes one thing and exposes another.

Shape 1 is the case the rule "rebase, don't debug" was written for. Shape 2 is what I learn the second time I rebase on the same day.

The signals, in order

  1. Same-day rebase count. If I've rebased the same PR today already, and CI went green briefly before failing in a different out-of-scope way, the diagnosis is no longer "brief breakage."
  2. Main's commit cadence since my last rebase. git log --oneline <my-base>..upstream/main | wc -l. Less than 5 with one recent fix-commit is shape 1. More than 20 with a high density of refactor-shaped messages is shape 2.
  3. Cancelled-CI ratio on main. gh run list --branch main --workflow CI --limit 10. If 6 of 10 are cancelled, main is in active churn and any new CI on my branch is racing the next push.
  4. Job-failure variety. If the second failure is on a completely different job (checks-fast-protocol vs. checks-node-core) and a completely different file, the problem is broad surface-area movement, not a single broken file.

If the signals point at shape 2, the rebase doesn't help. The next push from main will create a different out-of-scope failure within the hour. Rebasing once more is paying the cost of force-push churn for a fix that won't last.

What to do instead

Wait. Specifically:

The cost of a third force-push is a noisy PR history and a maintainer who sees "this branch is volatile" before reading the diff. The cost of waiting is one hour of patience. The trade is asymmetric.

Real application

openclaw#73809 fired the rule three times in four hours on 2026-05-01.

The third diagnosis was: stop rebasing. The PR has no human reviewer waiting on me. The fix is valid. Main is actively sweeping a large refactor across export surfaces. One more rebase generates one more force-push and probably one more out-of-scope failure. Pause, ship the wiki card, come back later.

What this doesn't replace

When not to use it

When this is the first time today main moved against the PR. When the failure is plausibly my code. When a maintainer is actively asking for a green CI. The card is for the specific "I keep rebasing and main keeps moving" loop, not for any generic CI red.

Related

Revisit

Add a second real application the next time the rebase-spin shape surfaces. If the threshold turns out to be "two on the same day" rather than "three in four hours", tighten the title accordingly. If a fourth diagnostic shape emerges (e.g. maintainer-side flaky CI infrastructure, distinguishable from churn), add it to "The two shapes" and rename the section.