@botbuddy/cli 1.93.1 → 1.95.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 +8 -0
- package/claude-plugin/.claude-plugin/marketplace.json +1 -1
- package/claude-plugin/bb-status/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/bb-status/README.md +9 -0
- package/claude-plugin/bb-status/hooks/register.js +23 -1
- 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 +110 -0
- package/src/stack.mjs +21 -1
- package/src/status-band-read.mjs +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.95.0
|
|
4
|
+
|
|
5
|
+
- BOT-3407: a repo that commits `mise.toml` and `mise.lock` at its root gets exactly those tools in a host test child. The host daemon reads the two files from the head bundle, installs them with a pinned, sha256-verified mise in a sandboxed unit into `/var/lib/private/bb-toolchain/<tenant>/<digest>`, and binds that directory read-only at `/run/bb-child/toolchain`. A host `node_dir` stays on `PATH` behind it. A repeat run with the same tenant and digest starts no install unit. Hosts report one new capability, `toolchain` (and `toolchain_error` when the installer is unavailable). `bb stack run --test-child` requires `toolchain` when the head declares a toolchain, in place of the tools the manifest declares, and warns when `mise.toml` is committed without `mise.lock`. A versioned requirement such as `node>=24` counts as met only when the version the lock resolves meets it; otherwise the run is refused before any lease (`TOOLCHAIN_PREREQUISITE_CONFLICT`, exit 4). Only `core:` and `aqua:` backends with an https URL and a checksum for the host's platform are installed; anything else fails the run before the child starts (`TOOLCHAIN_BACKEND_REFUSED`, `TOOLCHAIN_CHECKSUM_MISSING`, `TOOLCHAIN_CHECKSUM_MISMATCH`, `TOOLCHAIN_MANIFEST_INVALID`, `TOOLCHAIN_INSTALL_FAILED`, `TOOLCHAIN_INSTALL_TIMEOUT`, `TOOLCHAIN_QUOTA_EXCEEDED`, `TOOLCHAIN_UNAVAILABLE`). Each tenant may hold 8 GiB of toolchains per host; one unused for 14 days is removed.
|
|
6
|
+
|
|
7
|
+
## 1.94.0
|
|
8
|
+
|
|
9
|
+
- BOT-3417: the bb-status band (plugin 1.8.0) shows each ticket's Linear customers as badges on its row, at most three and then `+N`. `bb status-band read` carries them from `get_session_status.tickets[].customers` (MCP 2.135.0), BB's own copy of Linear's customer requests; Linear is not called for them. A ticket BB holds no customers for shows no badge.
|
|
10
|
+
|
|
3
11
|
## 1.93.1
|
|
4
12
|
|
|
5
13
|
- BOT-3362: the `bb push` receipt's `push` field gains `failed_hooks`, which names each lefthook job that refused the push, read from lefthook's summary. A push refused by a job that runs outside lane telemetry (for example `pr-docs`) is now `hooks_failed`, not `push_failed`. A remote rejection, with every hook passed, stays `push_failed`.
|
|
@@ -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.
|
|
14
|
+
"version": "1.8.0"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "bb-session",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bb-status",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.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"
|
|
@@ -235,6 +235,15 @@ going idle, so while the badge is shown each quiet relay timeout (about 9.5
|
|
|
235
235
|
minutes) reads again. BB reads the project's newest 200 coordinator edges; a
|
|
236
236
|
full page is a failed read (no badge), never `No coordinator`.
|
|
237
237
|
|
|
238
|
+
**BOT-3417 customer badges.** Each ticket row shows the ticket's Linear
|
|
239
|
+
customers as badges between its status badge and its title, at most three, then
|
|
240
|
+
`+N`. They come from `get_session_status.tickets[].customers`, BB's own copy of
|
|
241
|
+
Linear's customer requests (BOT-3293), which the Linear webhook keeps current;
|
|
242
|
+
neither the CLI nor the MCP asks Linear for them. A ticket BB holds no customers
|
|
243
|
+
for, or an older CLI or MCP, shows no badge, never "no customers". No wait
|
|
244
|
+
signal carries a customer change yet, so an open band shows it on its next
|
|
245
|
+
read (a relay wake, Refresh or a new session).
|
|
246
|
+
|
|
238
247
|
**BOT-3245 STATUS and WAITS.** The band opens with up to two titled rows on
|
|
239
248
|
the tree's grid: `STATUS` (staging red, its release manager and link, the
|
|
240
249
|
context alarm) and `WAITS` (each active wait, three at most, then `+N more`).
|
|
@@ -189,7 +189,10 @@ function validSnapshot(value, harness, now) {
|
|
|
189
189
|
safeLabel(t.title) &&
|
|
190
190
|
safeLabel(t.status, 40) &&
|
|
191
191
|
// BOT-3223: the ticket's project; absent is unknown, null is none.
|
|
192
|
-
(t.project === undefined || t.project === null || PROJECT.test(t.project))
|
|
192
|
+
(t.project === undefined || t.project === null || PROJECT.test(t.project)) &&
|
|
193
|
+
// BOT-3417: the ticket's Linear customers; absent is "BB did not say".
|
|
194
|
+
(t.customers === undefined ||
|
|
195
|
+
(Array.isArray(t.customers) && t.customers.length <= 20 && t.customers.every((c) => safeLabel(c, 40)))),
|
|
193
196
|
) ||
|
|
194
197
|
// BOT-3213: only a coordinator's project binding may carry no ticket.
|
|
195
198
|
(value.tickets.length === 0
|
|
@@ -968,6 +971,9 @@ function bandLine(el, spec, widths, right) {
|
|
|
968
971
|
for (const link of spec.links || []) {
|
|
969
972
|
title.push(el.Link({ href: link.href, label: link.label }), dim(el, " · "));
|
|
970
973
|
}
|
|
974
|
+
// BOT-3417: the ticket's customers lead the title, after the status badge.
|
|
975
|
+
const customers = customerBadges(el, spec.key + "-customers", spec.customers);
|
|
976
|
+
if (customers) title.push(customers);
|
|
971
977
|
title.push(el.Text({ wrap: "wrap", dimColor: spec.dim || undefined, children: [spec.title] }));
|
|
972
978
|
if (spec.note) title.push(dim(el, " " + spec.note));
|
|
973
979
|
const children = [
|
|
@@ -982,6 +988,21 @@ function bandLine(el, spec, widths, right) {
|
|
|
982
988
|
// Top-aligned: with a wrapped title, the id and status sit on its first line.
|
|
983
989
|
return el.Box({ key: spec.key, flexDirection: "row", alignItems: "flex-start", columnGap: 1, children });
|
|
984
990
|
}
|
|
991
|
+
// BOT-3417: one badge per Linear customer of a ticket, at most
|
|
992
|
+
// MAX_CUSTOMER_BADGES, then "+N". None, or BB did not say: no badge at all.
|
|
993
|
+
const MAX_CUSTOMER_BADGES = 3;
|
|
994
|
+
const CUSTOMER_FILL = "#37474f";
|
|
995
|
+
function customerBadges(el, key, customers) {
|
|
996
|
+
if (!Array.isArray(customers) || !customers.length) return null;
|
|
997
|
+
const svg = pills() && typeof el.Svg === "function";
|
|
998
|
+
const shown = customers.slice(0, MAX_CUSTOMER_BADGES).map((name, i) =>
|
|
999
|
+
svg
|
|
1000
|
+
? el.Box({ key: key + "-" + i, flexDirection: "row", flexShrink: 0, children: [pillSvg(el, { text: name, fill: CUSTOMER_FILL, alt: "customer " + name })] })
|
|
1001
|
+
: el.Box({ key: key + "-" + i, flexDirection: "row", flexShrink: 0, backgroundColor: CUSTOMER_FILL, paddingX: 1, children: [el.Text({ color: "#ffffff", children: [name] })] }),
|
|
1002
|
+
);
|
|
1003
|
+
if (customers.length > shown.length) shown.push(dim(el, "+" + (customers.length - shown.length)));
|
|
1004
|
+
return el.Box({ key, flexDirection: "row", flexShrink: 0, flexWrap: "wrap", columnGap: 1, marginRight: 1, alignItems: "center", children: shown });
|
|
1005
|
+
}
|
|
985
1006
|
// BOT-3211/BOT-3217: "Context 62%", or null when the runtime has no fill
|
|
986
1007
|
// figure (a fresh or just-compacted session): hidden, never "0%".
|
|
987
1008
|
function contextText(c) {
|
|
@@ -1278,6 +1299,7 @@ function bandLines(el, $, inPane) {
|
|
|
1278
1299
|
status: [{ text: t.status }],
|
|
1279
1300
|
title: t.title,
|
|
1280
1301
|
note,
|
|
1302
|
+
customers: t.customers,
|
|
1281
1303
|
});
|
|
1282
1304
|
const prSpec = (p, prefix, note) => {
|
|
1283
1305
|
const hex = p.conflict && p.state !== "merged" && p.state !== "closed" ? ICON.pr.closed : ICON.pr[p.state];
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.95.0",
|
|
3
|
+
"source_commit": "3e52ac77c0839bc051d6af539a7e66207f0ff036",
|
|
4
|
+
"source_sha256": "db51827fc73c44b129cad0b2aac8a9488112cc10cf0547a653b15344f479a1b0",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "4d37db72b6b2d4bb938f9fb112aa8bd893bd1677b3a562f6731f056edcdd29fc"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.95.0",
|
|
3
|
+
"source_commit": "3e52ac77c0839bc051d6af539a7e66207f0ff036",
|
|
4
|
+
"source_sha256": "db51827fc73c44b129cad0b2aac8a9488112cc10cf0547a653b15344f479a1b0",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "22cffc987e7384e4d40b23de6f590d5b010733fd4c7013c992efb98e9c3202a5"
|
|
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.95.0",
|
|
4
|
+
"source_commit": "3e52ac77c0839bc051d6af539a7e66207f0ff036",
|
|
5
|
+
"source_sha256": "db51827fc73c44b129cad0b2aac8a9488112cc10cf0547a653b15344f479a1b0",
|
|
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": "4d37db72b6b2d4bb938f9fb112aa8bd893bd1677b3a562f6731f056edcdd29fc",
|
|
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": "22cffc987e7384e4d40b23de6f590d5b010733fd4c7013c992efb98e9c3202a5",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// BOT-3407 — the toolchain a repo declares for its host test children.
|
|
2
|
+
//
|
|
3
|
+
// A repo that commits `mise.toml` and `mise.lock` at its root gets exactly those tools in a
|
|
4
|
+
// host child: the serving host reads the two files from the head bundle, installs them in a
|
|
5
|
+
// sandbox into the tenant's own directory, and binds the result read-only into the child.
|
|
6
|
+
// Nothing is sent beside the bundle. The requester's only part is placement: such a run
|
|
7
|
+
// needs a host that reports the `toolchain` capability, and no longer needs the host to
|
|
8
|
+
// provide the tools the manifest itself declares.
|
|
9
|
+
|
|
10
|
+
import { spawnSync } from "node:child_process";
|
|
11
|
+
|
|
12
|
+
export const TOOLCHAIN_CAPABILITY = "toolchain";
|
|
13
|
+
const MANIFEST = "mise.toml";
|
|
14
|
+
const LOCK = "mise.lock";
|
|
15
|
+
const MAX_BYTES = 256 * 1024;
|
|
16
|
+
|
|
17
|
+
/** `core:node` and `aqua:pnpm/pnpm` name the tools `node` and `pnpm`. */
|
|
18
|
+
const toolName = (key) => key.slice(key.indexOf(":") + 1).split("/").pop();
|
|
19
|
+
|
|
20
|
+
/** The `[tools]` table of a mise.toml: each key (bare or quoted) and its plain version string. */
|
|
21
|
+
export function toolchainTools(tomlText) {
|
|
22
|
+
const tools = [];
|
|
23
|
+
let inTools = false;
|
|
24
|
+
for (const raw of String(tomlText).split(/\r?\n/)) {
|
|
25
|
+
const line = raw.trim();
|
|
26
|
+
// A table header may carry a trailing comment: `[tools] # pinned runtimes`.
|
|
27
|
+
if (line.startsWith("[")) { inTools = /^\[\s*tools\s*\]\s*(#.*)?$/.test(line); continue; }
|
|
28
|
+
if (!inTools) continue;
|
|
29
|
+
const m = /^(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_.-]+))\s*=\s*(?:"([^"]*)"|'([^']*)')?/.exec(line);
|
|
30
|
+
if (m) tools.push({ name: m[1] ?? m[2] ?? m[3], version: m[4] ?? m[5] ?? null });
|
|
31
|
+
}
|
|
32
|
+
return tools;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The tool names in a mise.toml `[tools]` table (bare or quoted keys). */
|
|
36
|
+
export function toolchainToolNames(tomlText) {
|
|
37
|
+
return toolchainTools(tomlText).map((t) => t.name);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The version mise.lock resolved for each tool (`[[tools.<name>]]` then `version = "…"`). */
|
|
41
|
+
export function lockedToolVersions(lockText) {
|
|
42
|
+
const versions = {};
|
|
43
|
+
let current = null;
|
|
44
|
+
for (const raw of String(lockText).split(/\r?\n/)) {
|
|
45
|
+
const line = raw.trim();
|
|
46
|
+
const header = /^\[\[\s*tools\.(?:"([^"]+)"|'([^']+)'|([A-Za-z0-9_-]+))\s*\]\]\s*(#.*)?$/.exec(line);
|
|
47
|
+
if (header) { current = header[1] ?? header[2] ?? header[3]; continue; }
|
|
48
|
+
if (line.startsWith("[")) { current = null; continue; }
|
|
49
|
+
const version = current && /^version\s*=\s*"([^"]*)"/.exec(line);
|
|
50
|
+
if (version && versions[toolName(current)] === undefined) versions[toolName(current)] = version[1];
|
|
51
|
+
}
|
|
52
|
+
return versions;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* What HEAD commits: `{ manifest: true, tools, versions }` when both files are there,
|
|
57
|
+
* `{ manifest: false, lockMissing: true }` when only mise.toml is (the host then builds
|
|
58
|
+
* nothing). `versions` is the lock's resolved version per tool, else mise.toml's own string.
|
|
59
|
+
* Only the committed head counts, because only the head is shipped.
|
|
60
|
+
*/
|
|
61
|
+
export function headToolchain(worktreeRoot, { run = spawnSync } = {}) {
|
|
62
|
+
const none = (lockMissing) => ({ manifest: false, lockMissing, tools: [], versions: {} });
|
|
63
|
+
// nosemgrep: javascript.lang.security.detect-child-process.detect-child-process -- fixed argv, no shell.
|
|
64
|
+
const toml = run("git", ["-C", worktreeRoot, "show", `HEAD:${MANIFEST}`], { encoding: "utf8", maxBuffer: MAX_BYTES + 1 });
|
|
65
|
+
if (toml.status !== 0) return none(false);
|
|
66
|
+
// nosemgrep: javascript.lang.security.detect-child-process.detect-child-process -- fixed argv, no shell.
|
|
67
|
+
const lock = run("git", ["-C", worktreeRoot, "show", `HEAD:${LOCK}`], { encoding: "utf8", maxBuffer: MAX_BYTES + 1 });
|
|
68
|
+
if (lock.status !== 0) return none(true);
|
|
69
|
+
const tools = toolchainTools(toml.stdout);
|
|
70
|
+
const locked = lockedToolVersions(lock.stdout);
|
|
71
|
+
const versions = {};
|
|
72
|
+
for (const t of tools) {
|
|
73
|
+
const version = locked[toolName(t.name)] ?? t.version;
|
|
74
|
+
if (version) versions[toolName(t.name)] = version;
|
|
75
|
+
}
|
|
76
|
+
return { manifest: true, lockMissing: false, tools: tools.map((t) => t.name), versions };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Placement prerequisites for a run whose head declares a toolchain: `toolchain`, plus
|
|
81
|
+
* every requested prerequisite the manifest does not itself provide. `psql` or `git` stay
|
|
82
|
+
* the host's. `node>=24` is the manifest's only when the version it locks for `node` meets
|
|
83
|
+
* it: the manifest's tools come first on the child's PATH, so a lower or unreadable
|
|
84
|
+
* version is a conflict the run must not start with.
|
|
85
|
+
*/
|
|
86
|
+
export function toolchainPrerequisites(requires, head) {
|
|
87
|
+
const wanted = [...(requires ?? [])];
|
|
88
|
+
if (!head?.manifest) return { prerequisites: wanted, provided: [], conflicts: [] };
|
|
89
|
+
const declared = new Set(head.tools.map(toolName));
|
|
90
|
+
const provided = [];
|
|
91
|
+
const conflicts = [];
|
|
92
|
+
const rest = [];
|
|
93
|
+
for (const p of wanted) {
|
|
94
|
+
if (p === TOOLCHAIN_CAPABILITY) continue;
|
|
95
|
+
const [tool, minimum] = p.split(">=");
|
|
96
|
+
if (!declared.has(tool)) { rest.push(p); continue; }
|
|
97
|
+
if (minimum === undefined) { provided.push(p); continue; }
|
|
98
|
+
const version = head.versions?.[tool] ?? null;
|
|
99
|
+
const major = /^v?(\d+)/.exec(version ?? "");
|
|
100
|
+
if (major && Number(major[1]) >= Number(minimum)) provided.push(p);
|
|
101
|
+
else conflicts.push({ prerequisite: p, tool, declared: version });
|
|
102
|
+
}
|
|
103
|
+
return { prerequisites: [TOOLCHAIN_CAPABILITY, ...rest], provided, conflicts };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Why a run is refused: its own manifest cannot meet a prerequisite it asks for. */
|
|
107
|
+
export function toolchainConflictError(conflicts) {
|
|
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
|
+
return `${each.join("; ")}. The manifest's tools come first in a host child, so change mise.toml and mise.lock, or the requirement.`;
|
|
110
|
+
}
|
package/src/stack.mjs
CHANGED
|
@@ -63,6 +63,7 @@ import { STACK_RELEASE_INTENT_ENV, classifyStackRunOutcome, observeStackRunSigna
|
|
|
63
63
|
import { REQUESTER_NETWORK_CANDIDATE_CODES, REQUESTER_NETWORK_LOST_CODE, createRequesterNetworkWatch, requesterNetworkLostMessage } from "./requester-network.mjs";
|
|
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
|
+
import { headToolchain, toolchainConflictError, toolchainPrerequisites } from "./host-toolchain.mjs";
|
|
66
67
|
import { acquireTestChildSlot, defaultTestChildWait, readPs, requesterSample, startChildSampler, testChildApi, testChildReceiptFields } from "./test-child.mjs";
|
|
67
68
|
|
|
68
69
|
export const STACK_SCHEMA_VERSION = 1;
|
|
@@ -304,6 +305,11 @@ ${bold("run OPTIONS")}
|
|
|
304
305
|
curl,psql,playwright-chromium-libs). node, pnpm and deno count only when
|
|
305
306
|
they run inside a child's sandbox on that host (BOT-3402). A host lacking
|
|
306
307
|
one is not placed on; the child runs here and the run names what was missing.
|
|
308
|
+
BOT-3407: a head that commits mise.toml and mise.lock at its root gets
|
|
309
|
+
exactly those tools on the host, built in a sandbox per tenant and bound
|
|
310
|
+
read-only into the child. Placement then requires \`toolchain\` in
|
|
311
|
+
place of the tools the manifest declares. Only core and aqua backends
|
|
312
|
+
with a checksum for the host's platform are installed.
|
|
307
313
|
--child-env NAME BOT-3030: pass NAME (this shell's value) to a host child (repeatable).
|
|
308
314
|
Nothing else is passed; credential-shaped names are refused.
|
|
309
315
|
--child-max-runtime S BOT-3030: the host stops the child after S seconds (default 3600).
|
|
@@ -4057,6 +4063,14 @@ export async function runStackLifecycle(opts, childArgv, adapters = {}) {
|
|
|
4057
4063
|
// A receipt always says what happened to a port-block claim. Before allocation
|
|
4058
4064
|
// no claim exists, which is a safe, explicit disposition rather than omission.
|
|
4059
4065
|
// BOT-1803: whether this run re-adopted / re-provisioned an idle lease, and its stack digest.
|
|
4066
|
+
// BOT-3407: a head whose own toolchain cannot meet a prerequisite the run asks for is
|
|
4067
|
+
// refused before any lease, because the manifest's tools come first in a host child.
|
|
4068
|
+
if (opts.testChild && opts.childRequires?.length) {
|
|
4069
|
+
const declared = toolchainPrerequisites(opts.childRequires, (adapters.headToolchain ?? headToolchain)(adapters.cwd ?? process.cwd()));
|
|
4070
|
+
if (declared.conflicts.length) {
|
|
4071
|
+
return { exitCode: EXIT.INVALID, outcome: "refused", code: "TOOLCHAIN_PREREQUISITE_CONFLICT", error: toolchainConflictError(declared.conflicts) };
|
|
4072
|
+
}
|
|
4073
|
+
}
|
|
4060
4074
|
const freshBox = () => ({ incident: null, execution: null, idleLease: null, webUrl: null, portBlock: { released: false, reason: "no port-block claim was created before stack allocation" } });
|
|
4061
4075
|
const incidentBox = freshBox();
|
|
4062
4076
|
const startedAtMs = (adapters.now ?? Date.now)();
|
|
@@ -5495,11 +5509,17 @@ async function runStackLifecycleOnce(opts, childArgv, adapters, incidentBox) {
|
|
|
5495
5509
|
const waitTouch = clock.setInterval(() => { void touchWhileWaiting(); }, waitCadenceMs);
|
|
5496
5510
|
waitTouch?.unref?.();
|
|
5497
5511
|
let placed;
|
|
5512
|
+
// BOT-3407: a head that commits mise.toml and mise.lock brings its own tools, so
|
|
5513
|
+
// placement asks the host for `toolchain` instead of for those tools.
|
|
5514
|
+
const head = (adapters.headToolchain ?? headToolchain)(execution.worktreeRoot);
|
|
5515
|
+
const toolchain = toolchainPrerequisites(opts.childRequires, head);
|
|
5516
|
+
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` : ""}`);
|
|
5517
|
+
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");
|
|
5498
5518
|
testChildWaitAbort = new AbortController();
|
|
5499
5519
|
try {
|
|
5500
5520
|
placed = await acquireTestChildSlot({
|
|
5501
5521
|
signal: testChildWaitAbort.signal,
|
|
5502
|
-
api: testChildCalls, leaseId, wait: adapters.testChildWait ?? defaultTestChildWait, log: stderrLine, prerequisites:
|
|
5522
|
+
api: testChildCalls, leaseId, wait: adapters.testChildWait ?? defaultTestChildWait, log: stderrLine, prerequisites: toolchain.prerequisites,
|
|
5503
5523
|
isStopped: () => Boolean(receivedSignal || tunnelLost || callbackLost || originLost),
|
|
5504
5524
|
onPark: touchWhileWaiting,
|
|
5505
5525
|
});
|
package/src/status-band-read.mjs
CHANGED
|
@@ -457,9 +457,18 @@ export async function readStatus({
|
|
|
457
457
|
const e = epics.find((x) => UUID_LOWER.test(x?.epic_project_id) && (x.children || []).some((c) => c?.external_id === k));
|
|
458
458
|
return e ? e.epic_project_id : Array.isArray(epicHealth?.epics) ? null : undefined;
|
|
459
459
|
};
|
|
460
|
+
// BOT-3417: each ticket's Linear customers, from BB's own mirror (never from
|
|
461
|
+
// Linear here). No key when BB said nothing, so the band shows no badge.
|
|
462
|
+
const customersOf = (k) => {
|
|
463
|
+
if (!ownOk) return {};
|
|
464
|
+
const t = own.tickets.find((x) => String(x?.key || "").toUpperCase() === k);
|
|
465
|
+
if (!Array.isArray(t?.customers)) return {};
|
|
466
|
+
const names = t.customers.map((c) => safeText(c?.name, 40)).filter(Boolean).slice(0, 20);
|
|
467
|
+
return { customers: names };
|
|
468
|
+
};
|
|
460
469
|
const tickets = keys.map((k) => {
|
|
461
470
|
const project = projectOf(k);
|
|
462
|
-
const where = project === undefined ? {} : { project };
|
|
471
|
+
const where = { ...(project === undefined ? {} : { project }), ...customersOf(k) };
|
|
463
472
|
if (linearTicket && k === key)
|
|
464
473
|
return { key: k, title: linearTicket.title, status: linearTicket.status, ...where };
|
|
465
474
|
const found = fromBb(k);
|