@imdeadpool/guardex 8.4.5 → 8.4.6

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": "@imdeadpool/guardex",
3
- "version": "8.4.5",
3
+ "version": "8.4.6",
4
4
  "description": "Guardian T-Rex for your multi-agent repo. Isolated worktrees, file locks, and PR-only merges stop parallel Codex & Claude agents from overwriting each other's work. Auto-wires Oh My Codex, Oh My Claude, OpenSpec, and Caveman.",
5
5
  "license": "MIT",
6
6
  "preferGlobal": true,
@@ -97,5 +97,5 @@
97
97
  "jsonc-parser": "3.3.1",
98
98
  "semver": "7.7.4"
99
99
  },
100
- "gitHead": "fb61b7bfba42d18a95c71ddc1e3525246317f9ef"
100
+ "gitHead": "a8a451a154513fecd94b366f5e57dd84c55a7a58"
101
101
  }
@@ -123,6 +123,8 @@ function renderChecksLine(checks) {
123
123
  if (checks.pending) parts.push(`${checks.pending} pending`);
124
124
  if (checks.failed) parts.push(`${checks.failed} failed`);
125
125
  if (checks.cancelled) parts.push(`${checks.cancelled} cancelled`);
126
+ if (checks.waived) parts.push(`${checks.waived} did not start (GitHub billing)`);
127
+ if (checks.skipped) parts.push(`${checks.skipped} skipped`);
126
128
  if (checks.other) parts.push(`${checks.other} other`);
127
129
  return parts.length ? parts.join(', ') : `${checks.total} checks`;
128
130
  }
@@ -295,6 +297,15 @@ async function cmdWatch(opts) {
295
297
  logError(`CI checks failed. Investigate the PR before retrying.${buildChecksFailedDetail(result.pr)}`);
296
298
  return;
297
299
  }
300
+ if (result.status === 'billing-blocked') {
301
+ process.exitCode = 2;
302
+ logError(
303
+ `GitHub Actions did not start due to billing or a spending limit${buildTimeoutDetail(result.pr)}. ` +
304
+ 'Restore Actions and rerun CI, or use the review-gated finish with a trusted base preflight. ' +
305
+ 'GitHub merge requirements still apply.',
306
+ );
307
+ return;
308
+ }
298
309
  if (result.status === 'timeout') {
299
310
  process.exitCode = 3;
300
311
  logWarn(`Timed out waiting for PR to merge.${buildTimeoutDetail(result.pr)}`);
package/src/pr.js CHANGED
@@ -609,9 +609,8 @@ async function watchPullRequest(options) {
609
609
 
610
610
  // eslint-disable-next-line no-constant-condition
611
611
  while (true) {
612
- // Check open PRs first.
613
- const open = findOpenPrForBranch(repoRoot, branch);
614
- if (!open) {
612
+ const snapshot = getPullRequestStatus(repoRoot, branch);
613
+ if (!snapshot) {
615
614
  const latest = findLatestPrForBranch(repoRoot, branch);
616
615
  if (latest && latest.state === 'MERGED') {
617
616
  onEvent({ phase: 'merged', pr: latest });
@@ -625,19 +624,21 @@ async function watchPullRequest(options) {
625
624
  return { status: 'no-pr', pr: null };
626
625
  }
627
626
 
628
- const snapshot = getPullRequestStatus(repoRoot, branch);
629
627
  onEvent({ phase: 'polling', pr: snapshot });
630
628
 
631
- if (snapshot && snapshot.checks.failed > 0) {
629
+ const { checks } = snapshot;
630
+ if (checks.failed > 0 || checks.cancelled > 0) {
632
631
  return { status: 'checks-failed', pr: snapshot };
633
632
  }
633
+ if (checks.waived > 0 && checks.pending === 0) {
634
+ return { status: 'billing-blocked', pr: snapshot };
635
+ }
634
636
  if (
635
- snapshot
636
- && !snapshot.isDraft
637
+ !snapshot.isDraft
637
638
  && snapshot.mergeable === 'MERGEABLE'
638
- && snapshot.checks.pending === 0
639
- && snapshot.checks.failed === 0
640
- && snapshot.checks.total > 0
639
+ && (snapshot.mergeStateStatus === 'CLEAN' || snapshot.mergeStateStatus === 'HAS_HOOKS')
640
+ && checks.total > 0
641
+ && checks.success + (checks.skipped || 0) === checks.total
641
642
  ) {
642
643
  // CI is green and PR is non-draft + mergeable; the merge itself will be
643
644
  // driven by auto-merge or a separate `gh pr merge` invocation.