@botbuddy/cli 1.109.0 → 1.110.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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.110.0
4
+
5
+ - 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.
6
+
3
7
  ## 1.108.0
4
8
 
5
9
  - 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.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.109.0",
3
- "source_commit": "657abfe1b8b9be22c3a9c6500e267d81d6d74cc2",
4
- "source_sha256": "39d0be4c288a6a187241be394ba0f6d2d058edb2fcf63c08b4d54404b8f2c77c",
2
+ "release_version": "1.110.0",
3
+ "source_commit": "62787041db72a2944b3abd150da2629cd6f2d4f7",
4
+ "source_sha256": "362a9e2dac87e39790748eccfd742254cf89a8177bd06184d6a3ef643d6e9d19",
5
5
  "target": "darwin-arm64",
6
- "sha256": "72f29fd91b98c53661c1bd37dbc92772b46d5c4a6cf5b27af3f0c6f251d10976"
6
+ "sha256": "445643f5f93d639933ea9fd4beb4a2da1cda84c8a3f38905cf49c186aedf6d28"
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.110.0",
3
+ "source_commit": "62787041db72a2944b3abd150da2629cd6f2d4f7",
4
+ "source_sha256": "362a9e2dac87e39790748eccfd742254cf89a8177bd06184d6a3ef643d6e9d19",
5
5
  "target": "linux-x64",
6
- "sha256": "35abb00a5e1a80c535cad8d9808baa470cebbc0f6ebfd388b7c5b033ba405354"
6
+ "sha256": "738a3cb5e55c0716cec11eb3d126f8725128f71acce2bc41eb8e86f8b5781e95"
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.110.0",
4
+ "source_commit": "62787041db72a2944b3abd150da2629cd6f2d4f7",
5
+ "source_sha256": "362a9e2dac87e39790748eccfd742254cf89a8177bd06184d6a3ef643d6e9d19",
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": "445643f5f93d639933ea9fd4beb4a2da1cda84c8a3f38905cf49c186aedf6d28",
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": "738a3cb5e55c0716cec11eb3d126f8725128f71acce2bc41eb8e86f8b5781e95",
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.110.0",
4
4
  "description": "BotBuddy — Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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
  }