ace-support-items 0.15.13 → 0.15.15

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: 6585d9188c2bbc67e6156618885cc6650a29e171fc772d6f830e7404d80e0ec1
4
- data.tar.gz: 836a2fafa627d3c41d913dac6e9fd8711d12c9d5db2dc7395f55bd923f410621
3
+ metadata.gz: ee3fcee97215b4d7243d870366200e78369a85fc74fbe6c7ea8107efa23f8053
4
+ data.tar.gz: 8c9914130df26e74948b15d84b3311beb326855ff657ab6ce41d8b13bb039ccd
5
5
  SHA512:
6
- metadata.gz: 0eb399c95d82a51e04dc47ca33a85266190dd0fa00c17a76a3f34f2ecb6f391f464d9aeccff4341aeafeae0dc57d7b75a8b1df79ef9b53dfc263fc41d5da8fe8
7
- data.tar.gz: 627e3b43d6eeb4ed77627b981e83187da942139fd47e8ef9a27cffb4feb0def7f0d84c14ae52cfbf843888cb7982d23b426e55aff6b40bc6b705651a3578691b
6
+ metadata.gz: 90551754056d747f9f8a341f8f50601095b4c29e43725550652929b95479edac2e2b92e7e922c2ab552efb09decbf0340cd24765f255c47c1babb7ef0d4c7d9e
7
+ data.tar.gz: d315633aeb2cce808bdeb0a4eb1bf626a50079fba04d74f35849ca06dd649b639d65d71cc69930ab5611aaf7ee9b5248b0457319dcaa3dcfc1d173b1e6fc3368
data/CHANGELOG.md CHANGED
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.15.15] - 2026-10-18
11
+
12
+ ### Added
13
+
14
+ - `FolderMover#destination_path` computes the destination a move would create
15
+ without touching the filesystem, so callers can run pre-flight checks (for
16
+ example a Git-ignored destination guard).
17
+
18
+ ## [0.15.14] - 2026-10-06
19
+
20
+ ### Fixed
21
+
22
+ - Treat done, skipped and cancelled as terminal folder states; blocked work no longer counts as completed.
23
+
10
24
 
11
25
  ## [0.15.13] - 2026-09-02
12
26
 
@@ -7,10 +7,10 @@ module Ace
7
7
  module Items
8
8
  module Atoms
9
9
  # Detects whether all spec files in a folder have terminal status.
10
- # Used by orchestrator auto-archive: when all subtasks are done/skipped/blocked,
10
+ # Used by orchestrator auto-archive: when all subtasks are done/skipped/cancelled,
11
11
  # the parent can be auto-archived.
12
12
  class FolderCompletionDetector
13
- TERMINAL_STATUSES = %w[done skipped blocked].freeze
13
+ TERMINAL_STATUSES = %w[done skipped cancelled].freeze
14
14
 
15
15
  # Check if all spec files in a directory have terminal status.
16
16
  #
@@ -17,35 +17,38 @@ module Ace
17
17
  @root_dir = root_dir
18
18
  end
19
19
 
20
- # Move an item folder to a target location.
20
+ # Compute the destination path for an item without moving it.
21
+ # Used by pre-flight checks (e.g. Git-ignored task guards).
21
22
  #
22
23
  # @param item [#path] Item with a path attribute (directory to move)
23
24
  # @param to [String] Target folder name (short or full, e.g., "maybe", "_archive")
24
25
  # @param date [Time, nil] Date used to compute archive partition (default: Time.now)
25
- # @return [String] New path of the item directory
26
- def move(item, to:, date: nil)
26
+ # @return [String] Destination directory path
27
+ def destination_path(item, to:, date: nil)
27
28
  if Atoms::SpecialFolderDetector.virtual_filter?(to)
28
29
  raise ArgumentError, "Cannot move to virtual filter '#{to}' — it is not a physical folder"
29
30
  end
30
31
 
31
32
  normalized = Atoms::SpecialFolderDetector.normalize(to)
32
-
33
- target_parent = if normalized == "_archive"
34
- partition = Atoms::DatePartitionPath.compute(date || Time.now)
35
- File.expand_path(File.join(@root_dir, normalized, partition))
36
- else
37
- File.expand_path(File.join(@root_dir, normalized))
38
- end
39
-
33
+ target_parent = destination_parent(normalized, date)
40
34
  validate_path_traversal!(target_parent)
41
- FileUtils.mkdir_p(target_parent)
42
35
 
43
- folder_name = File.basename(item.path)
44
- new_path = File.join(target_parent, folder_name)
36
+ File.join(target_parent, File.basename(item.path))
37
+ end
38
+
39
+ # Move an item folder to a target location.
40
+ #
41
+ # @param item [#path] Item with a path attribute (directory to move)
42
+ # @param to [String] Target folder name (short or full, e.g., "maybe", "_archive")
43
+ # @param date [Time, nil] Date used to compute archive partition (default: Time.now)
44
+ # @return [String] New path of the item directory
45
+ def move(item, to:, date: nil)
46
+ new_path = destination_path(item, to: to, date: date)
45
47
 
46
48
  # Same-location no-op check
47
49
  return item.path if File.expand_path(item.path) == File.expand_path(new_path)
48
50
 
51
+ FileUtils.mkdir_p(File.dirname(new_path))
49
52
  atomic_move(item.path, new_path)
50
53
  end
51
54
 
@@ -65,6 +68,15 @@ module Ace
65
68
 
66
69
  private
67
70
 
71
+ def destination_parent(normalized, date)
72
+ if normalized == "_archive"
73
+ partition = Atoms::DatePartitionPath.compute(date || Time.now)
74
+ File.expand_path(File.join(@root_dir, normalized, partition))
75
+ else
76
+ File.expand_path(File.join(@root_dir, normalized))
77
+ end
78
+ end
79
+
68
80
  def validate_path_traversal!(target_parent)
69
81
  root_real = File.expand_path(@root_dir)
70
82
  unless target_parent.start_with?(root_real + File::SEPARATOR)
@@ -3,7 +3,7 @@
3
3
  module Ace
4
4
  module Support
5
5
  module Items
6
- VERSION = "0.15.13"
6
+ VERSION = "0.15.15"
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-support-items
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.13
4
+ version: 0.15.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-09-05 00:00:00.000000000 Z
10
+ date: 2026-10-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ace-support-core