@botbuddy/cli 1.91.1 → 1.92.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.92.0
4
+
5
+ - BOT-3394: the bb-status band's WAITS row shows the session's own push held at the host compute gate, from `get_session_status`'s new `push_wait`: "push waiting for host compute · 17× load · 1h 24m" or "push waiting for a compute slot · 2 of 3 · 12m", linked to /waits. `bb status-band read` carries it as `push_wait` (`reason`, `load_ratio`, `slot_position`, `waiting_count`, `since`), null when none is held or BB did not say. The badge goes once the lane starts or the push ends: while a push is held the band's relay also wakes on a one-minute `timer:duration=60` (now on `bb status-band relay`'s allow-list, which takes up to 20 conditions) and re-reads, because no signal yet says a held lane started. A band whose BB reports `push_wait` also re-reads on each quiet relay timeout (~9.5 min), so a hold that begins after its last read still shows.
6
+
7
+ ## 1.91.2
8
+
9
+ - BOT-3402: a Go daemon host reports `node`, `pnpm` and `deno` as test-child capabilities only when each prints its version inside a child's own sandbox (a throwaway systemd unit with the child's user, mounts and PATH). A Corepack `pnpm` shim that cannot run there is no longer reported, `deno` is reported for the first time, and the report carries `pnpm_version` and `deno_version` next to `node_version`. The probe runs once per five-minute report, never when a child starts; if the probe itself cannot run, the last verdict stands and the report carries `probe_error`. `bb stack run --child-requires` help names `pnpm` and `deno`.
10
+
3
11
  ## 1.91.1
4
12
 
5
13
  - BOT-3393: the telemetry outbox now forwards a lifecycle event's `host` and `compute` context (the producing machine, the compute gate's live wait reason with slot position and load ratio, and the measured slot / load waits) to `execution-ingest` instead of dropping them, so a pre-push lane held for compute is visible and measured.
@@ -296,6 +296,8 @@ const LINKS = {
296
296
  pr: (repo, n) => APP + "/kanban?card=pr:" + repo + "%23" + n,
297
297
  // BOT-3223 AC-1: a wait badge opens that wait on BB's Waits page.
298
298
  wait: (id) => APP + "/waits?wait=" + id,
299
+ // BOT-3394: a push held for compute opens /waits, where every held push is listed.
300
+ pushes: APP + "/waits",
299
301
  // BOT-3152 AC-2: the web top bar's Staging chip link (STAGING_HREF).
300
302
  staging: APP + "/release-readiness/staging/latest",
301
303
  };
