@botbuddy/cli 1.109.0 โ†’ 1.111.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.111.0
4
+
5
+ - BOT-3501: the bb-status band's STATUS row shows the Docker queue as the web top bar does, `๐Ÿ“ฆ N queued` (queued stack leases plus capacity waiters), linked to /docker's Queue, so an operator can see whether a new session would wait for a host. BB sends the count only to an operator (`get_session_status.docker_queue`, MCP 2.152.0); nothing shows at zero, for anyone else, or from an older server.
6
+
7
+ ## 1.110.0
8
+
9
+ - BOT-3363 (PR 3 of 3): a host test child goes through the host's memory admission ledger, the same one stack leases ask. When the ledger holds a child, `bb stack run --test-child` prints `<host>'s memory admission ledger does not admit the child yet (<code>: it needs X GiB, Y GiB free under the ceiling, cost learned|default) โ€” waiting (no slot is held while waiting)` and waits on the pool's platform wait (a slot release, or the server's re-check deadline at most 60 s away); a child whose cost is above the host's ceiling stops at once with `ADMISSION_COST_EXCEEDS_CEILING` and its receipt. The fleet host daemon takes no new test child while the host is below its local disk or memory floor (the claim is a peek, so the run keeps its place; the log line is BOT-2849's `memory admission: deferred test-child โ€ฆ`), and sets the child unit's `MemoryMax` to its reservation when the claim carries one (an enforced, learned reservation). Needs MCP 2.151.0.
10
+
3
11
  ## 1.108.0
4
12
 
5
13
  - BOT-3399: a callback suite can run as a test child on its stack's fleet host. `bb stack run --test-child --child-placement require-host --callback-port N` asks for no requester callback route and no requester origin: the stack keeps its own host-local auth origin (GoTrue's external URL is the host's `127.0.0.1:<api port>`), and the port is declared on the host run. The host daemon proves the route before the child starts: it listens where the lease's own edge runtime resolves `host.docker.internal`, admits only that container, and forwards to the child's `127.0.0.1:N` (`BOTBUDDY_CALLBACK_PORT`, `BOTBUDDY_CALLBACK_LISTEN`). The relay runs inside the child's unit, so the route lives exactly as long as the child. A route that cannot be set up (for example the port is in use) fails the run with `HOST_CALLBACK_ROUTE_UNAVAILABLE` before the child starts, and the receipt shows `callback_transport: host_local_v1`. A prefer-host callback child that lands on the serving host is now refused with `HOST_CALLBACK_ROUTE_UNAVAILABLE` instead of running with a route that leads back to this machine. Placement asks for a host that advertises `host-local-callback`, so a host on an older daemon never starts such a child without its route. Needs MCP 2.149.0 and this daemon on the host.
@@ -11,7 +11,7 @@
11
11
  "name": "bb-status",
12
12
  "source": "./bb-status",
13
13
  "description": "BB session status above the prompt: tickets, PRs with review counts, epic, staging, context use and active waits, for BotBuddy and Supply Guard sessions",
14
- "version": "1.9.0"
14
+ "version": "1.10.0"
15
15
  },
16
16
  {
17
17
  "name": "bb-session",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bb-status",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "BB session status above the prompt: tickets, PRs with review counts, epic, staging, context use and active waits, live only while the session is on screen.",
5
5
  "author": {
6
6
  "name": "BotBuddy"
@@ -316,6 +316,8 @@ const LINKS = {
316
316
  pushes: APP + "/waits",
317
317
  // BOT-3152 AC-2: the web top bar's Staging chip link (STAGING_HREF).
318
318
  staging: APP + "/release-readiness/staging/latest",
319
+ // BOT-3501: the web top bar's Docker queue chip link (the /docker Queue section).
320
+ dockerQueue: APP + "/docker#docker-queue",
319
321
  };
320
322
  // The โ†— after an id goes straight to the source: Linear for tickets and the
321
323
  // epic, GitHub for PRs. Each tenant's tickets live in its own Linear workspace.
@@ -541,7 +543,10 @@ function waitConditions(s) {
541
543
  // BOT-3394: no signal says a held pre-push lane started, so while a push is
542
544
  // held the relay also wakes on a one-minute timer and the badge drops on the
543
545
  // next read. A platform gap (no execution-run signal), not a poll loop.
544
- const timer = pushWaitText(s.push_wait, currentTime) ? ["timer:duration=60"] : [];
546
+ // BOT-3501 (Codex P2 on #1893): nor does any signal say the host-global Docker
547
+ // queue changed, so while BB sends an operator's docker_queue (zero and null
548
+ // included) the same timer re-reads it, as the web chip polls. One timer for both.
549
+ const timer = pushWaitText(s.push_wait, currentTime) || s.docker_queue !== undefined ? ["timer:duration=60"] : [];
545
550
  // At most 5 tickets, the agent's waits, 5 PRs (state + review), blockers, epic,
546
551
  // staging and the held-push timer: 20, the relay's limit, so no wake is ever
547
552
  // dropped (review on #1616, round 4; BOT-3212; BOT-3394).
@@ -1158,6 +1163,29 @@ function uncategorisedBadge(el, key, epic) {
1158
1163
  }),
1159
1164
  ];
1160
1165
  }
1166
+ // BOT-3501: the web top bar's Docker queue chip in the STATUS row โ€” queued stack
1167
+ // leases plus capacity waiters, "๐Ÿ“ฆ N queued", amber, โ†— to /docker's Queue. BB
1168
+ // sends the count only to an operator; nothing at zero, unknown or malformed.
1169
+ function dockerQueueBadge(el, key, q) {
1170
+ const ok = (v) => Number.isSafeInteger(v) && v >= 0;
1171
+ if (!q || typeof q !== "object" || !ok(q.stack_queued) || !ok(q.capacity_queued)) return [];
1172
+ const n = q.stack_queued + q.capacity_queued;
1173
+ if (n < 1) return [];
1174
+ const text = "๐Ÿ“ฆ " + n + " queued";
1175
+ const link = el.Link({ href: LINKS.dockerQueue, label: "โ†—" });
1176
+ if (pills() && typeof el.Svg === "function")
1177
+ return [el.Box({ key: key + "-docker-queue", flexDirection: "row", flexShrink: 0, alignItems: "center", columnGap: 1, children: [pillSvg(el, { text, fill: AMBER, bold: true }), link] })];
1178
+ return [
1179
+ el.Box({
1180
+ key: key + "-docker-queue",
1181
+ flexDirection: "row",
1182
+ flexShrink: 0,
1183
+ backgroundColor: AMBER,
1184
+ paddingX: 1,
1185
+ children: [el.Text({ color: "#ffffff", bold: true, children: [text + " "] }), link],
1186
+ }),
1187
+ ];
1188
+ }
1161
1189
  // BOT-3245: statuses and waits are separate, titled rows on the tree's grid
1162
1190
  // (Jono, 2026-11-15: "Staging green is a wait. Staging red is a status."). The
1163
1191
  // title fills the id column; the badges start in the status-badge column and
@@ -1473,6 +1501,8 @@ function bandLines(el, $, inPane) {
1473
1501
  ...(s.staging?.red ? [stagingBanner(el, $, k("line-staging"), s.staging.since, s.staging.release_manager)] : []),
1474
1502
  ...contextBadge(el, k("line-context")),
1475
1503
  ...uncategorisedBadge(el, k("line-project"), s.epic),
1504
+ // BOT-3501: whether a new session would join a host queue.
1505
+ ...dockerQueueBadge(el, k("line-status"), s.docker_queue),
1476
1506
  ];
1477
1507
  const waitsRow = headerRow(el, k("line-waits"), TITLES.waits, widths.ids, [
1478
1508
  // BOT-3394: the session's own push held for compute leads its waits.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.109.0",
3
- "source_commit": "657abfe1b8b9be22c3a9c6500e267d81d6d74cc2",
4
- "source_sha256": "39d0be4c288a6a187241be394ba0f6d2d058edb2fcf63c08b4d54404b8f2c77c",
2
+ "release_version": "1.111.0",
3
+ "source_commit": "e535ac011ab3e80c350d5c34818d32c45874027e",
4
+ "source_sha256": "e60de0a865bcb5fc2c037089a52fc6d3fe6b2933cc34ddd4df55778cff19341e",
5
5
  "target": "darwin-arm64",
6
- "sha256": "72f29fd91b98c53661c1bd37dbc92772b46d5c4a6cf5b27af3f0c6f251d10976"
6
+ "sha256": "82e57baa52b665ae624396d535db23c2de3cdf1e7c352276fe6d4a61d9891a5f"
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.109.0",
3
- "source_commit": "657abfe1b8b9be22c3a9c6500e267d81d6d74cc2",
4
- "source_sha256": "39d0be4c288a6a187241be394ba0f6d2d058edb2fcf63c08b4d54404b8f2c77c",
2
+ "release_version": "1.111.0",
3
+ "source_commit": "e535ac011ab3e80c350d5c34818d32c45874027e",
4
+ "source_sha256": "e60de0a865bcb5fc2c037089a52fc6d3fe6b2933cc34ddd4df55778cff19341e",
5
5
  "target": "linux-x64",
6
- "sha256": "35abb00a5e1a80c535cad8d9808baa470cebbc0f6ebfd388b7c5b033ba405354"
6
+ "sha256": "aa94920b442ad5cdd1b6d0210bb6e2739c1e86ebb7614851f6a4bc348ab19022"
7
7
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "release_version": "1.109.0",
4
- "source_commit": "657abfe1b8b9be22c3a9c6500e267d81d6d74cc2",
5
- "source_sha256": "39d0be4c288a6a187241be394ba0f6d2d058edb2fcf63c08b4d54404b8f2c77c",
3
+ "release_version": "1.111.0",
4
+ "source_commit": "e535ac011ab3e80c350d5c34818d32c45874027e",
5
+ "source_sha256": "e60de0a865bcb5fc2c037089a52fc6d3fe6b2933cc34ddd4df55778cff19341e",
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": "72f29fd91b98c53661c1bd37dbc92772b46d5c4a6cf5b27af3f0c6f251d10976",
11
+ "sha256": "82e57baa52b665ae624396d535db23c2de3cdf1e7c352276fe6d4a61d9891a5f",
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": "35abb00a5e1a80c535cad8d9808baa470cebbc0f6ebfd388b7c5b033ba405354",
18
+ "sha256": "aa94920b442ad5cdd1b6d0210bb6e2739c1e86ebb7614851f6a4bc348ab19022",
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.109.0",
3
+ "version": "1.111.0",
4
4
  "description": "BotBuddy โ€” Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -155,6 +155,15 @@ function pushWaitOf(own) {
155
155
  if (ratio === undefined || position === undefined || waiting === undefined) return null;
156
156
  return { reason: p.reason, load_ratio: ratio, slot_position: position, waiting_count: waiting, since: new Date(p.waiting_since).toISOString() };
157
157
  }
158
+ // BOT-3501: the web top bar's Docker queue count (queued stack leases and
159
+ // capacity waiters), which BB sends only to an operator; null when BB could not
160
+ // read it or sent anything malformed.
161
+ function dockerQueueOf(own) {
162
+ const q = own?.docker_queue;
163
+ const n = (v) => Number.isSafeInteger(v) && v >= 0 && v <= 99999;
164
+ if (!q || typeof q !== "object" || !n(q.stack_queued) || !n(q.capacity_queued)) return null;
165
+ return { stack_queued: q.stack_queued, capacity_queued: q.capacity_queued };
166
+ }
158
167
  function refuse(code, extra = {}) {
159
168
  throw Object.assign(new Error(code), extra);
160
169
  }
@@ -657,6 +666,8 @@ export async function readStatus({
657
666
  // BOT-3394: absent when BB did not say (an older server), so the band knows
658
667
  // whether a quiet timeout should re-read for a hold that began after this read.
659
668
  ...(ownOk && "push_wait" in own ? { push_wait: pushWaitOf(own) } : {}),
669
+ // BOT-3501: absent for a non-operator owner or an older server (no badge).
670
+ ...(ownOk && "docker_queue" in own ? { docker_queue: dockerQueueOf(own) } : {}),
660
671
  // BOT-3136: where the tickets came from โ€” the registered session, an explicit
661
672
  // pick, or (only when the session registered none) a guess from the branch.
662
673
  binding: bindingKind,
@@ -93,6 +93,16 @@ export function defaultTestChildWait(target, { bin = process.execPath, cli = pro
93
93
  * Returns `{ ok: true, slotId, ttlSeconds, placement, waits }` or
94
94
  * `{ ok: false, code, error, placement?, waits }`. Never throws.
95
95
  */
96
+ const gib = (bytes) => (Number.isFinite(Number(bytes)) ? `${(Number(bytes) / 1024 ** 3).toFixed(2)} GiB` : "unknown");
97
+
98
+ /** BOT-3363: the one line a run prints when the host's memory admission ledger holds its child. */
99
+ export function admissionWaitLine(data) {
100
+ const a = data?.admission ?? {};
101
+ return `stack: ${TEST_CHILD_CAPACITY}: ${data?.run_host ?? "the run host"}'s memory admission ledger does not admit the child yet `
102
+ + `(${data?.admission_code ?? a.code ?? "unknown"}: it needs ${gib(a.cost_bytes)}, ${gib(a.free_before_bytes)} free under the ceiling`
103
+ + `${a.cost_source ? `, cost ${a.cost_source}` : ""}) โ€” waiting (no slot is held while waiting)`;
104
+ }
105
+
96
106
  /** BOT-3398: why a require-host child was refused, in the words of the placement. */
