@imdeadpool/guardex 7.0.35 → 7.0.36

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/README.md CHANGED
@@ -266,6 +266,11 @@ Being honest about where this still has issues:
266
266
  <details open>
267
267
  <summary><strong>v7.x</strong></summary>
268
268
 
269
+ ### v7.0.36
270
+ - Bumped `@imdeadpool/guardex` from `7.0.35` to `7.0.36` so the latest
271
+ branch-finish cwd-prune fix can ship under a fresh npm version after PR #424.
272
+ - No new CLI command surface is introduced in this release lane.
273
+
269
274
  ### v7.0.35
270
275
  - Bumped `@imdeadpool/guardex` from `7.0.34` to `7.0.35` so the current
271
276
  merged `main` payload can publish on a fresh npm version after PR #420.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imdeadpool/guardex",
3
- "version": "7.0.35",
3
+ "version": "7.0.36",
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,
@@ -787,6 +787,15 @@ if [[ -n "$base_worktree" ]] && is_clean_worktree "$base_worktree" && [[ "$PUSH_
787
787
  fi
788
788
  maybe_auto_commit_parent_gitlink "$base_worktree"
789
789
 
790
+ # Pivot out of the agent worktree before prune calls that may remove it.
791
+ # Without this, subprocess spawns can fail with ENOENT uv_cwd after cwd
792
+ # disappears even when the merge succeeded.
793
+ pivot_to_repo_root_before_prune() {
794
+ if [[ "$current_worktree" == "$source_worktree" && "$source_worktree" == "${agent_worktree_root}"/* ]]; then
795
+ cd "$repo_root" 2>/dev/null || true
796
+ fi
797
+ }
798
+
790
799
  if [[ "$CLEANUP_AFTER_MERGE" -eq 1 ]]; then
791
800
  if [[ "$source_worktree" == "$repo_root" ]]; then
792
801
  if is_clean_worktree "$source_worktree"; then
@@ -830,17 +839,20 @@ if [[ "$CLEANUP_AFTER_MERGE" -eq 1 ]]; then
830
839
  if [[ "$DELETE_REMOTE_BRANCH" -eq 1 ]]; then
831
840
  prune_args+=(--delete-remote-branches)
832
841
  fi
842
+
843
+ pivot_to_repo_root_before_prune
833
844
  if ! run_guardex_cli worktree prune "${prune_args[@]}"; then
834
845
  echo "[agent-branch-finish] Warning: automatic worktree prune failed." >&2
835
846
  echo "[agent-branch-finish] You can run manual cleanup: gx cleanup --base ${BASE_BRANCH}" >&2
836
847
  fi
837
848
 
838
849
  echo "[agent-branch-finish] Merged '${SOURCE_BRANCH}' into '${BASE_BRANCH}' via ${merge_status} flow and cleaned source branch/worktree."
839
- if [[ "$source_worktree" == "$current_worktree" && "$source_worktree" == "${agent_worktree_root}"/* ]]; then
850
+ if [[ "$source_worktree" == "$current_worktree" && "$source_worktree" == "${agent_worktree_root}"/* && -d "$source_worktree" ]]; then
840
851
  echo "[agent-branch-finish] Current worktree '${source_worktree}' still exists because it is the active shell cwd." >&2
841
852
  echo "[agent-branch-finish] Leave this directory, then run: gx cleanup --base ${BASE_BRANCH}" >&2
842
853
  fi
843
854
  else
855
+ pivot_to_repo_root_before_prune
844
856
  if ! run_guardex_cli worktree prune --base "$BASE_BRANCH"; then
845
857
  echo "[agent-branch-finish] Warning: temporary worktree prune failed." >&2
846
858
  fi