@botbuddy/cli 1.45.0 → 1.45.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botbuddy/cli",
3
- "version": "1.45.0",
3
+ "version": "1.45.1",
4
4
  "description": "BotBuddy — Swarm coordination CLI for multi-agent workflows",
5
5
  "type": "module",
6
6
  "bin": {
package/src/wait-core.mjs CHANGED
@@ -436,10 +436,13 @@ function prSubjectMatches(subjectKey, params) {
436
436
  return subjectKey.startsWith(`${params.repo}#`);
437
437
  }
438
438
 
439
- // Does a commit field on a signal payload start with the condition's sha prefix?
440
- // A missing / non-string field never matches a sha-scoped condition.
439
+ // Does a commit field on a signal payload identify the same commit as the
440
+ // condition's SHA? GitHub may send either side as a 7–40-character prefix, so
441
+ // accept either prefix direction while refusing malformed payload values.
441
442
  function shaPrefixMatches(value, sha) {
442
- return typeof value === "string" && value.trim().toLowerCase().startsWith(sha);
443
+ if (typeof value !== "string") return false;
444
+ const candidate = value.trim().toLowerCase();
445
+ return /^[0-9a-f]{7,40}$/.test(candidate) && (candidate.startsWith(sha) || sha.startsWith(candidate));
443
446
  }
444
447
 
445
448
  // BOT-1975: optional head scoping for pr-state. pr_state signals carry the PR
package/src/wait.mjs CHANGED
@@ -78,8 +78,8 @@ CONDITIONS (TYPE:key=val,key=val — repeat for several; --any wakes on the fir
78
78
  by the PR read model. Omit pr= to wake on ANY of your PRs
79
79
  in the repo; or pass pr=<owner/repo#n> in one value. A
80
80
  conflict/clean flip sets payload.mergeable_changed. The
81
- payload carries head_ref_oid; sha=<head> (7-40 hex, a
82
- prefix is fine) wakes only on signals for that head, so a
81
+ payload carries head_ref_oid; sha=<head> (7-40 hex; either
82
+ side may be an abbreviated prefix) wakes only on signals for that head, so a
83
83
  previous head's check result can't wake you. A push alone
84
84
  emits nothing — the head rides on the next transition.
85
85
  pr-review:repo=<owner/repo>[,pr=<n>][,reviewer=<login>][,sha=<commit>]
@@ -96,7 +96,7 @@ CONDITIONS (TYPE:key=val,key=val — repeat for several; --any wakes on the fir
96
96
  existing review will not re-wake it.
97
97
  reviewer=<login> wakes only on that reviewer (case-
98
98
  insensitive; a trailing [bot] is ignored). sha=<commit>
99
- wakes only on verdicts for that commit (submitted reviews
99
+ wakes only on verdicts for that commit (either side may be an abbreviated prefix; submitted reviews
100
100
  and clean passes carry commit_sha; thread comments do not,
101
101
  so they never match sha=); the usage-limit decline always
102
102
  passes sha=. Any other key is refused (exit 4).