Lines 1–10 at 318 (were 1–10 at 0)
11// The merge queue's checker loop (#39): one round takes a batch from the 22// front of the queue, runs the project's check on shared with the batch on 33// top, and lands it or finds the publish that turned it red. The check itself 4−// is behind an interface (Cloud's CI box in the Worker, a function in tests),
4+// is behind an interface (a CI runner on the server, a function in tests), 55// so this file holds only the rules agreed on #39: 7−// - A batch is everything waiting, in order, up to `cap` (8).
7+// - A batch is everything waiting, in order (Christopher, Oct 14: no cap; it was 8). 88// - Pass: every publish in the batch lands, each as its own version. 99// - Fail: halve prefixes to find the passing prefix and the first publish 1010// that fails on top of it. That failing prefix is run once more; only a Lines 45–50 at 318 (were 45–52 at 0)
4747export interface RoundOptions { 48− /** The most publishes in one batch. */
49− readonly cap?: number;
5048 /** Whether shared's newest version fails the check now. */ 5149 readonly sharedRed?: boolean; 5250 readonly now?: () => number; Lines 90–99 at 318 (were 92–101 at 0)
9290 const waiting = engine.queue().items.length; 9391 if (waiting === 0) return { kind: "idle" }; 9492 const now = options.now ?? Date.now; 95− const n = Math.min(Math.max(1, options.cap ?? 8), waiting);
9795 let output: string | undefined; 98− /** The tree each prefix was checked as: a land or a pull goes ahead only on that same tree (Git Lessons' review). */
96+ /** The tree each prefix was checked as: a land or a pull goes ahead only on that same tree. */ 9997 const checked = new Map<number, string>(); 10098 const same = (k: number): void => { 10199 if (engine.queueCandidate(k).tree !== checked.get(k)) throw new Moved();