@botbuddy/cli 1.99.0 → 1.100.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/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.100.0",
|
|
3
|
+
"source_commit": "39c24e447c2d995e4532704177e87ff25d841401",
|
|
4
|
+
"source_sha256": "938be544bd8b0b5f68ca0373b05dba171ac066b240660b75ba639b3e5ae97cdc",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "3a331708c5fa0f5a8bd8b8c7da4a58d05329507353be436e577fd6bf1c0aac08"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.100.0",
|
|
3
|
+
"source_commit": "39c24e447c2d995e4532704177e87ff25d841401",
|
|
4
|
+
"source_sha256": "938be544bd8b0b5f68ca0373b05dba171ac066b240660b75ba639b3e5ae97cdc",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "5473e029d35c4b338ef1216478839259b84213112e3db28333ebdcd73e3e0c79"
|
|
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.100.0",
|
|
4
|
+
"source_commit": "39c24e447c2d995e4532704177e87ff25d841401",
|
|
5
|
+
"source_sha256": "938be544bd8b0b5f68ca0373b05dba171ac066b240660b75ba639b3e5ae97cdc",
|
|
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": "3a331708c5fa0f5a8bd8b8c7da4a58d05329507353be436e577fd6bf1c0aac08",
|
|
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": "5473e029d35c4b338ef1216478839259b84213112e3db28333ebdcd73e3e0c79",
|
|
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/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
|
});
|