97
107
  export function requiredHostError(placement) {
98
108
  const missing = Array.isArray(placement?.missing_prerequisites) && placement.missing_prerequisites.length
@@ -138,9 +148,11 @@ export async function acquireTestChildSlot({ api, leaseId, wait = defaultTestChi
138
148
  const expiryMs = Date.parse(data.next_expiry_at ?? "");
139
149
  const deadline = Number.isFinite(expiryMs) ? new Date(expiryMs).toISOString() : new Date(Date.now() + FALLBACK_PARK_MS).toISOString();
140
150
  if (waits.length === 0) {
141
- log(`stack: ${TEST_CHILD_CAPACITY}: all ${data.slots} test_child slot(s) on ${data.run_host} are held โ€” waiting (no slot is held while waiting)${data.limit ? ` ยท limit: ${data.limit}` : ""}`);
151
+ log(data.limit === "admission" ? admissionWaitLine(data)
152
+ : `stack: ${TEST_CHILD_CAPACITY}: all ${data.slots} test_child slot(s) on ${data.run_host} are held โ€” waiting (no slot is held while waiting)${data.limit ? ` ยท limit: ${data.limit}` : ""}`);
142
153
  }
143
- waits.push({ at: new Date().toISOString(), held: data.held ?? null, slots: data.slots ?? null, run_host: data.run_host ?? null });
154
+ waits.push({ at: new Date().toISOString(), held: data.held ?? null, slots: data.slots ?? null, run_host: data.run_host ?? null,
155
+ ...(data.limit === "admission" ? { admission_code: data.admission_code ?? data.admission?.code ?? null } : {}) });
144
156
  if (waits.length > maxWaits || isStopped()) {
145
157
  return { ok: false, code: TEST_CHILD_CAPACITY, waits, error: `all test_child slots on ${data.run_host} stayed held` };
146
158
  }
@@ -160,7 +172,8 @@ export async function acquireTestChildSlot({ api, leaseId, wait = defaultTestChi
160
172
  continue;
161
173
  }
162
174
  const code = data?.code ?? TEST_CHILD_UNAVAILABLE;
163
- return { ok: false, code, waits, placement: data?.child_placement ?? null,
175
+ // BOT-3363: a typed ledger refusal (ADMISSION_COST_EXCEEDS_CEILING) carries its receipt.
176
+ return { ok: false, code, waits, placement: data?.child_placement ?? null, ...(data?.admission ? { admission: data.admission } : {}),
164
177
  error: `the control plane did not place the test child, so it was not started (${data?.message ?? data?.error ?? answer?.error ?? "no answer"})` };
165
178
  }
166
179
  }