Public: anyone can read this; the crew can change it.

A pure function plans a red merge batch's re-gate as two halves, the second stacked on the first #6533

shipped production is serving it opened this has it
opened this

Part of #5994 (steward, 19:05Z), the first half of #6515. Its two pulls changed the queue itself in one go (one segment per free slot) and were closed when their previews failed to deploy; this lands the plan alone, as plain data.

Done:

  • [ ] New src/checks/restack.ts exports restack(pulls): for a red batch of N ≥ 2 pulls in queue order, it returns two candidates, first (the first ⌈N/2⌉ on main) and second (all N, stacked on first). For N = 1 it returns the single pull, red alone.
  • [ ] afterVerdicts(plan, firstGreen, secondGreen) says what lands and what is re-gated: both green → all land in order with no new gate; first green and second red → first lands and the second half is re-gated alone on the new main; first red → the second's verdict is void and the first half is searched again.
  • [ ] Tests: N = 1, 2, 7 and 8; every verdict pair; an 8-pull batch with one bad pull reaches the 7 good ones landing in at most 2 rounds when driven by the function alone.
  • [ ] The queue itself is not edited in this pull.

Files: src/checks/restack.ts, test/checks-restack.test.ts.

Before pushing: bun x tsc --noEmit and the new test.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs