ace-git-worktree 0.19.4 → 0.21.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 76d43bf4c4c653fa09da391cd661a709218da5170a08bc89071c9506df8e05f9
4
- data.tar.gz: e9f1832e5b5e2c9b9173684b1bf5d8125a5ae2cb785a50e985d9e8783e2a679f
3
+ metadata.gz: 2949a99762ff6e6df27ed6389ba71bdd1d6b7ebb305cff1949efd52e336535ad
4
+ data.tar.gz: 377211d8b92a773016e4336bd257c0b427a36c8e5a49b3786fc770d22ce7e82d
5
5
  SHA512:
6
- metadata.gz: e7b8da916fed96f86cae44d25b6b5dcaa277ee8fd697006a3d27f54c86b2112b91d594ce7c98e278bc904994c45f72d1539b7de81cb7a0dc90c4af1b04ea8442
7
- data.tar.gz: 23f06350a8761c0ad8cf5cc82cd6c11d922ce445facf85ed9b872fb2b956fa97a6a755f8febb7f3839a28d4974fb8eb5d5cbf918e92a795fef5bf4f471132b38
6
+ metadata.gz: 12057f8c30ed439dd06e537f05c6c190602ff80a72c2386f55d6f6b13909328a5e686323182ac6654f181cc1078a766e04d2f1f84fe69879c3b472feacf0ac12
7
+ data.tar.gz: 9a61e079a9c94d7039491ea51f59aa128b737166643bd594b033b7f200420da422e58bef7bd1495bd4a700c3c1266eacf1742079eb68d573815cacdba7d7441c
data/CHANGELOG.md CHANGED
@@ -6,6 +6,67 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## [Unreleased]
9
+ ### Fixed
10
+ - **ace-git-worktree v0.20.5**: Used `ace-tmux window` when already in a tmux session and `ace-tmux start` otherwise, so nested worktree creation stays correctly in-session.
11
+ - **ace-git-worktree v0.20.4**: Fixed `create --pr <number>` to avoid an `ace-tmux` subcommand mismatch when launching project tmux sessions.
12
+ - **ace-git-worktree v0.20.3**: Fixed `create --pr <number>` parsing so `--pr` is not treated as a positional branch argument when routed through `ace-support-cli`.
13
+
14
+ ## [0.21.4] - 2026-04-19
15
+
16
+ ### Technical
17
+ - Updated the retained task-aware PR lifecycle E2E contract to treat missing or unauthenticated GitHub CLI access as a valid graceful-prerequisite branch when the command surfaces an actionable error and leaves no partial PR worktree behind.
18
+
19
+ ## [0.21.3] - 2026-04-18
20
+
21
+ ### Technical
22
+ - Persisted the exact dry-run remove target in retained lifecycle E2E coverage so `TS-WORKTREE-001` verifies no-op behavior from the real created worktree instead of a brittle hardcoded path check.
23
+
24
+ ## [0.21.2] - 2026-04-16
25
+
26
+ ### Technical
27
+ - Aligned retained task-aware JSON metadata E2E verification with the current compact `task_id` contract and the main-worktree null-task behavior.
28
+
29
+ ## [0.21.1] - 2026-04-16
30
+
31
+ ### Technical
32
+ - Corrected `TS-WORKTREE-001` lifecycle verification so post-create worktree evidence is judged before later remove/prune steps intentionally clean up the sandbox state.
33
+
34
+ ## [0.21.0] - 2026-04-14
35
+
36
+ ### Changed
37
+ - Rewrote retained basic-lifecycle and task-aware E2E runner/verifier contracts around explicit public command journeys and impact-first end-state checks.
38
+ - Added new goal-style E2E coverage for config surface validation and PR worktree lifecycle flows.
39
+ - Updated usage and getting-started docs with the minimal JSON output contract, task/non-task filter examples, and remove-by-task `--delete-branch` guidance.
40
+
41
+ ## [0.20.2] - 2026-04-13
42
+
43
+ ### Changed
44
+ - Hardened the basic lifecycle and task-aware E2E scenario contracts so worktree setup, remove/prune evidence, and task-worktree creation checks are stable across reruns.
45
+
46
+ ## [0.20.1] - 2026-04-13
47
+
48
+ ### Changed
49
+ - Completed the batch i05 migration follow-through for this package and aligned it with the restarted `fast` / `feat` / `e2e` verification model.
50
+
51
+ ### Technical
52
+ - Included in the coordinated assignment-driven patch release for batch i05 package updates.
53
+
54
+
55
+ ## [0.20.0] - 2026-04-12
56
+
57
+ ### Changed
58
+ - Migrated package tests to the `fast` / `feat` / `e2e` model, moving deterministic coverage from legacy test directories into `test/fast` and `test/feat`.
59
+ - Updated retained E2E scenario contracts and metadata for task-aware and lifecycle workflows, including deterministic coverage references and sandbox setup normalization.
60
+ - Updated package docs (`README`, usage, getting-started) to teach the `ace-test`, `ace-test ... feat`, and `ace-test-e2e` split contract.
61
+
62
+ ## [0.19.5] - 2026-04-10
63
+
64
+ ### Fixed
65
+ - Hardened `WorktreeRemover` cleanup semantics to fail when the worktree directory still exists after cleanup, including explicit error results on removal exceptions.
66
+ - Updated prune execution to run `git worktree prune --expire now` for immediate stale-metadata cleanup.
67
+
68
+ ### Technical
69
+ - Added regression coverage asserting `--expire now` prune args and stuck-directory failure behavior in worktree remover tests.
9
70
 
10
71
  ## [0.19.4] - 2026-03-29
11
72
 
data/README.md CHANGED
@@ -36,5 +36,20 @@
36
36
 
37
37
  **Orchestrate parallel task work with ace-overseer** - pair with [ace-overseer](../ace-overseer) to spin up worktrees per task, drive agents in parallel, and prune finished worktrees automatically.
38
38
 
39
+ ## Testing Contract
40
+
41
+ Run package tests with the restarted deterministic + scenario split:
42
+
43
+ ```bash
44
+ ace-test ace-git-worktree
45
+ ace-test ace-git-worktree feat
46
+ ace-test ace-git-worktree all
47
+ ace-test-e2e ace-git-worktree
48
+ ```
49
+
50
+ - `ace-test ace-git-worktree` runs deterministic package tests (default `fast` group).
51
+ - `ace-test ace-git-worktree feat` runs deterministic feature-level tests migrated from legacy integration-style coverage.
52
+ - `ace-test-e2e ace-git-worktree` runs retained workflow scenarios only.
53
+
39
54
  ---
40
55
  [Getting Started](docs/getting-started.md) | [Usage Guide](docs/usage.md) | [Handbook - Skills, Agents, Templates](docs/handbook.md) | Part of [ACE](https://github.com/cs3b/ace)
@@ -3,7 +3,7 @@ doc-type: user
3
3
  title: ace-git-worktree Getting Started
4
4
  purpose: Tutorial for first-run ace-git-worktree workflows
5
5
  ace-docs:
6
- last-updated: 2026-03-22
6
+ last-updated: 2026-04-14
7
7
  last-checked: 2026-03-22
8
8
  ---
9
9
 
@@ -106,6 +106,68 @@ Add hooks, auto-push, tmux launch, or PR automation only after the basic create/
106
106
  | Remove a task worktree | `ace-git-worktree remove --task 081` |
107
107
  | Preview stale cleanup | `ace-git-worktree prune --dry-run` |
108
108
 
109
+ ## Goal-Style Examples
110
+
111
+ Use these focused flows when validating public lifecycle behavior end-to-end.
112
+
113
+ ### Dry-run no-op check
114
+
115
+ ```bash
116
+ ace-git-worktree create bugfix/test-fix --dry-run
117
+ ace-git-worktree remove --task 081 --dry-run
118
+ ace-git-worktree list
119
+ ```
120
+
121
+ ### Remove lifecycle with branch deletion
122
+
123
+ ```bash
124
+ ace-git-worktree remove --task 081 --delete-branch
125
+ ace-git-worktree list
126
+ ```
127
+
128
+ ### Task filtering behavior
129
+
130
+ ```bash
131
+ ace-git-worktree list --show-tasks
132
+ ace-git-worktree list --task-associated
133
+ ace-git-worktree list --no-task-associated
134
+ ```
135
+
136
+ ### Prune final-state check
137
+
138
+ ```bash
139
+ ace-git-worktree prune --dry-run
140
+ ace-git-worktree prune
141
+ ace-git-worktree list
142
+ ```
143
+
144
+ ### PR worktree lifecycle
145
+
146
+ ```bash
147
+ ace-git-worktree create --pr 26
148
+ ace-git-worktree switch pr-26
149
+ ace-git-worktree remove pr-26
150
+ ```
151
+
152
+ ### Config surface validation
153
+
154
+ ```bash
155
+ ace-git-worktree config --show
156
+ ace-git-worktree config --validate
157
+ ace-git-worktree config --files
158
+ ```
159
+
160
+ ## Validate Package Tests
161
+
162
+ After making changes, run the package test split explicitly:
163
+
164
+ ```bash
165
+ ace-test ace-git-worktree
166
+ ace-test ace-git-worktree feat
167
+ ace-test ace-git-worktree all
168
+ ace-test-e2e ace-git-worktree
169
+ ```
170
+
109
171
  ## Next Steps
110
172
 
111
173
  * Run `ace-git-worktree config --files` to see which config files are active
data/docs/usage.md CHANGED
@@ -3,7 +3,7 @@ doc-type: user
3
3
  title: ace-git-worktree CLI Usage Reference
4
4
  purpose: Command reference for ace-git-worktree
5
5
  ace-docs:
6
- last-updated: 2026-03-22
6
+ last-updated: 2026-04-14
7
7
  last-checked: 2026-03-22
8
8
  ---
9
9
 
@@ -112,6 +112,45 @@ Would remove task.081
112
112
 
113
113
  **Next steps:** Re-run either command without `--dry-run` once the preview looks correct.
114
114
 
115
+ ### Scenario 4: Filter Task and Non-Task Worktrees
116
+
117
+ **Goal:** Show task-associated worktrees separately from non-task worktrees.
118
+
119
+ **Commands:**
120
+
121
+ ```bash
122
+ ace-git-worktree list --show-tasks
123
+ ace-git-worktree list --task-associated
124
+ ace-git-worktree list --no-task-associated
125
+ ```
126
+
127
+ **Expected output:**
128
+
129
+ ```text
130
+ ... --show-tasks includes task metadata ...
131
+ ... --task-associated excludes the main worktree ...
132
+ ... --no-task-associated shows main/non-task entries only ...
133
+ ```
134
+
135
+ ### Scenario 5: Remove by Task and Delete Branch
136
+
137
+ **Goal:** Remove a task worktree and also delete its branch in one command.
138
+
139
+ **Commands:**
140
+
141
+ ```bash
142
+ ace-git-worktree remove --task 081 --delete-branch
143
+ ace-git-worktree list
144
+ ```
145
+
146
+ **Expected output:**
147
+
148
+ ```text
149
+ Removed worktree for task 081
150
+ Deleted branch ...
151
+ ... task.081 no longer appears in list output ...
152
+ ```
153
+
115
154
  ## Commands
116
155
 
117
156
  ### `ace-git-worktree create [BRANCH]`
@@ -164,12 +203,20 @@ ace-git-worktree list --search auth
164
203
  * `--format` - Output format: `table`, `json`, or `simple`
165
204
  * `--show-tasks` - Include task associations
166
205
  * `--task-associated` - Show only task-associated worktrees
206
+ * `--no-task-associated` - Show only non-task worktrees
167
207
  * `--usable` - Show only usable worktrees
168
208
  * `--search` - Filter by branch-name pattern
169
209
  * `-q`, `--quiet` - Suppress non-essential output
170
210
  * `-v`, `--verbose` - Show verbose output
171
211
  * `-d`, `--debug` - Show debug output
172
212
 
213
+ **Minimal JSON contract (`--format json`):**
214
+
215
+ - Output is valid JSON (`array` or object containing worktree entries).
216
+ - Each entry includes a stable path/identity surface usable by scripts (`path` and `branch` fields).
217
+ - Task-associated entries expose `task_id`.
218
+ - Non-task entries either omit `task_id` or set it to `null`.
219
+
173
220
  ### `ace-git-worktree switch [IDENTIFIER]`
174
221
 
175
222
  Resolve a worktree path for shell navigation.
@@ -286,6 +333,21 @@ git:
286
333
  The defaults file also documents timeout controls, hook execution, current-task symlink creation, push remotes, and PR
287
334
  title formatting.
288
335
 
336
+ ## Testing
337
+
338
+ Use the package testing contract below when validating changes:
339
+
340
+ ```bash
341
+ ace-test ace-git-worktree
342
+ ace-test ace-git-worktree feat
343
+ ace-test ace-git-worktree all
344
+ ace-test-e2e ace-git-worktree
345
+ ```
346
+
347
+ - `ace-test ace-git-worktree` targets deterministic package tests (`fast`).
348
+ - `ace-test ace-git-worktree feat` targets deterministic feature-level coverage.
349
+ - `ace-test-e2e ace-git-worktree` targets real workflow scenarios only.
350
+
289
351
  ## Troubleshooting
290
352
 
291
353
  ### Problem: `create --task` cannot find the task
@@ -15,7 +15,7 @@ A specialized agent for managing git worktrees with task-aware automation. Handl
15
15
 
16
16
  ### Task-Aware Operations
17
17
  - Create worktrees for specific tasks with automatic metadata integration
18
- - Fetch task information from ace-taskflow
18
+ - Fetch task information from ace-task
19
19
  - Update task status and add worktree metadata
20
20
  - Commit task changes before worktree creation
21
21
 
@@ -88,7 +88,7 @@ git:
88
88
 
89
89
  ## Integration Points
90
90
 
91
- - **ace-taskflow**: Task metadata fetching and status updates
91
+ - **ace-task**: Task metadata fetching and status updates
92
92
  - **ace-git-commit**: Consistent commit message generation
93
93
  - **ace-git**: Safe git command execution
94
94
  - **ace-core**: Configuration cascade management
@@ -16,7 +16,7 @@ Create git worktrees with task-aware automation or traditional branch-based crea
16
16
  ## Prerequisites
17
17
 
18
18
  - Git repository initialized and accessible
19
- - ace-taskflow available (for task-aware creation)
19
+ - ace-task available (for task-aware creation)
20
20
  - Configuration available in `.ace/git/worktree.yml`
21
21
  - Write permissions for worktree root directory
22
22
 
@@ -48,7 +48,7 @@ module Ace
48
48
  option :no_commit, desc: "Skip committing task changes", type: :boolean, aliases: ["--no-commit"]
49
49
  option :no_push, desc: "Skip pushing task changes", type: :boolean, aliases: ["--no-push"]
50
50
  option :no_upstream, desc: "Skip pushing with upstream tracking", type: :boolean, aliases: ["--no-upstream"]
51
- option :no_pr, desc: "Skip creating draft PR", type: :boolean, aliases: ["--no-pr"]
51
+ option :no_pr, desc: "Skip creating draft PR", type: :boolean
52
52
  option :push_remote, desc: "Remote to push to", aliases: []
53
53
  option :no_auto_navigate, desc: "Stay in current directory", type: :boolean, aliases: ["--no-auto-navigate"]
54
54
  option :commit_message, desc: "Custom commit message", aliases: []
@@ -22,9 +22,9 @@ module Ace
22
22
  ]
23
23
 
24
24
  option :format, desc: "Output format: table, json, simple", aliases: [], default: "table"
25
- option :show_tasks, desc: "Include task associations", type: :boolean, aliases: ["--show-tasks"]
26
- option :task_associated, desc: "Show only task-associated worktrees", type: :boolean, aliases: ["--task-associated"]
27
- option :usable, desc: "Show only usable worktrees", type: :boolean, aliases: ["--usable"]
25
+ option :show_tasks, desc: "Include task associations", type: :boolean
26
+ option :task_associated, desc: "Show only task-associated worktrees", type: :boolean
27
+ option :usable, desc: "Show only usable worktrees", type: :boolean
28
28
  option :search, desc: "Filter by branch name pattern", aliases: []
29
29
  option :quiet, type: :boolean, aliases: ["-q"], desc: "Suppress non-essential output"
30
30
  option :verbose, type: :boolean, aliases: ["-v"], desc: "Show verbose output"
@@ -816,6 +816,7 @@ module Ace
816
816
  #
817
817
  # When tmux config is enabled and ace-tmux is available, launches a tmux
818
818
  # session rooted at the worktree path (replaces current process).
819
+ # Uses `start` outside tmux and `window` inside tmux.
819
820
  # Otherwise falls back to displaying the cd command.
