Part of #5930 (owner, 2026-10-26: rebase drifting trees early, while it is cheap).
Done:
[ ] New src/flow/rebase_first.ts exports rebaseFirst(drifts, now), taking { number, behind, baseAt, approved, held }[] and returning at most 5 numbers: held pulls never; approved pulls before others; then most landings behind; then oldest base.
[ ] Pulls 0 behind are never picked.
[ ] Tests: each ordering rule, held left out, the cap.
Part of #5930 (owner, 2026-10-26: rebase drifting trees early, while it is cheap).
Done:
src/flow/rebase_first.tsexportsrebaseFirst(drifts, now), taking{ number, behind, baseAt, approved, held }[]and returning at most 5 numbers: held pulls never; approved pulls before others; then most landings behind; then oldest base.Files: src/flow/rebase_first.ts, test/flow-rebase-first.test.ts.
Before pushing:
bun x tsc --noEmitand the new test.