@@ -485,7 +487,7 @@ async function refresh($, { wake = false, keep = false } = {}) {
485
487
  // What the band waits on: each ticket, the agent's own waits (BOT-3212), each PR
486
488
  // still open or draft, and, when BotBuddy blockers are listed, each ticket's
487
489
  // last blocker clearing, and the epic's Linear project (BOT-3136).
488
- const MAX_CONDITIONS = 19;
490
+ const MAX_CONDITIONS = 20;
489
491
  function waitConditions(s) {
490
492
  // BOT-3152 AC-2: unknown staging (null: a failed read) also wakes on it
491
493
  // (review on #1616), so the next incident re-reads; only a tenant known to
@@ -512,10 +514,14 @@ function waitConditions(s) {
512
514
  for (const p of s.prs || [])
513
515
  if (p.state === "open" || p.state === "draft")
514
516
  conds.push("pr-review:repo=" + p.repo + ",pr=" + p.number);
515
- // At most 5 tickets, the agent's waits, 5 PRs (state + review), blockers, epic
516
- // and staging: 19, the relay's limit, so no wake is ever dropped (review on
517
- // #1616, round 4; BOT-3212).
518
- return [...conds, ...staging].slice(0, MAX_CONDITIONS);
517
+ // BOT-3394: no signal says a held pre-push lane started, so while a push is
518
+ // held the relay also wakes on a one-minute timer and the badge drops on the
519
+ // next read. A platform gap (no execution-run signal), not a poll loop.
520
+ const timer = pushWaitText(s.push_wait, currentTime) ? ["timer:duration=60"] : [];
521
+ // At most 5 tickets, the agent's waits, 5 PRs (state + review), blockers, epic,
522
+ // staging and the held-push timer: 20, the relay's limit, so no wake is ever
523
+ // dropped (review on #1616, round 4; BOT-3212; BOT-3394).
524
+ return [...timer, ...conds, ...staging].slice(0, MAX_CONDITIONS);
519
525
  }
520
526
  // Ending the loop's stream kills the child; a module unload does the same.
521
527
  function stopRelay() {
@@ -606,7 +612,9 @@ function startRelay($) {
606
612
  // BOT-3286 (Codex P2 on #1727): no signal carries a coordinator
607
613
  // registering, ending or going idle, so a shown badge re-reads on each
608
614
  // quiet timeout (~9.5 min).
609
- if (snapshot?.epic && snapshot.epic.coordinator !== undefined) await wakeRead();
615
+ // BOT-3394 (Codex P2 on #1814): nor does a push starting to hold for
616
+ // compute (BOT-3410), so a BB that reports push_wait re-reads here too.
617
+ if ((snapshot?.epic && snapshot.epic.coordinator !== undefined) || (snapshot && snapshot.push_wait !== undefined)) await wakeRead();
610
618
  } else if (res.exit === 5) {
611
619
  backoffMs = Math.min(backoffMs ? backoffMs * 2 : 30000, 300000);
612
620
  since = cursor || since;
@@ -1032,6 +1040,50 @@ function waitBadges(el, key, w, now) {
1032
1040
  if (w.count > out.length) out.push(dim(el, "+" + (w.count - out.length) + " more"));
1033
1041
  return out;
1034
1042
  }
1043
+ // BOT-3394 AC-1/AC-2: the session's own push held at the host compute gate —
1044
+ // "⏳ push waiting for host compute · 17× load · 1h 24m" or "⏳ push waiting for
1045
+ // a compute slot · 2 of 3 · 12m" — or null when none is held or BB did not say.
1046
+ function pushAge(fromIso, now) {
1047
+ const mins = Math.max(0, Math.floor((now - Date.parse(fromIso)) / 60000));
1048
+ if (mins < 60) return mins + "m";
1049
+ return Math.floor(mins / 60) + "h" + (mins % 60 ? " " + (mins % 60) + "m" : "");
1050
+ }
1051
+ function loadText(r) {
1052
+ return (r >= 10 ? String(Math.round(r)) : String(Math.round(r * 10) / 10)) + "× load";
1053
+ }
1054
+ function pushWaitText(p, now) {
1055
+ if (!p || typeof p !== "object" || typeof p.since !== "string" || !Number.isFinite(Date.parse(p.since))) return null;
1056
+ const whole = (v) => Number.isSafeInteger(v) && v >= 0;
1057
+ let parts;
1058
+ if (p.reason === "host_load") {
1059
+ parts = ["push waiting for host compute"];
1060
+ if (Number.isFinite(p.load_ratio) && p.load_ratio >= 0) parts.push(loadText(p.load_ratio));
1061
+ } else if (p.reason === "compute_slot") {
1062
+ parts = ["push waiting for a compute slot"];
1063
+ if (whole(p.slot_position) && p.slot_position > 0)
1064
+ parts.push(p.slot_position + (whole(p.waiting_count) && p.waiting_count >= p.slot_position ? " of " + p.waiting_count : ""));
1065
+ } else return null;
1066
+ parts.push(pushAge(p.since, now));
1067
+ return "⏳ " + parts.join(" · ");
1068
+ }
1069
+ function pushWaitBadge(el, key, p, now) {
1070
+ const text = pushWaitText(p, now);
1071
+ if (!text) return [];
1072
+ const { bg, fg } = badgeColors(ICON.violet);
1073
+ const link = el.Link({ href: LINKS.pushes, label: "↗" });
1074
+ if (pills() && typeof el.Svg === "function")
1075
+ return [el.Box({ key: key + "-push", flexDirection: "row", flexShrink: 0, alignItems: "center", columnGap: 1, children: [pillSvg(el, { text, fill: bg }), link] })];
1076
+ return [
1077
+ el.Box({
1078
+ key: key + "-push",
1079
+ flexDirection: "row",
1080
+ flexShrink: 0,
1081
+ backgroundColor: bg,
1082
+ paddingX: 1,
1083
+ children: [el.Text({ color: fg, children: [text + " "] }), link],
1084
+ }),
1085
+ ];
1086
+ }
1035
1087
  // The context alarm's red pill (above 30%), or nothing.
1036
1088
  function contextBadge(el, key) {
1037
1089
  const alarm = contextAlarm(context);
@@ -1337,7 +1389,11 @@ function bandLines(el, $, inPane) {
1337
1389
  ...contextBadge(el, k("line-context")),
1338
1390
  ...uncategorisedBadge(el, k("line-project"), s.epic),
1339
1391
  ];
1340
- const waitsRow = headerRow(el, k("line-waits"), TITLES.waits, widths.ids, waitBadges(el, k("line-context"), s.waits, currentTime));
1392
+ const waitsRow = headerRow(el, k("line-waits"), TITLES.waits, widths.ids, [
1393
+ // BOT-3394: the session's own push held for compute leads its waits.
1394
+ ...pushWaitBadge(el, k("line-waits"), s.push_wait, currentTime),
1395
+ ...waitBadges(el, k("line-context"), s.waits, currentTime),
1396
+ ]);
1341
1397
  const statusRow = headerRow(el, k("line-status"), TITLES.status, widths.ids, statuses);
1342
1398
  if (waitsRow) lines.unshift(waitsRow);
1343
1399
  if (statusRow) lines.unshift(statusRow);
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.91.1",
3
- "source_commit": "944bf88b41b6a484aa22ef54166d4fd0a18dd865",
4
- "source_sha256": "8a66e0afac5f1008e1d0a1615176b31ff6da510d292efd5db2bfb24f201ac71e",
2
+ "release_version": "1.92.0",
3
+ "source_commit": "eb12c35b7497d8f09df520952472c18e6408aa3b",
4
+ "source_sha256": "9a3dd94b97bd47f7933f5b1976304af3bc46ac253a6b767f82aba0dd32f5f485",
5
5
  "target": "darwin-arm64",
6
- "sha256": "d02c6053e9a301f1bcb389b43101fab7b0870c04e9ed5dd1025dcc6bdd2151cd"
6
+ "sha256": "2326c4e2c0e067851d488c64f54e25defa389ba3b2acf68b4c969cbd4bd1e0a1"
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.91.1",
3
- "source_commit": "944bf88b41b6a484aa22ef54166d4fd0a18dd865",
4
- "source_sha256": "8a66e0afac5f1008e1d0a1615176b31ff6da510d292efd5db2bfb24f201ac71e",
2
+ "release_version": "1.92.0",
3
+ "source_commit": "eb12c35b7497d8f09df520952472c18e6408aa3b",
4
+ "source_sha256": "9a3dd94b97bd47f7933f5b1976304af3bc46ac253a6b767f82aba0dd32f5f485",
5
5
  "target": "linux-x64",
6
- "sha256": "bc2a78360a0f1bb7d0550794558831f85e4b0ac86af9e8ef1755324efb7f178b"
6
+ "sha256": "84c3868a88eefcdbbe22f59fe3f0b1c912aecbbb9d6cd6ec4518cf90244e52a8"
7
7
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "release_version": "1.91.1",
4
- "source_commit": "944bf88b41b6a484aa22ef54166d4fd0a18dd865",
5
- "source_sha256": "8a66e0afac5f1008e1d0a1615176b31ff6da510d292efd5db2bfb24f201ac71e",
3
+ "release_version": "1.92.0",
4
+ "source_commit": "eb12c35b7497d8f09df520952472c18e6408aa3b",
5
+ "source_sha256": "9a3dd94b97bd47f7933f5b1976304af3bc46ac253a6b767f82aba0dd32f5f485",
6
6
  "targets": {
7
7
  "darwin-arm64": {
8
8
  "goos": "darwin",
9
9
  "goarch": "arm64",
10
10
  "binary": "daemon/bin/darwin-arm64/botbuddy-daemon",
11
- "sha256": "d02c6053e9a301f1bcb389b43101fab7b0870c04e9ed5dd1025dcc6bdd2151cd",
11
+ "sha256": "2326c4e2c0e067851d488c64f54e25defa389ba3b2acf68b4c969cbd4bd1e0a1",
12
12
  "mode": "0755"
13
13
  },
14
14
  "linux-x64": {
15
15
  "goos": "linux",
16
16
  "goarch": "amd64",
17
17
  "binary": "daemon/bin/linux-x64/botbuddy-daemon",
18
- "sha256": "bc2a78360a0f1bb7d0550794558831f85e4b0ac86af9e8ef1755324efb7f178b",
18
+ "sha256": "84c3868a88eefcdbbe22f59fe3f0b1c912aecbbb9d6cd6ec4518cf90244e52a8",
19
19
  "mode": "0755"
20
20
  }
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbuddy/cli",
3
- "version": "1.91.1",
3
+ "version": "1.92.0",
4
4
  "description": "BotBuddy — Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
package/src/stack.mjs CHANGED
@@ -300,9 +300,10 @@ ${bold("run OPTIONS")}
300
300
  its own systemd unit with a per-run user, on the host's own ports; its
301
301
  output is printed when it ends, and child_resources is its cgroup peak
302
302
  memory and CPU. The requester keeps the lease, the slot and the reap.
303
- --child-requires LIST BOT-3030: what the child needs on a host (comma list: node>=24,curl,psql,
304
- playwright-chromium-libs). A host lacking one is not placed on; the
305
- child runs here and the run names what was missing.
303
+ --child-requires LIST BOT-3030: what the child needs on a host (comma list: node>=24,pnpm,deno,
304
+ curl,psql,playwright-chromium-libs). node, pnpm and deno count only when
305
+ they run inside a child's sandbox on that host (BOT-3402). A host lacking
306
+ one is not placed on; the child runs here and the run names what was missing.
306
307
  --child-env NAME BOT-3030: pass NAME (this shell's value) to a host child (repeatable).
307
308
  Nothing else is passed; credential-shaped names are refused.
308
309
  --child-max-runtime S BOT-3030: the host stops the child after S seconds (default 3600).
@@ -124,6 +124,19 @@ function waitsOf(own) {
124
124
  .map((i) => ({ id: i.id.toLowerCase(), label: safeText(i.label).slice(0, 40), created_at: new Date(i.created_at).toISOString() }));
125
125
  return { count: w.active, oldest_at: new Date(w.oldest_at).toISOString(), items };
126
126
  }
127
+ // BOT-3394 AC-1/AC-2: the session's own push held at the compute gate, for the
128
+ // band's WAITS row; null when none, from an older BB, or anything malformed.
129
+ function pushWaitOf(own) {
130
+ const p = own?.push_wait;
131
+ if (!p || typeof p !== "object" || !["host_load", "compute_slot"].includes(p.reason)) return null;
132
+ if (typeof p.waiting_since !== "string" || !Number.isFinite(Date.parse(p.waiting_since))) return null;
133
+ const count = (v) => (v == null ? null : Number.isSafeInteger(v) && v >= 0 && v <= 999 ? v : undefined);
134
+ const ratio = p.load_ratio == null ? null : Number.isFinite(p.load_ratio) && p.load_ratio >= 0 && p.load_ratio < 10000 ? p.load_ratio : undefined;
135
+ const position = count(p.slot_position);
136
+ const waiting = count(p.waiting_count);
137
+ if (ratio === undefined || position === undefined || waiting === undefined) return null;
138
+ return { reason: p.reason, load_ratio: ratio, slot_position: position, waiting_count: waiting, since: new Date(p.waiting_since).toISOString() };
139
+ }
127
140
  function refuse(code, extra = {}) {
128
141
  throw Object.assign(new Error(code), extra);
129
142
  }
@@ -612,6 +625,9 @@ export async function readStatus({
612
625
  epic_unreadable: useSession ? false : !skipEpic && !Array.isArray(epicHealth?.epics),
613
626
  staging: ownOk ? stagingOf(own) : null,
614
627
  waits: ownOk ? waitsOf(own) : null,
628
+ // BOT-3394: absent when BB did not say (an older server), so the band knows
629
+ // whether a quiet timeout should re-read for a hold that began after this read.
630
+ ...(ownOk && "push_wait" in own ? { push_wait: pushWaitOf(own) } : {}),
615
631
  // BOT-3136: where the tickets came from — the registered session, an explicit
616
632
  // pick, or (only when the session registered none) a guess from the branch.
617
633
  binding: bindingKind,
@@ -20,13 +20,16 @@ const PROJECT = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
20
20
  const STAGING = "event:type=staging_incident";
21
21
  // BOT-3212 AC-2: the waits badge wakes when one of the agent's own waits starts or ends.
22
22
  const AGENT_WAITS = `event:type=agent_wait,subject=${PROJECT}`;
23
+ // BOT-3394: no signal says a held pre-push lane started, so while the band shows
24
+ // one it re-reads on this one fixed timer (the platform gap is ticketed).
25
+ export const PUSH_WAIT_TIMER = "timer:duration=60";
23
26
  const CONDITION = new RegExp(
24
- `^(?:linear:issue=${KEY}|unblocked:${KEY}|pr-(?:state|review):repo=${REPO},pr=[1-9]\\d{0,6}|event:type=linear_project,subject=${PROJECT}|${STAGING}|${AGENT_WAITS})$`,
27
+ `^(?:linear:issue=${KEY}|unblocked:${KEY}|pr-(?:state|review):repo=${REPO},pr=[1-9]\\d{0,6}|event:type=linear_project,subject=${PROJECT}|${STAGING}|${AGENT_WAITS}|${PUSH_WAIT_TIMER})$`,
25
28
  );
26
29
  const CURSOR = /^\d{1,16}$/;
27
30
  // The band's largest list: 5 tickets, 5 PRs (state + review), blockers, epic,
28
- // staging and the agent's own waits (BOT-3212).
29
- const MAX_CONDITIONS = 19;
31
+ // staging, the agent's own waits (BOT-3212) and the held-push timer (BOT-3394).
32
+ const MAX_CONDITIONS = 20;
30
33
  export const CLI_ENTRY = join(resolve(dirname(fileURLToPath(import.meta.url)), ".."), "bin", "botbuddy.mjs");
31
34
 
32
35
  function invalid() {