@botbuddy/cli 1.99.0 → 1.101.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 +3 -0
- package/daemon/bin/darwin-arm64/botbuddy-daemon +0 -0
- package/daemon/bin/linux-x64/botbuddy-daemon +0 -0
- package/daemon-release/darwin-arm64.json +4 -4
- package/daemon-release/linux-x64.json +4 -4
- package/daemon-release/manifest.json +5 -5
- package/package.json +1 -1
- package/src/host-toolchain.mjs +19 -0
- package/src/release-notes.mjs +18 -1
- package/src/stack.mjs +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.100.0
|
|
4
|
+
|
|
5
|
+
- BOT-3396: a repo that commits `.botbuddy/child-layer.json` gets a dependency layer for its host test children. The manifest names `inputs` (files or `dir/*` patterns from the head), `build` (argv commands), `outputs` (workspace directories), optional `scratch` (per-run writable directories inside an output) and optional `env` (variables that point at a path inside an output). The host daemon keys the layer by the sha256 of the manifest, every matched input, the repo's toolchain digest and the host architecture; builds it once per tenant and digest in a sandboxed unit (DynamicUser, `ProtectSystem=strict`, the tenant's toolchain on `PATH`) into `/var/lib/private/bb-deplayer/<tenant>/<digest>`; and binds each output read-only into the child at the same workspace path, so relative links resolve into the child's own source. A write into an output fails (`EROFS`); each `scratch` path is a fresh per-run tmpfs. A repeat run on the same digest starts no build unit. The terminal report's `child_resources.preparation` carries the preparation seconds, `toolchain` (`none`, `reused`, `installed`) and `dependency_layer` (`digest`, `state` built or reused, `seconds`, `size_bytes`). Hosts report the `child-layer` capability and `dependency_layers` (count, bytes, in use, evicted; no tenant detail); `bb stack run --test-child` requires `child-layer` when the head commits the manifest. Failures end the run before any child starts: `CHILD_LAYER_MANIFEST_INVALID`, `CHILD_LAYER_BUILD_FAILED` (naming the failing step, with the log tail), `CHILD_LAYER_BUILD_TIMEOUT`, `CHILD_LAYER_QUOTA_EXCEEDED`, `CHILD_LAYER_DISK_FLOOR`, `CHILD_LAYER_UNAVAILABLE`. Each tenant may hold 24 GiB of layers per host; one held by a running child is never removed, and one unused for 14 days is.
|
|
3
6
|
## 1.99.0
|
|
4
7
|
|
|
5
8
|
- BOT-3408: `bb daemon upgrade` takes `"testChild":{"enabled":true}` (optionally `"maxRuns":1..4`) to switch test children on for a handover-pinned host, and `"testChild":{"enabled":false}` to switch them off. The host's daemon changes only the `test_child` member of its `daemon.json`, after the server has fenced the plan that pins the amended digest, and the ordinary handover re-pins it; nobody edits the file by hand. Switching off removes the member and restores the earlier bytes, so the digest is the earlier pin again. The block carries no runtime path and no tool version. Enabling is refused when the running daemon is older than 1.90.0 (`daemon_test_child_previous_daemon_too_old`). On a host with automatic updates, add `"refreshAutomaticBinding":true` to re-install the updater binding against the new digest in the same command (`daemon_test_child_automatic_binding_refresh_required` without it). `"preview":true` reports both digests and changes nothing. A refused submission puts the earlier bytes back; other refusals are `daemon_test_child_amend_refused: <CODE>` (for example `TEST_CHILD_COORDINATOR_TOO_OLD` when the host's installed updater coordinator predates 1.90.0: run `bb daemon updater-install` first).
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.101.0",
|
|
3
|
+
"source_commit": "fe31848ab60717cd81e7d09194e38557e51697c0",
|
|
4
|
+
"source_sha256": "70d8fef40270425afa97de992ec6631308ccd9b2d7a63a551c8e4f5afd3c1d9c",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "f1c8546000bdf6ebc23a7a36a864f531fd6b45de287ddd87fc09e85309d48ce7"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.101.0",
|
|
3
|
+
"source_commit": "fe31848ab60717cd81e7d09194e38557e51697c0",
|
|
4
|
+
"source_sha256": "70d8fef40270425afa97de992ec6631308ccd9b2d7a63a551c8e4f5afd3c1d9c",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "3a3af0b49e15c90e6d88491c1f0c91e9889f0cddb404121c853348e53fc685a8"
|
|
7
7
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema_version": 1,
|
|
3
|
-
"release_version": "1.
|
|
4
|
-
"source_commit": "
|
|
5
|
-
"source_sha256": "
|
|
3
|
+
"release_version": "1.101.0",
|
|
4
|
+
"source_commit": "fe31848ab60717cd81e7d09194e38557e51697c0",
|
|
5
|
+
"source_sha256": "70d8fef40270425afa97de992ec6631308ccd9b2d7a63a551c8e4f5afd3c1d9c",
|
|
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": "
|
|
11
|
+
"sha256": "f1c8546000bdf6ebc23a7a36a864f531fd6b45de287ddd87fc09e85309d48ce7",
|
|
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": "
|
|
18
|
+
"sha256": "3a3af0b49e15c90e6d88491c1f0c91e9889f0cddb404121c853348e53fc685a8",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/host-toolchain.mjs
CHANGED
|
@@ -108,3 +108,22 @@ export function toolchainConflictError(conflicts) {
|
|
|
108
108
|
const each = conflicts.map((c) => `--child-requires ${c.prerequisite}, but this head's mise.lock declares ${c.tool} ${c.declared ?? "with no readable version"}`);
|
|
109
109
|
return `${each.join("; ")}. The manifest's tools come first in a host child, so change mise.toml and mise.lock, or the requirement.`;
|
|
110
110
|
}
|
|
111
|
+
|
|
112
|
+
// BOT-3396 — the dependency layer a repo declares in `.botbuddy/child-layer.json`. The host
|
|
113
|
+
// builds it from the head bundle; the requester only asks placement for a host that can.
|
|
114
|
+
export const CHILD_LAYER_CAPABILITY = "child-layer";
|
|
115
|
+
const CHILD_LAYER_MANIFEST = ".botbuddy/child-layer.json";
|
|
116
|
+
|
|
117
|
+
/** Whether HEAD commits a dependency-layer manifest (only the committed head is shipped). */
|
|
118
|
+
export function headDeclaresChildLayer(worktreeRoot, { run = spawnSync } = {}) {
|
|
119
|
+
// nosemgrep: javascript.lang.security.detect-child-process.detect-child-process -- fixed argv, no shell.
|
|
120
|
+
const probe = run("git", ["-C", worktreeRoot, "cat-file", "-e", `HEAD:${CHILD_LAYER_MANIFEST}`], { encoding: "utf8" });
|
|
121
|
+
return probe.status === 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Placement prerequisites with `child-layer` added when the head declares a layer. */
|
|
125
|
+
export function childLayerPrerequisites(prerequisites, declaresLayer) {
|
|
126
|
+
const wanted = [...(prerequisites ?? [])];
|
|
127
|
+
if (declaresLayer && !wanted.includes(CHILD_LAYER_CAPABILITY)) wanted.push(CHILD_LAYER_CAPABILITY);
|
|
128
|
+
return wanted;
|
|
129
|
+
}
|
package/src/release-notes.mjs
CHANGED
|
@@ -60,7 +60,9 @@ customer needs and the receipt prints them (or why they are unavailable).
|
|
|
60
60
|
Each field, with a good and a bad example: docs/release-notes/pack-fields.md.
|
|
61
61
|
|
|
62
62
|
Submitting the same source_key again updates the note and adds a revision.
|
|
63
|
-
An unchanged resubmit (a retry) adds none.
|
|
63
|
+
An unchanged resubmit (a retry) adds none. The receipt and get show the
|
|
64
|
+
binding: the pull request (number, status, merge SHA, URL), or unbound and
|
|
65
|
+
why. A refusal names its code
|
|
64
66
|
(schema_invalid, type_unknown, markup_refused, link_refused,
|
|
65
67
|
entitlement_missing, pack_field_missing) and stores nothing.
|
|
66
68
|
|
|
@@ -217,11 +219,13 @@ export async function cmdReleaseNotes(args, {
|
|
|
217
219
|
const receipt = {
|
|
218
220
|
ok: true, source_key: data.source_key, state: data.state, revision: data.revision, created: data.created === true, changed: data.changed === true, tenant: data.tenant ?? null,
|
|
219
221
|
...(data.customers && typeof data.customers === "object" ? { customers: data.customers } : {}),
|
|
222
|
+
...(isBinding(data.binding) ? { binding: data.binding } : {}),
|
|
220
223
|
};
|
|
221
224
|
if (json) log(JSON.stringify(receipt));
|
|
222
225
|
else {
|
|
223
226
|
const what = receipt.created ? "stored" : receipt.changed ? "updated" : "unchanged (no new revision)";
|
|
224
227
|
log(`Release note ${receipt.source_key} ${what}: state ${receipt.state}, revision ${receipt.revision}${receipt.tenant ? `, tenant ${receipt.tenant}` : ""}.`);
|
|
228
|
+
if (receipt.binding) log(termClean(describeBinding(receipt.binding)));
|
|
225
229
|
if (receipt.customers) log(describeCustomers(receipt.customers));
|
|
226
230
|
}
|
|
227
231
|
return CALL_EXIT.OK;
|
|
@@ -247,6 +251,18 @@ export async function cmdReleaseNotes(args, {
|
|
|
247
251
|
return CALL_EXIT.ERROR;
|
|
248
252
|
}
|
|
249
253
|
|
|
254
|
+
/** BOT-3358: the server's binding is shown as sent; the CLI never derives one. */
|
|
255
|
+
function isBinding(b) {
|
|
256
|
+
return !!b && typeof b === "object" && typeof b.status === "string";
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** BOT-3358: where the note is bound, in one line: the pull request, or unbound and why. */
|
|
260
|
+
export function describeBinding(b) {
|
|
261
|
+
if (b.status === "unbound") return `Binding: unbound. ${b.reason ?? "BotBuddy did not say why."}`;
|
|
262
|
+
const merge = b.merge_sha ? `, merge ${b.merge_sha}` : "";
|
|
263
|
+
return `Binding: PR #${b.pr} (${b.status}${merge}) ${b.url}`;
|
|
264
|
+
}
|
|
265
|
+
|
|
250
266
|
/** BOT-3260: the receipt's derived customers in one line. "none" only when Linear said so. */
|
|
251
267
|
export function describeCustomers(c) {
|
|
252
268
|
const tickets = Array.isArray(c.tickets) && c.tickets.length ? c.tickets.join(", ") : "no linked ticket";
|
|
@@ -764,6 +780,7 @@ async function cmdGet(argv, deps) {
|
|
|
764
780
|
const text = data.text ?? {};
|
|
765
781
|
const links = (list) => (Array.isArray(list) ? list.map((l) => ` - ${l.name} · ${l.url}`) : []);
|
|
766
782
|
const lines = [`${n.source_key} · ${n.type} · ${n.state} · ${revisionsWord(n.revisions)}`];
|
|
783
|
+
if (isBinding(data.binding)) lines.push(describeBinding(data.binding));
|
|
767
784
|
const tags = tagLine(n.tags);
|
|
768
785
|
if (tags) lines.push(`Tags: ${tags}`);
|
|
769
786
|
lines.push("", `Internal: ${n.internal?.title ?? ""}`, text.internal ?? "");
|
package/src/stack.mjs
CHANGED
|
@@ -64,7 +64,7 @@ import { REQUESTER_NETWORK_CANDIDATE_CODES, REQUESTER_NETWORK_LOST_CODE, createR
|
|
|
64
64
|
import { provisionFailureFields, provisionFailureLine } from "./stack-provision-failure.mjs";
|
|
65
65
|
import { hostChildApi, hostChildReceiptFields, startHostChild, childEnvFrom, HOST_CHILD_DEFAULT_MAX_RUNTIME_S } from "./host-child.mjs";
|
|
66
66
|
import { HOST_CHILD_ARTIFACT_GLOBS_MAX, returnHostChildArtifacts, validateChildArtifactGlob } from "./host-child-artifacts.mjs";
|
|
67
|
-
import { headToolchain, toolchainConflictError, toolchainPrerequisites } from "./host-toolchain.mjs";
|
|
67
|
+
import { childLayerPrerequisites, headDeclaresChildLayer, headToolchain, toolchainConflictError, toolchainPrerequisites } from "./host-toolchain.mjs";
|
|
68
68
|
import { acquireTestChildSlot, CHILD_PLACEMENT_REQUIRED, defaultTestChildWait, readPs, requesterSample, startChildSampler, testChildApi, testChildReceiptFields } from "./test-child.mjs";
|
|
69
69
|
|
|
70
70
|
export const STACK_SCHEMA_VERSION = 1;
|
|
@@ -5592,11 +5592,15 @@ async function runStackLifecycleOnce(opts, childArgv, adapters, incidentBox) {
|
|
|
5592
5592
|
const toolchain = toolchainPrerequisites(opts.childRequires, head);
|
|
5593
5593
|
if (head.manifest) stderrLine(`stack: this head declares its toolchain (mise.toml, mise.lock): placement requires a host with \`toolchain\`${toolchain.provided.length ? `; ${toolchain.provided.join(", ")} come from the manifest` : ""}`);
|
|
5594
5594
|
else if (head.lockMissing) stderrLine("stack: this head commits mise.toml without mise.lock, so a host builds no toolchain for it; run `mise lock` and commit mise.lock to give host children the repo's own tools");
|
|
5595
|
+
// BOT-3396: a head that commits .botbuddy/child-layer.json needs a host that builds it.
|
|
5596
|
+
const declaresLayer = (adapters.headDeclaresChildLayer ?? headDeclaresChildLayer)(execution.worktreeRoot);
|
|
5597
|
+
if (declaresLayer) stderrLine("stack: this head declares a dependency layer (.botbuddy/child-layer.json): placement requires a host with `child-layer`");
|
|
5598
|
+
const prerequisites = childLayerPrerequisites(toolchain.prerequisites, declaresLayer);
|
|
5595
5599
|
testChildWaitAbort = new AbortController();
|
|
5596
5600
|
try {
|
|
5597
5601
|
placed = await acquireTestChildSlot({
|
|
5598
5602
|
signal: testChildWaitAbort.signal,
|
|
5599
|
-
api: testChildCalls, leaseId, wait: adapters.testChildWait ?? defaultTestChildWait, log: stderrLine, prerequisites
|
|
5603
|
+
api: testChildCalls, leaseId, wait: adapters.testChildWait ?? defaultTestChildWait, log: stderrLine, prerequisites,
|
|
5600
5604
|
isStopped: () => Boolean(receivedSignal || tunnelLost || callbackLost || originLost),
|
|
5601
5605
|
onPark: touchWhileWaiting, requireHost: opts.childPlacement === "require-host",
|
|
5602
5606
|
});
|