@botbuddy/cli 1.93.0 → 1.93.1

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.93.1
4
+
5
+ - 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`.
6
+
3
7
  ## 1.93.0
4
8
 
5
9
  - BOT-3362: `bb push [git push args]` runs the push (pre-push lanes and the push) as a tracked, detached command run and returns at once with its run id. `bb wait 'push:id=<id>'` returns the terminal receipt. Its `push` field lists each lane's result, its compute slot wait and load wait, the totals, the outcome (`pushed`, `hooks_failed`, `push_failed`, `interrupted`, `timed_out`) and the gate (`gated`, `no_hooks`, `ungated` for `LEFTHOOK=0`). `waiting_over=<s>` also wakes once the push has held for host compute that long; this wake is local. The live phase is written to `~/.botbuddy/command-runs/<id>.context.json.push.json`. A second push from the same worktree is refused (exit 4 `push_in_progress`) and names the first push.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.93.0",
3
- "source_commit": "5f725b542bdc9a9b70237cd6fab5b8fd7afab6ce",
4
- "source_sha256": "733c52c77401497b156d678fca78ad0075aaba4b768ef615d0e6275c4d0886a3",
2
+ "release_version": "1.93.1",
3
+ "source_commit": "555e8917df316b940fdd1c9ec5ddd862f7e80f3e",
4
+ "source_sha256": "e3a8ddf0f88acf8969071e48b62b5b3f4c4ddb4ca73467b3d5a3edb9a1721500",
5
5
  "target": "darwin-arm64",
6
- "sha256": "a481ec7dde1b215228b000aadf59b6b039f52594cf5fe437c5d0936d7b6a25f8"
6
+ "sha256": "1639c59335acd37f14183ecc6e8a6d27682a7d84663bbd67b6dc5f9dd92b47fd"
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "release_version": "1.93.0",
3
- "source_commit": "5f725b542bdc9a9b70237cd6fab5b8fd7afab6ce",
4
- "source_sha256": "733c52c77401497b156d678fca78ad0075aaba4b768ef615d0e6275c4d0886a3",
2
+ "release_version": "1.93.1",
3
+ "source_commit": "555e8917df316b940fdd1c9ec5ddd862f7e80f3e",
4
+ "source_sha256": "e3a8ddf0f88acf8969071e48b62b5b3f4c4ddb4ca73467b3d5a3edb9a1721500",
5
5
  "target": "linux-x64",
6
- "sha256": "82453b27c5c4d174414b9186f6043a05a798ba63c5dfc3bea080cefec1f02e24"
6
+ "sha256": "cb9679de790021710f9c09405d74cf1984c981e0588cdb6427006c9fa72ba0e7"
7
7
  }
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "schema_version": 1,
3
- "release_version": "1.93.0",
4
- "source_commit": "5f725b542bdc9a9b70237cd6fab5b8fd7afab6ce",
5
- "source_sha256": "733c52c77401497b156d678fca78ad0075aaba4b768ef615d0e6275c4d0886a3",
3
+ "release_version": "1.93.1",
4
+ "source_commit": "555e8917df316b940fdd1c9ec5ddd862f7e80f3e",
5
+ "source_sha256": "e3a8ddf0f88acf8969071e48b62b5b3f4c4ddb4ca73467b3d5a3edb9a1721500",
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": "a481ec7dde1b215228b000aadf59b6b039f52594cf5fe437c5d0936d7b6a25f8",
11
+ "sha256": "1639c59335acd37f14183ecc6e8a6d27682a7d84663bbd67b6dc5f9dd92b47fd",
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": "82453b27c5c4d174414b9186f6043a05a798ba63c5dfc3bea080cefec1f02e24",
18
+ "sha256": "cb9679de790021710f9c09405d74cf1984c981e0588cdb6427006c9fa72ba0e7",
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.93.0",
3
+ "version": "1.93.1",
4
4
  "description": "BotBuddy — Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -86,21 +86,39 @@ const sumOrNull = (values) => {
86
86
  return present.length ? present.reduce((a, b) => a + b, 0) : null;
87
87
  };
88
88
 
89
+ const ANSI = /\u001b\[[0-9;]*m/g;
90
+
91
+ /**
92
+ * The lefthook jobs that failed, from lefthook's own summary in the push's output
93
+ * (`✗ <job> (<n> seconds)`). It names every refusing job, including the ones that
94
+ * run outside lane telemetry (BOT-3362 acceptance, run aa131db8: `pr-docs`).
95
+ */
96
+ export function failedHooksFromOutput(output) {
97
+ const failed = [];
98
+ for (const line of String(output ?? "").replace(ANSI, "").split("\n")) {
99
+ const match = /^\s*✗\s+([A-Za-z0-9_.:@/-]+)\s+\(/.exec(line);
100
+ if (match && !failed.includes(match[1])) failed.push(match[1]);
101
+ }
102
+ return failed;
103
+ }
104
+
89
105
  /** The receipt's `push` field: each lane's result and compute wait, and the outcome. */
90
- export function pushSummary({ status, gate, launchedAt, invocationState }) {
106
+ export function pushSummary({ status, gate, launchedAt, invocationState, hookOutput = "" }) {
91
107
  const own = gate === "ungated" ? null : ownInvocation(invocationState, launchedAt);
92
108
  const lanes = Object.entries(own?.lanes ?? {}).map(([lane, v]) => ({
93
109
  lane, outcome: v?.outcome ?? null, waiting_ms: v?.waiting_ms ?? 0,
94
110
  slot_wait_ms: v?.compute?.slot_wait_ms ?? null, load_wait_ms: v?.compute?.load_wait_ms ?? null,
95
111
  load_ratio_at_start: v?.compute?.load_ratio_at_start ?? null,
96
112
  }));
113
+ const failedHooks = status === "success" ? [] : failedHooksFromOutput(hookOutput);
97
114
  const outcome = {
98
115
  success: "pushed", cancelled: "interrupted", timed_out: "timed_out", owner_lost: "owner_lost",
99
- failure: lanes.some((l) => FAILED_LANE_OUTCOMES.has(l.outcome)) ? "hooks_failed" : "push_failed",
116
+ failure: lanes.some((l) => FAILED_LANE_OUTCOMES.has(l.outcome)) || failedHooks.length ? "hooks_failed" : "push_failed",
100
117
  }[status] ?? status;
101
118
  return {
102
119
  outcome,
103
120
  gate: gate === "ungated" ? "ungated" : own ? "gated" : "no_hooks",
121
+ failed_hooks: failedHooks,
104
122
  invocation_id: own?.invocation_id ?? null,
105
123
  lanes,
106
124
  slot_wait_ms: sumOrNull(lanes.map((l) => l.slot_wait_ms)),
package/src/push.mjs CHANGED
@@ -214,8 +214,8 @@ export function startPushMonitor(context, call, {
214
214
  }
215
215
 
216
216
  /** The receipt's push summary for a finished run, and release of the worktree lock. */
217
- export function finishPush(context, status) {
218
- const summary = pushSummary({ status, gate: context.push.gate, launchedAt: context.launched_at, invocationState: readInvocationState(context.push.root) });
217
+ export function finishPush(context, status, hookOutput = "") {
218
+ const summary = pushSummary({ status, gate: context.push.gate, launchedAt: context.launched_at, invocationState: readInvocationState(context.push.root), hookOutput });
219
219
  const lockPath = join(context.push.root, ".botbuddy", PUSH_LOCK_FILE);
220
220
  if (readJson(lockPath)?.run_id === context.run_id) rmSync(lockPath, { force: true });
221
221
  return summary;
package/src/run.mjs CHANGED
@@ -1215,7 +1215,7 @@ async function finalize(context, state, call, retry = {}) {
1215
1215
  }
1216
1216
  // BOT-3362: each pre-push lane's result and compute wait, and the push's outcome.
1217
1217
  if (context.push) {
1218
- try { receipt.push = finishPush(context, state.status); } catch { /* the command receipt stands without it */ }
1218
+ try { receipt.push = finishPush(context, state.status, boundedLog); } catch { /* the command receipt stands without it */ }
1219
1219
  }
1220
1220
  await writeJson(context.receipt_path, receipt);
1221
1221
  const bytes = await stat(context.receipt_path);