@botbuddy/cli 1.91.2 → 1.92.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 +4 -0
- package/claude-plugin/bb-status/hooks/register.js +63 -7
- 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/status-band-read.mjs +16 -0
- package/src/status-band-relay.mjs +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.92.0
|
|
4
|
+
|
|
5
|
+
- BOT-3394: the bb-status band's WAITS row shows the session's own push held at the host compute gate, from `get_session_status`'s new `push_wait`: "push waiting for host compute · 17× load · 1h 24m" or "push waiting for a compute slot · 2 of 3 · 12m", linked to /waits. `bb status-band read` carries it as `push_wait` (`reason`, `load_ratio`, `slot_position`, `waiting_count`, `since`), null when none is held or BB did not say. The badge goes once the lane starts or the push ends: while a push is held the band's relay also wakes on a one-minute `timer:duration=60` (now on `bb status-band relay`'s allow-list, which takes up to 20 conditions) and re-reads, because no signal yet says a held lane started. A band whose BB reports `push_wait` also re-reads on each quiet relay timeout (~9.5 min), so a hold that begins after its last read still shows.
|
|
6
|
+
|
|
3
7
|
## 1.91.2
|
|
4
8
|
|
|
5
9
|
- BOT-3402: a Go daemon host reports `node`, `pnpm` and `deno` as test-child capabilities only when each prints its version inside a child's own sandbox (a throwaway systemd unit with the child's user, mounts and PATH). A Corepack `pnpm` shim that cannot run there is no longer reported, `deno` is reported for the first time, and the report carries `pnpm_version` and `deno_version` next to `node_version`. The probe runs once per five-minute report, never when a child starts; if the probe itself cannot run, the last verdict stands and the report carries `probe_error`. `bb stack run --child-requires` help names `pnpm` and `deno`.
|
|
@@ -296,6 +296,8 @@ const LINKS = {
|
|
|
296
296
|
pr: (repo, n) => APP + "/kanban?card=pr:" + repo + "%23" + n,
|
|
297
297
|
// BOT-3223 AC-1: a wait badge opens that wait on BB's Waits page.
|
|
298
298
|
wait: (id) => APP + "/waits?wait=" + id,
|
|
299
|
+
// BOT-3394: a push held for compute opens /waits, where every held push is listed.
|
|
300
|
+
pushes: APP + "/waits",
|
|
299
301
|
// BOT-3152 AC-2: the web top bar's Staging chip link (STAGING_HREF).
|
|
300
302
|
staging: APP + "/release-readiness/staging/latest",
|
|
301
303
|
};
|
|
@@ -485,7 +487,7 @@ async function refresh($, { wake = false, keep = false } = {}) {
|
|
|
485
487
|
// What the band waits on: each ticket, the agent's own waits (BOT-3212), each PR
|
|
486
488
|
// still open or draft, and, when BotBuddy blockers are listed, each ticket's
|
|
487
489
|
// last blocker clearing, and the epic's Linear project (BOT-3136).
|
|
488
|
-
const MAX_CONDITIONS =
|
|
490
|
+
const MAX_CONDITIONS = 20;
|
|
489
491
|
function waitConditions(s) {
|
|
490
492
|
// BOT-3152 AC-2: unknown staging (null: a failed read) also wakes on it
|
|
491
493
|
// (review on #1616), so the next incident re-reads; only a tenant known to
|
|
@@ -512,10 +514,14 @@ function waitConditions(s) {
|
|
|
512
514
|
for (const p of s.prs || [])
|
|
513
515
|
if (p.state === "open" || p.state === "draft")
|
|
514
516
|
conds.push("pr-review:repo=" + p.repo + ",pr=" + p.number);
|
|
515
|
-
//
|
|
516
|
-
//
|
|
517
|
-
//
|
|
518
|
-
|
|
517
|
+
// BOT-3394: no signal says a held pre-push lane started, so while a push is
|
|
518
|
+
// held the relay also wakes on a one-minute timer and the badge drops on the
|
|
519
|
+
// next read. A platform gap (no execution-run signal), not a poll loop.
|
|
520
|
+
const timer = pushWaitText(s.push_wait, currentTime) ? ["timer:duration=60"] : [];
|
|
521
|
+
// At most 5 tickets, the agent's waits, 5 PRs (state + review), blockers, epic,
|
|
522
|
+
// staging and the held-push timer: 20, the relay's limit, so no wake is ever
|
|
523
|
+
// dropped (review on #1616, round 4; BOT-3212; BOT-3394).
|
|
524
|
+
return [...timer, ...conds, ...staging].slice(0, MAX_CONDITIONS);
|
|
519
525
|
}
|
|
520
526
|
// Ending the loop's stream kills the child; a module unload does the same.
|
|
521
527
|
function stopRelay() {
|
|
@@ -606,7 +612,9 @@ function startRelay($) {
|
|
|
606
612
|
// BOT-3286 (Codex P2 on #1727): no signal carries a coordinator
|
|
607
613
|
// registering, ending or going idle, so a shown badge re-reads on each
|
|
608
614
|
// quiet timeout (~9.5 min).
|
|
609
|
-
|
|
615
|
+
// BOT-3394 (Codex P2 on #1814): nor does a push starting to hold for
|
|
616
|
+
// compute (BOT-3410), so a BB that reports push_wait re-reads here too.
|
|
617
|
+
if ((snapshot?.epic && snapshot.epic.coordinator !== undefined) || (snapshot && snapshot.push_wait !== undefined)) await wakeRead();
|
|
610
618
|
} else if (res.exit === 5) {
|
|
611
619
|
backoffMs = Math.min(backoffMs ? backoffMs * 2 : 30000, 300000);
|
|
612
620
|
since = cursor || since;
|
|
@@ -1032,6 +1040,50 @@ function waitBadges(el, key, w, now) {
|
|
|
1032
1040
|
if (w.count > out.length) out.push(dim(el, "+" + (w.count - out.length) + " more"));
|
|
1033
1041
|
return out;
|
|
1034
1042
|
}
|
|
1043
|
+
// BOT-3394 AC-1/AC-2: the session's own push held at the host compute gate —
|
|
1044
|
+
// "⏳ push waiting for host compute · 17× load · 1h 24m" or "⏳ push waiting for
|
|
1045
|
+
// a compute slot · 2 of 3 · 12m" — or null when none is held or BB did not say.
|
|
1046
|
+
function pushAge(fromIso, now) {
|
|
1047
|
+
const mins = Math.max(0, Math.floor((now - Date.parse(fromIso)) / 60000));
|
|
1048
|
+
if (mins < 60) return mins + "m";
|
|
1049
|
+
return Math.floor(mins / 60) + "h" + (mins % 60 ? " " + (mins % 60) + "m" : "");
|
|
1050
|
+
}
|
|
1051
|
+
function loadText(r) {
|
|
1052
|
+
return (r >= 10 ? String(Math.round(r)) : String(Math.round(r * 10) / 10)) + "× load";
|
|
1053
|
+
}
|
|
1054
|
+
function pushWaitText(p, now) {
|
|
1055
|
+
if (!p || typeof p !== "object" || typeof p.since !== "string" || !Number.isFinite(Date.parse(p.since))) return null;
|
|
1056
|
+
const whole = (v) => Number.isSafeInteger(v) && v >= 0;
|
|
1057
|
+
let parts;
|
|
1058
|
+
if (p.reason === "host_load") {
|
|
1059
|
+
parts = ["push waiting for host compute"];
|
|
1060
|
+
if (Number.isFinite(p.load_ratio) && p.load_ratio >= 0) parts.push(loadText(p.load_ratio));
|
|
1061
|
+
} else if (p.reason === "compute_slot") {
|
|
1062
|
+
parts = ["push waiting for a compute slot"];
|
|
1063
|
+
if (whole(p.slot_position) && p.slot_position > 0)
|
|
1064
|
+
parts.push(p.slot_position + (whole(p.waiting_count) && p.waiting_count >= p.slot_position ? " of " + p.waiting_count : ""));
|
|
1065
|
+
} else return null;
|
|
1066
|
+
parts.push(pushAge(p.since, now));
|
|
1067
|
+
return "⏳ " + parts.join(" · ");
|
|
1068
|
+
}
|
|
1069
|
+
function pushWaitBadge(el, key, p, now) {
|
|
1070
|
+
const text = pushWaitText(p, now);
|
|
1071
|
+
if (!text) return [];
|
|
1072
|
+
const { bg, fg } = badgeColors(ICON.violet);
|
|
1073
|
+
const link = el.Link({ href: LINKS.pushes, label: "↗" });
|
|
1074
|
+
if (pills() && typeof el.Svg === "function")
|
|
1075
|
+
return [el.Box({ key: key + "-push", flexDirection: "row", flexShrink: 0, alignItems: "center", columnGap: 1, children: [pillSvg(el, { text, fill: bg }), link] })];
|
|
1076
|
+
return [
|
|
1077
|
+
el.Box({
|
|
1078
|
+
key: key + "-push",
|
|
1079
|
+
flexDirection: "row",
|
|
1080
|
+
flexShrink: 0,
|
|
1081
|
+
backgroundColor: bg,
|
|
1082
|
+
paddingX: 1,
|
|
1083
|
+
children: [el.Text({ color: fg, children: [text + " "] }), link],
|
|
1084
|
+
}),
|
|
1085
|
+
];
|
|
1086
|
+
}
|
|
1035
1087
|
// The context alarm's red pill (above 30%), or nothing.
|
|
1036
1088
|
function contextBadge(el, key) {
|
|
1037
1089
|
const alarm = contextAlarm(context);
|
|
@@ -1337,7 +1389,11 @@ function bandLines(el, $, inPane) {
|
|
|
1337
1389
|
...contextBadge(el, k("line-context")),
|
|
1338
1390
|
...uncategorisedBadge(el, k("line-project"), s.epic),
|
|
1339
1391
|
];
|
|
1340
|
-
const waitsRow = headerRow(el, k("line-waits"), TITLES.waits, widths.ids,
|
|
1392
|
+
const waitsRow = headerRow(el, k("line-waits"), TITLES.waits, widths.ids, [
|
|
1393
|
+
// BOT-3394: the session's own push held for compute leads its waits.
|
|
1394
|
+
...pushWaitBadge(el, k("line-waits"), s.push_wait, currentTime),
|
|
1395
|
+
...waitBadges(el, k("line-context"), s.waits, currentTime),
|
|
1396
|
+
]);
|
|
1341
1397
|
const statusRow = headerRow(el, k("line-status"), TITLES.status, widths.ids, statuses);
|
|
1342
1398
|
if (waitsRow) lines.unshift(waitsRow);
|
|
1343
1399
|
if (statusRow) lines.unshift(statusRow);
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.92.0",
|
|
3
|
+
"source_commit": "eb12c35b7497d8f09df520952472c18e6408aa3b",
|
|
4
|
+
"source_sha256": "9a3dd94b97bd47f7933f5b1976304af3bc46ac253a6b767f82aba0dd32f5f485",
|
|
5
5
|
"target": "darwin-arm64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "2326c4e2c0e067851d488c64f54e25defa389ba3b2acf68b4c969cbd4bd1e0a1"
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release_version": "1.
|
|
3
|
-
"source_commit": "
|
|
4
|
-
"source_sha256": "
|
|
2
|
+
"release_version": "1.92.0",
|
|
3
|
+
"source_commit": "eb12c35b7497d8f09df520952472c18e6408aa3b",
|
|
4
|
+
"source_sha256": "9a3dd94b97bd47f7933f5b1976304af3bc46ac253a6b767f82aba0dd32f5f485",
|
|
5
5
|
"target": "linux-x64",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "84c3868a88eefcdbbe22f59fe3f0b1c912aecbbb9d6cd6ec4518cf90244e52a8"
|
|
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.92.0",
|
|
4
|
+
"source_commit": "eb12c35b7497d8f09df520952472c18e6408aa3b",
|
|
5
|
+
"source_sha256": "9a3dd94b97bd47f7933f5b1976304af3bc46ac253a6b767f82aba0dd32f5f485",
|
|
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": "2326c4e2c0e067851d488c64f54e25defa389ba3b2acf68b4c969cbd4bd1e0a1",
|
|
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": "84c3868a88eefcdbbe22f59fe3f0b1c912aecbbb9d6cd6ec4518cf90244e52a8",
|
|
19
19
|
"mode": "0755"
|
|
20
20
|
}
|
|
21
21
|
}
|
package/package.json
CHANGED
package/src/status-band-read.mjs
CHANGED
|
@@ -124,6 +124,19 @@ function waitsOf(own) {
|
|
|
124
124
|
.map((i) => ({ id: i.id.toLowerCase(), label: safeText(i.label).slice(0, 40), created_at: new Date(i.created_at).toISOString() }));
|
|
125
125
|
return { count: w.active, oldest_at: new Date(w.oldest_at).toISOString(), items };
|
|
126
126
|
}
|
|
127
|
+
// BOT-3394 AC-1/AC-2: the session's own push held at the compute gate, for the
|
|
128
|
+
// band's WAITS row; null when none, from an older BB, or anything malformed.
|
|
129
|
+
function pushWaitOf(own) {
|
|
130
|
+
const p = own?.push_wait;
|
|
131
|
+
if (!p || typeof p !== "object" || !["host_load", "compute_slot"].includes(p.reason)) return null;
|
|
132
|
+
if (typeof p.waiting_since !== "string" || !Number.isFinite(Date.parse(p.waiting_since))) return null;
|
|
133
|
+
const count = (v) => (v == null ? null : Number.isSafeInteger(v) && v >= 0 && v <= 999 ? v : undefined);
|
|
134
|
+
const ratio = p.load_ratio == null ? null : Number.isFinite(p.load_ratio) && p.load_ratio >= 0 && p.load_ratio < 10000 ? p.load_ratio : undefined;
|
|
135
|
+
const position = count(p.slot_position);
|
|
136
|
+
const waiting = count(p.waiting_count);
|
|
137
|
+
if (ratio === undefined || position === undefined || waiting === undefined) return null;
|
|
138
|
+
return { reason: p.reason, load_ratio: ratio, slot_position: position, waiting_count: waiting, since: new Date(p.waiting_since).toISOString() };
|
|
139
|
+
}
|
|
127
140
|
function refuse(code, extra = {}) {
|
|
128
141
|
throw Object.assign(new Error(code), extra);
|
|
129
142
|
}
|
|
@@ -612,6 +625,9 @@ export async function readStatus({
|
|
|
612
625
|
epic_unreadable: useSession ? false : !skipEpic && !Array.isArray(epicHealth?.epics),
|
|
613
626
|
staging: ownOk ? stagingOf(own) : null,
|
|
614
627
|
waits: ownOk ? waitsOf(own) : null,
|
|
628
|
+
// BOT-3394: absent when BB did not say (an older server), so the band knows
|
|
629
|
+
// whether a quiet timeout should re-read for a hold that began after this read.
|
|
630
|
+
...(ownOk && "push_wait" in own ? { push_wait: pushWaitOf(own) } : {}),
|
|
615
631
|
// BOT-3136: where the tickets came from — the registered session, an explicit
|
|
616
632
|
// pick, or (only when the session registered none) a guess from the branch.
|
|
617
633
|
binding: bindingKind,
|
|
@@ -20,13 +20,16 @@ const PROJECT = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}";
|
|
|
20
20
|
const STAGING = "event:type=staging_incident";
|
|
21
21
|
// BOT-3212 AC-2: the waits badge wakes when one of the agent's own waits starts or ends.
|
|
22
22
|
const AGENT_WAITS = `event:type=agent_wait,subject=${PROJECT}`;
|
|
23
|
+
// BOT-3394: no signal says a held pre-push lane started, so while the band shows
|
|
24
|
+
// one it re-reads on this one fixed timer (the platform gap is ticketed).
|
|
25
|
+
export const PUSH_WAIT_TIMER = "timer:duration=60";
|
|
23
26
|
const CONDITION = new RegExp(
|
|
24
|
-
`^(?:linear:issue=${KEY}|unblocked:${KEY}|pr-(?:state|review):repo=${REPO},pr=[1-9]\\d{0,6}|event:type=linear_project,subject=${PROJECT}|${STAGING}|${AGENT_WAITS})$`,
|
|
27
|
+
`^(?:linear:issue=${KEY}|unblocked:${KEY}|pr-(?:state|review):repo=${REPO},pr=[1-9]\\d{0,6}|event:type=linear_project,subject=${PROJECT}|${STAGING}|${AGENT_WAITS}|${PUSH_WAIT_TIMER})$`,
|
|
25
28
|
);
|
|
26
29
|
const CURSOR = /^\d{1,16}$/;
|
|
27
30
|
// The band's largest list: 5 tickets, 5 PRs (state + review), blockers, epic,
|
|
28
|
-
// staging
|
|
29
|
-
const MAX_CONDITIONS =
|
|
31
|
+
// staging, the agent's own waits (BOT-3212) and the held-push timer (BOT-3394).
|
|
32
|
+
const MAX_CONDITIONS = 20;
|
|
30
33
|
export const CLI_ENTRY = join(resolve(dirname(fileURLToPath(import.meta.url)), ".."), "bin", "botbuddy.mjs");
|
|
31
34
|
|
|
32
35
|
function invalid() {
|