@futurelastic/colab-handbook 1.13.0-rc.49 → 1.13.0-rc.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -33,5 +33,5 @@
33
33
  "engines": {
34
34
  "node": ">=18"
35
35
  },
36
- "version": "1.13.0-rc.49"
36
+ "version": "1.13.0-rc.50"
37
37
  }
package/tools/colab CHANGED
@@ -15176,11 +15176,17 @@ its head, trunk runs say when a landing was pushed and when its trunk-CI cycle e
15176
15176
  Reports:
15177
15177
  batches landed, and their fill · combined-run builds: first-attempt green, green after the
15178
15178
  one re-run, red, pending
15179
- red red builds, and how many of their members then landed serially (the fallback)
15179
+ red red builds, and how many of their members then landed alone — serially, or as a
15180
+ batch of one (#580) — the fallback
15180
15181
  dropped members dropped at build, by class, and the eviction rate
15181
15182
  serial serial landings, and MISSED PARTNERS — another change, landed later, that was
15182
15183
  already green when this one landed alone (could have joined) or went green inside
15183
- this landing's trunk-CI cycle (a near miss; its wait is what ship-batch-wait buys)
15184
+ this landing's trunk-CI cycle (a near miss; its wait is what ship-batch-wait buys).
15185
+ "serial" means landed through the serial path, and only that
15186
+ alone the same partner scan over every change that landed ALONE — serially or as a batch
15187
+ of one (#580). On a ship-batch repo a lone ready candidate lands as a fill-1 batch,
15188
+ so there serial reads zero either way; alone is the line to tune ship-batch-wait by.
15189
+ Printed only when a batch of one landed (otherwise it equals serial)
15184
15190
  queue wait green-at-head → landing, per landed change
15185
15191
 
15186
15192
  No batch history in the window is an answer, not an error: it says so, and still reports the
@@ -15285,12 +15291,17 @@ function cmdBatchStats(argv) {
15285
15291
  else {
15286
15292
  const fill = Object.keys(rep.batches.fill).sort().map((k) => `${rep.batches.fill[k]}×${k}`).join(' · ') || '—';
15287
15293
  print(` batches ${rep.batches.landed} landed (fill ${fill}) · ${rep.batches.builds} combined-run build(s): ${rep.batches.firstAttemptGreen} first-attempt green (${pct(rep.batches.firstAttemptGreenRate)}), ${rep.batches.greenAfterRerun} after a re-run, ${rep.batches.red} red, ${rep.batches.pending} pending`);
15288
- print(` red ${rep.red.builds} build(s) · ${rep.red.members} member(s), ${rep.red.relandedSerially} then landed serially`);
15294
+ print(` red ${rep.red.builds} build(s) · ${rep.red.members} member(s), ${rep.red.relandedAlone} then landed alone (${rep.red.relandedSerially} serially · ${rep.red.relandedAlone - rep.red.relandedSerially} as a batch of one)`);
15289
15295
  const cls = Object.entries(rep.dropped.byClass).map(([k, v]) => `${v} ${k}`).join(', ');
15290
15296
  print(` dropped ${rep.dropped.count} of ${rep.dropped.attempted} attempted (${pct(rep.dropped.rate)})${cls ? ` — ${cls}` : ''}`);
15291
15297
  }
15292
15298
  print(` serial ${rep.serial.landings} landed alone · ${rep.serial.withMissedPartner} with a missed partner (already green) · ${rep.serial.withNearMiss} more with a near miss (green within its trunk-CI cycle)`);
15293
15299
  if (rep.serial.nearMissWait.samples) print(` near misses per pair, the wait from the lone change's own green that would have caught its partner: ${q(rep.serial.nearMissWait)}`);
15300
+ if (rep.alone.batchOfOne) {
15301
+ // #580: a batch of one landed alone too — the serial line above cannot see it.
15302
+ print(` alone ${rep.alone.landings} landed alone (${rep.alone.landings - rep.alone.batchOfOne} serial · ${rep.alone.batchOfOne} batch of one) · ${rep.alone.withMissedPartner} with a missed partner (already green) · ${rep.alone.withNearMiss} more with a near miss`);
15303
+ if (rep.alone.nearMissWait.samples) print(` near misses (alone) ${q(rep.alone.nearMissWait)}`);
15304
+ }
15294
15305
  print(` queue wait green-at-head → landing: ${q(rep.queueWait)}`);
15295
15306
  for (const n of rep.notes) print(` ! ${n}`);
15296
15307
  return 0;
@@ -20,12 +20,18 @@
20
20
  * What it measures, per window:
21
21
  * batches landed and their fill; every combined-run build, first-attempt green, green after
22
22
  * the one re-run, red, still pending
23
- * red red builds and how many of their members then landed serially (the fallback)
23
+ * red red builds and how many of their members then landed alone — serially, or as a
24
+ * batch of one (#580) — the fallback
24
25
  * dropped members dropped at build, by class, and the eviction rate among attempted members
25
26
  * serial serial landings, and MISSED PARTNERS: another candidate that landed later but was
26
27
  * already green when this one landed alone (could have joined), or turned green
27
28
  * within this landing's trunk-CI cycle (a partner wait of `waitSec` would have caught
28
- * it — the number `ship-batch-wait` is tuned from)
29
+ * it — the number `ship-batch-wait` is tuned from). `serial` means landed through the
30
+ * SERIAL PATH (no Ship-Batch trailer), and only that
31
+ * alone the same partner scan over every change that LANDED ALONE: a serial landing, or a
32
+ * batch of one (#580). Since #562 a lone ready candidate on a ship-batch repo lands as
33
+ * a fill-1 batch, so on such a repo `serial` reads zero whether partners were missed or
34
+ * not; `alone` is the signal `ship-batch-wait` is tuned from there
29
35
  * queueWait per landed change, green-at-head → landing
30
36
  */
31
37
 
@@ -175,16 +181,21 @@ function derive({ commits = [], runs = [], builds = {}, trunk = 'main', config =
175
181
  const rerunGreen = buildRows.filter((b) => b.state === 'green' && b.attempt > 1).length;
176
182
  const redBuilds = buildRows.filter((b) => b.state === 'red');
177
183
 
178
- // ---- red builds → did their members then land serially? ----
184
+ // ---- red builds → did their members then land alone (serially, or as a batch of one)? ----
179
185
  const serialChanges = changes.filter((c) => c.landing.kind === 'serial');
180
- let redMembers = 0, relanded = 0, redMembersUnread = 0;
186
+ // #580: a fill-1 batch landed alone exactly as a serial landing did — only its path differs.
187
+ const isBatchOfOne = (c) => c.landing.kind === 'batch' && c.landing.members.length === 1;
188
+ const aloneChanges = changes.filter((c) => c.landing.kind === 'serial' || isBatchOfOne(c));
189
+ let redMembers = 0, relanded = 0, relandedAlone = 0, redMembersUnread = 0;
181
190
  for (const b of redBuilds) {
182
191
  const members = b.messages && b.messages.length ? shipBatch.parseMemberTrailers(b.messages) : [];
183
192
  if (!members.length) { redMembersUnread++; continue; }
184
193
  for (const m of members) {
185
194
  redMembers++;
186
195
  const nums = branchName.branchIssueNumbers(m.branch);
187
- if (serialChanges.some((c) => c.atMs >= b.createdMs && (c.branch === m.branch || c.issues.some((n) => nums.includes(n))))) relanded++;
196
+ const isMember = (c) => c.atMs >= b.createdMs && (c.branch === m.branch || c.issues.some((n) => nums.includes(n)));
197
+ if (serialChanges.some(isMember)) relanded++;
198
+ if (aloneChanges.some(isMember)) relandedAlone++;
188
199
  }
189
200
  }
190
201
  if (redMembersUnread) notes.push(`${redMembersUnread} red build(s) whose members could not be read (the ref is gone and its commits were not readable)`);
@@ -205,42 +216,57 @@ function derive({ commits = [], runs = [], builds = {}, trunk = 'main', config =
205
216
  const byClass = {};
206
217
  for (const d of dropped) byClass[d.cls] = (byClass[d.cls] || 0) + 1;
207
218
 
208
- // ---- missed partners: serial landings that landed alone while a partner was (nearly) ready ----
209
- const pairs = [];
210
- let withMissed = 0, withNear = 0, cyclesUnread = 0, overlapped = 0;
219
+ // ---- missed partners: landings that went alone while a partner was (nearly) ready ----
211
220
  // A partner is judged by ITS state at this landing's moment, never by the head it finally landed
212
221
  // with: a serial ship syncs the other branches, so their final heads all post-date it. The cycle
213
222
  // ends when this landing's trunk run finishes — or at the next landing, whichever is first (a
214
223
  // re-run moves a run's updated_at hours later, and the next landing moves trunk anyway).
215
224
  const landingTimes = landings.map((l) => l.atMs).sort((a, b) => a - b);
216
- for (const c of serialChanges) {
217
- const next = landingTimes.find((t) => t > c.atMs);
218
- let end = cycleEnd(c.landing.sha);
219
- if (end === null) cyclesUnread++;
220
- else if (next !== undefined) end = Math.min(end, next);
221
- let missed = false, near = false;
222
- const label = c.branch || c.landing.sha.slice(0, 7);
223
- for (const o of changes) {
224
- if (o === c || o.landing === c.landing || o.atMs <= c.atMs || !o.branch || o.branch === c.branch) continue;
225
- const gNow = greenAt(runsByBranch, o.branch, c.atMs);
226
- if (gNow !== null) {
227
- missed = true;
228
- pairs.push({ kind: 'missed', landed: label, partner: o.branch });
229
- continue;
230
- }
231
- if (end === null) continue;
232
- const gEnd = greenAt(runsByBranch, o.branch, end);
233
- if (gEnd !== null && gEnd > c.atMs) {
234
- near = true;
235
- const from = c.greenMs !== null ? c.greenMs : c.atMs;
236
- pairs.push({ kind: 'near', landed: label, partner: o.branch, waitSec: Math.round((gEnd - from) / 1000) });
225
+ const scanPartners = (lone, tagVia) => {
226
+ const pairs = [];
227
+ let withMissed = 0, withNear = 0, cyclesUnread = 0, overlapped = 0;
228
+ for (const c of lone) {
229
+ const next = landingTimes.find((t) => t > c.atMs);
230
+ let end = cycleEnd(c.landing.sha);
231
+ if (end === null) cyclesUnread++;
232
+ else if (next !== undefined) end = Math.min(end, next);
233
+ let missed = false, near = false;
234
+ const label = c.branch || c.landing.sha.slice(0, 7);
235
+ const via = tagVia ? { via: c.landing.kind === 'serial' ? 'serial' : 'batch-of-one' } : {};
236
+ for (const o of changes) {
237
+ if (o === c || o.landing === c.landing || o.atMs <= c.atMs || !o.branch || o.branch === c.branch) continue;
238
+ const gNow = greenAt(runsByBranch, o.branch, c.atMs);
239
+ if (gNow !== null) {
240
+ missed = true;
241
+ pairs.push({ kind: 'missed', landed: label, partner: o.branch, ...via });
242
+ continue;
243
+ }
244
+ if (end === null) continue;
245
+ const gEnd = greenAt(runsByBranch, o.branch, end);
246
+ if (gEnd !== null && gEnd > c.atMs) {
247
+ near = true;
248
+ const from = c.greenMs !== null ? c.greenMs : c.atMs;
249
+ pairs.push({ kind: 'near', landed: label, partner: o.branch, waitSec: Math.round((gEnd - from) / 1000), ...via });
250
+ }
237
251
  }
252
+ if (missed) withMissed++;
253
+ else if (near) withNear++;
254
+ if (end !== null && (missed || near)) overlapped++;
238
255
  }
239
- if (missed) withMissed++;
240
- else if (near) withNear++;
241
- if (end !== null && (missed || near)) overlapped++;
242
- }
243
- if (cyclesUnread) notes.push(`${cyclesUnread} serial landing(s) with no finished trunk run in the window — near misses not judged for them`);
256
+ return {
257
+ landings: lone.length, withMissedPartner: withMissed, withNearMiss: withNear,
258
+ // #556: the overlap rate's honest denominator — only a landing whose trunk-CI cycle was read
259
+ // could have been judged for a partner inside it; `overlapped` counts those that had one.
260
+ cyclesRead: lone.length - cyclesUnread, overlapped,
261
+ nearMissWait: summary(pairs.filter((p) => p.kind === 'near').map((p) => p.waitSec)),
262
+ pairs,
263
+ };
264
+ };
265
+ const serial = scanPartners(serialChanges, false);
266
+ const alone = scanPartners(aloneChanges, true);
267
+ // The alone set contains the serial one, so its unread count is the one note (never two).
268
+ const aloneUnread = alone.landings - alone.cyclesRead;
269
+ if (aloneUnread) notes.push(`${aloneUnread} lone landing(s) (serial or a batch of one) with no finished trunk run in the window — near misses not judged for them`);
244
270
  const unknownGreen = changes.filter((c) => c.greenMs === null).length;
245
271
  if (unknownGreen) notes.push(`${unknownGreen} landed change(s) with no readable green-at-head run — left out of queue wait and partner matching`);
246
272
 
@@ -259,16 +285,13 @@ function derive({ commits = [], runs = [], builds = {}, trunk = 'main', config =
259
285
  pending: buildRows.length - finished.length,
260
286
  firstAttemptGreenRate: rate(firstGreen, finished.length),
261
287
  },
262
- red: { builds: redBuilds.length, members: redMembers, relandedSerially: relanded },
288
+ // relandedSerially: through the serial path only; relandedAlone: serially OR as a batch of one (#580).
289
+ red: { builds: redBuilds.length, members: redMembers, relandedSerially: relanded, relandedAlone },
263
290
  dropped: { count: dropped.length, attempted: builtMembers + dropped.length, rate: rate(dropped.length, builtMembers + dropped.length), byClass, members: dropped },
264
- serial: {
265
- landings: serialChanges.length, withMissedPartner: withMissed, withNearMiss: withNear,
266
- // #556: the overlap rate's honest denominator — only a landing whose trunk-CI cycle was read
267
- // could have been judged for a partner inside it; `overlapped` counts those that had one.
268
- cyclesRead: serialChanges.length - cyclesUnread, overlapped,
269
- nearMissWait: summary(pairs.filter((p) => p.kind === 'near').map((p) => p.waitSec)),
270
- pairs,
271
- },
291
+ // `serial`: landed through the serial path. `alone`: landed alone by either path — a serial
292
+ // landing or a batch of one (#580); its pairs carry `via: 'serial' | 'batch-of-one'`.
293
+ serial,
294
+ alone: { ...alone, batchOfOne: aloneChanges.filter(isBatchOfOne).length },
272
295
  queueWait,
273
296
  notes,
274
297
  };