820
821
  #
821
822
  # @param worktree_path [String] Path to the worktree
@@ -824,7 +825,8 @@ module Ace
824
825
 
825
826
  if tmux_enabled?
826
827
  if ace_tmux_available?
827
- Kernel.exec("ace-tmux", "--root", worktree_path)
828
+ command = ENV["TMUX"].to_s.strip.empty? ? "start" : "window"
829
+ Kernel.exec("ace-tmux", command, "--root", worktree_path)
828
830
  else
829
831
  puts "Warning: tmux is enabled in config but ace-tmux is not installed."
830
832
  puts "Install ace-tmux or disable tmux in .ace/git/worktree.yml"
@@ -84,7 +84,8 @@ module Ace
84
84
 
85
85
  # Optionally remove the directory
86
86
  if remove_directory && File.exist?(expanded_path)
87
- remove_worktree_directory(expanded_path)
87
+ directory_result = remove_worktree_directory(expanded_path)
88
+ return directory_result unless directory_result[:success]
88
89
  end
89
90
 
90
91
  # Optionally delete the branch
@@ -305,11 +306,14 @@ module Ace
305
306
  #
306
307
  # @param worktree_path [String] Worktree path
307
308
  def remove_worktree_directory(worktree_path)
308
- if File.exist?(worktree_path)
309
- FileUtils.rm_rf(worktree_path)
310
- end
309
+ return {success: true, message: "Worktree directory already absent"} unless File.exist?(worktree_path)
310
+
311
+ FileUtils.rm_rf(worktree_path)
312
+ return {success: true, message: "Worktree directory removed"} unless File.exist?(worktree_path)
313
+
314
+ error_result("Worktree directory still exists after removal: #{worktree_path}")
311
315
  rescue => e
312
- warn "Warning: Failed to remove worktree directory: #{e.message}"
316
+ error_result("Failed to remove worktree directory: #{e.message}")
313
317
  end
314
318
 
315
319
  # Check if worktree has uncommitted changes
@@ -339,7 +343,7 @@ module Ace
339
343
  # @return [Hash] Command result
340
344
  def execute_git_worktree_prune
341
345
  require_relative "../atoms/git_command"
342
- Atoms::GitCommand.worktree("prune", timeout: @timeout)
346
+ Atoms::GitCommand.worktree("prune", "--expire", "now", timeout: @timeout)
343
347
  end
344
348
 
345
349
  # Parse prune output to count pruned worktrees
@@ -3,7 +3,7 @@
3
3
  module Ace
4
4
  module Git
5
5
  module Worktree
6
- VERSION = '0.19.4'
6
+ VERSION = '0.21.4'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-git-worktree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.4
4
+ version: 0.21.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-03-29 00:00:00.000000000 Z
10
+ date: 2026-04-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ace-support-cli