@imdeadpool/guardex 8.4.22 → 8.4.24

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.22",
3
+ "version": "8.4.24",
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,
@@ -65,5 +65,5 @@
65
65
  "prepublishOnly": "node scripts/prepublish-bump-version.js",
66
66
  "postinstall": "node -e \"require('./src/heavy').installReport()\""
67
67
  },
68
- "gitHead": "2e8f574686bf363c2a9775db85f32f5e5410030e"
68
+ "gitHead": "4203a679068ffe9c5ddca41a3ee8f1a5af97cb1b"
69
69
  }
@@ -2133,14 +2133,19 @@ if [[ "$CLEANUP_AFTER_MERGE" -eq 1 ]]; then
2133
2133
 
2134
2134
  # The merge already landed (see the MERGED banner above), so a branch that
2135
2135
  # refuses to delete is a leftover to report, not a reason to fail the run and
2136
- # make a successful ship look broken. Keep the branch AND its remote in that
2137
- # case: the commits it still holds exist nowhere else.
2136
+ # make a successful ship look broken. Keep both refs when deletion is refused.
2138
2137
  local_branch_cleaned=1
2139
2138
  if ! delete_local_branch_for_cleanup "$SOURCE_BRANCH"; then
2140
2139
  local_branch_cleaned=0
2141
- echo "[agent-branch-finish] Warning: kept local branch '${SOURCE_BRANCH}' — it holds commits that never landed in '${BASE_BRANCH}' (rebased during finish, or pushed after the merge)." >&2
2142
- echo "[agent-branch-finish] Inspect: git log ${BASE_BRANCH}..${SOURCE_BRANCH}" >&2
2143
- echo "[agent-branch-finish] Delete once you are satisfied: git branch -D ${SOURCE_BRANCH}" >&2
2140
+ remaining_worktree="$(get_worktree_for_branch "$SOURCE_BRANCH")"
2141
+ if [[ -n "$remaining_worktree" ]]; then
2142
+ echo "[agent-branch-finish] Warning: kept local branch '${SOURCE_BRANCH}' — still checked out in worktree '${remaining_worktree}'." >&2
2143
+ printf '[agent-branch-finish] Once the worktree is idle, retry: gx cleanup --base %q --branch %q\n' "$BASE_BRANCH" "$SOURCE_BRANCH" >&2
2144
+ else
2145
+ echo "[agent-branch-finish] Warning: kept local branch '${SOURCE_BRANCH}' — could not safely delete it after merge." >&2
2146
+ printf '[agent-branch-finish] Inspect: git log %q\n' "${BASE_BRANCH}..${SOURCE_BRANCH}" >&2
2147
+ printf '[agent-branch-finish] After resolving the cause, retry: gx cleanup --base %q --branch %q\n' "$BASE_BRANCH" "$SOURCE_BRANCH" >&2
2148
+ fi
2144
2149
  fi
2145
2150
 
2146
2151
  if [[ "$local_branch_cleaned" -eq 1 && "$PUSH_ENABLED" -eq 1 && "$DELETE_REMOTE_BRANCH" -eq 1 ]]; then
@@ -2168,7 +2173,7 @@ if [[ "$CLEANUP_AFTER_MERGE" -eq 1 ]]; then
2168
2173
  prune_args+=(--delete-remote-branches)
2169
2174
  fi
2170
2175
  else
2171
- echo "[agent-branch-finish] Skipping branch deletion during prune so '${SOURCE_BRANCH}' survives; sweep later with: gx cleanup --base ${BASE_BRANCH}" >&2
2176
+ echo "[agent-branch-finish] Skipping branch deletion during prune so '${SOURCE_BRANCH}' survives." >&2
2172
2177
  fi
2173
2178
 
2174
2179
  pivot_to_repo_root_before_prune
@@ -2184,7 +2189,7 @@ if [[ "$CLEANUP_AFTER_MERGE" -eq 1 ]]; then
2184
2189
  if [[ "$local_branch_cleaned" -eq 1 ]]; then
2185
2190
  kept_branch_summary=""
2186
2191
  else
2187
- kept_branch_summary="kept source branch (commits not in '${BASE_BRANCH}')"
2192
+ kept_branch_summary="kept source branch (cleanup deferred)"
2188
2193
  fi
2189
2194
 
2190
2195
  if [[ "$source_worktree" == "$current_worktree" && "$source_worktree" == "${agent_worktree_root}"/* && -d "$source_worktree" ]]; then