ace-assign 0.73.2 → 0.73.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: ae08476e5414f7ce2059dded5afe8dfd4de816c47be62e94e80f718633708b1d
4
- data.tar.gz: 12f65ec84777c48848aa890c96a6bcb668a2d74b1a8adc86859eca9688184cf3
3
+ metadata.gz: fd45196619e790e8a8a74505099b10a7cf88713d77f0de6f60159bbd38b8d6f3
4
+ data.tar.gz: 138656d99a96b6bb20a73f73261c72dea4cbf8954100734ebb07c70b8fa881b6
5
5
  SHA512:
6
- metadata.gz: 4bff793e68ecf69f568c4c4eef2dd4245fd62eac2d414f95b24fae2ef29e71a751ab23a07cf9529bd4abf104e766be0d050b0dbcd3fc5453b4c9245cc2fed974
7
- data.tar.gz: e47b67f585f61f6fd35ecba390c7a4c7c1f658ff57d750c74c8cb59b0673bb2219763698008b6ac2bf8385f59dd8b36e34899df8d2cd6a282a35f3c12f132bd5
6
+ metadata.gz: 35b8cd42d75910295bd0c1a1fad0a4a0b9995aee1c6b8b74da2456f7ff45bdb3702a116c3999f10f40b661d7384a3f05bcbf58ab5503d36122bf722ff9f2bc8c
7
+ data.tar.gz: 7fab69e5bf5eeac648a4fbd30b166c1dff95b72debab0b18231420bbdd81715375d1e5ce969c936de923af610f024d3804e0d2f47a6001405a8517562cd291b9
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.73.4] - 2026-11-16
11
+
12
+ ### Fixed
13
+
14
+ - A terminal aggregate containing failed steps now reports the `failed` assignment state instead of `completed`, so an unsuccessful leg can never masquerade as a finished predecessor (terminal-failed assignments therefore reappear in `ace-assign list`, which hides completed work, and stay fail-closed non-prunable — `assignment still failed` — until recovered). Expose managed-recovery eligibility (failed state whose only pending steps are linked retries of failed steps — recovery is per-retry, so a second unresolved failure keeps the aggregate `failed` after one recovery run until it too is retried) through `QueueState#recovery_eligible?` and the `recovery` field of `ace-assign status --format json`; the compact status preview shows the failed history of a terminal failed aggregate. A recovered aggregate — every step terminal and every failed step holding a done linked retry — truthfully reports `completed` again (recovered-success exit; failed step rows stay failed), and `status --format json` steps now carry `added_by` for linkage verification. Under `status --scope`, the reported `state` and `recovery` reflect the scoped subtree (the endpoint's pre-existing scoped semantics). Retrying a retry is refused with the original step named, keeping retry linkage one-level by construction.
15
+
16
+ ## [0.73.3] - 2026-11-12
17
+
18
+ ### Fixed
19
+
20
+ - Allow exact step numbers with explicit assignment selection in start and finish, preserving subtree checks and avoiding accidental completion of another active step.
21
+
10
22
  ## [0.73.2] - 2026-11-10
11
23
 
12
24
  ### Fixed
data/docs/usage.md CHANGED
@@ -101,6 +101,10 @@ Show instructions for the active, next, or explicit step.
101
101
 
102
102
  Start the next workable pending step, or an explicit step number.
103
103
 
104
+ Use `ace-assign start 020 --assignment abc123` to start an exact step in a
105
+ selected assignment. Scoped targets (`abc123@010`) still reject steps outside
106
+ that subtree.
107
+
104
108
  ### `ace-assign finish [STEP] --message VALUE`
105
109
 
106
110
  Complete the active step with report content.
@@ -138,7 +142,9 @@ ace-assign add --yaml add-task.yml --after 010 --child
138
142
 
139
143
  ### `ace-assign retry STEP_REF`
140
144
 
141
- Retry a failed step by creating a new linked step.
145
+ Retry a failed step by creating a new linked step (a pending sibling linked by
146
+ `added_by: retry_of:NNN`; the failed original is preserved). Retrying a retry is
147
+ refused — retry the original step named in the error.
142
148
 
143
149
  ```bash
144
150
  ace-assign retry 040
@@ -180,7 +186,7 @@ If several assignments are open, scope every command to the exact assignment
180
186
 
181
187
  ```bash
182
188
  ace-assign status --assignment abc123
183
- ace-assign finish --message report.md --assignment abc123
189
+ ace-assign finish 020 --message report.md --assignment abc123
184
190
  ```
185
191
 
186
192
  ### Recovery from failure
@@ -188,6 +194,17 @@ ace-assign finish --message report.md --assignment abc123
188
194
  Keep the failed step intact; add a retry or a fix step, then continue. Do not
189
195
  delete steps to hide a failure.
190
196
 
197
+ Aggregate states and managed recovery: a terminal aggregate containing failed
198
+ steps reports `failed`, never `completed` (so it also stays visible in `list`
199
+ and fail-closed non-prunable). Once the only pending work is a linked retry of
200
+ a failed step, the assignment is recovery-eligible (`status --format json`
201
+ exposes `assignment.recovery`) and the overseer may re-enter it as an explicit
202
+ managed recovery on the SAME assignment. When every failed step holds a done
203
+ linked retry, the aggregate reports `completed` again (recovered success — the
204
+ failed rows stay `failed` for history) and `status --format json` steps carry
205
+ `added_by` for linkage verification. Under `--scope`, `state` and `recovery`
206
+ reflect the scoped subtree, matching the endpoint's scoped semantics.
207
+
191
208
  ### Multi-assignment management
192
209
 
193
210
  Use `ace-assign list --all` and `ace-assign select` to switch between open
@@ -11,17 +11,13 @@ module Ace
11
11
 
12
12
  desc "Complete active step with report content"
13
13
 
14
- argument :step, required: false, desc: "Step number to finish (active assignment only)"
14
+ argument :step, required: false, desc: "Step number to finish"
15
15
  option :message, aliases: ["-m"], desc: "Report content: string, file path, or pipe stdin"
16
16
  option :assignment, desc: "Target specific assignment ID"
17
17
  option :quiet, aliases: ["-q"], type: :boolean, default: false, desc: "Suppress non-essential output"
18
18
  option :debug, aliases: ["-d"], type: :boolean, default: false, desc: "Show debug output"
19
19
 
20
20
  def call(step: nil, **options)
21
- if step && options[:assignment]
22
- raise Error, "Positional STEP targeting is only supported for active assignment. Use --assignment without STEP for cross-assignment finish."
23
- end
24
-
25
21
  target = resolve_assignment_target(options)
26
22
  executor = build_executor_for_target(target)
27
23
  report_content = resolve_report_content(options)
@@ -62,7 +58,7 @@ module Ace
62
58
  fork_root = target.scope&.strip
63
59
  if fork_root && result[:state].subtree_complete?(fork_root)
64
60
  puts "Fork subtree #{fork_root} completed."
65
- elsif result[:state].complete?
61
+ elsif result[:state].assignment_state == :completed
66
62
  puts "Assignment completed! All steps done."
67
63
  else
68
64
  puts "No active step selected."
@@ -11,16 +11,12 @@ module Ace
11
11
 
12
12
  desc "Start next workable pending step"
13
13
 
14
- argument :step, required: false, desc: "Step number to start (active assignment only)"
14
+ argument :step, required: false, desc: "Step number to start"
15
15
  option :assignment, desc: "Target specific assignment ID"
16
16
  option :quiet, aliases: ["-q"], type: :boolean, default: false, desc: "Suppress non-essential output"
17
17
  option :debug, aliases: ["-d"], type: :boolean, default: false, desc: "Show debug output"
18
18
 
19
19
  def call(step: nil, **options)
20
- if step && options[:assignment]
21
- raise Error, "Positional STEP targeting is only supported for active assignment. Use --assignment without STEP for cross-assignment start."
22
- end
23
-
24
20
  target = resolve_assignment_target(options)
25
21
  executor = build_executor_for_target(target)
26
22
  result = executor.start_step(step_number: step, fork_root: target.scope)
@@ -92,7 +92,8 @@ module Ace
92
92
  assignment: {
93
93
  id: assignment.id,
94
94
  name: assignment.name,
95
- state: state.assignment_state.to_s
95
+ state: state.assignment_state.to_s,
96
+ recovery: state.recovery_eligible?
96
97
  },
97
98
  steps: state.steps.map { |step| step_to_h(step) },
98
99
  active_steps: active_steps.map { |step| step_to_h(step, effective_fork_provider: effective_fork_provider_for(step, scoped_fork_metadata_step(state, step, target.scope, scope_root))) },
@@ -111,6 +112,7 @@ module Ace
111
112
  number: step.number,
112
113
  name: step.name,
113
114
  status: step.status.to_s,
115
+ added_by: step.added_by,
114
116
  skill: step.skill,
115
117
  workflow: step.workflow,
116
118
  context: step.context,
@@ -161,7 +163,7 @@ module Ace
161
163
  details << "Active: #{step_refs(active_steps)}"
162
164
  elsif next_step
163
165
  details << "Next: #{next_step.number} #{next_step.name}"
164
- elsif state.complete?
166
+ elsif state.assignment_state == :completed
165
167
  details << "Next: complete"
166
168
  end
167
169
 
@@ -277,7 +279,7 @@ module Ace
277
279
  effective_fork_provider = effective_fork_provider_for(view.next_step, scoped_fork_step)
278
280
  puts "Fork Provider: #{effective_fork_provider}" if effective_fork_provider
279
281
  print_scoped_fork_pid_info(scoped_fork_step)
280
- elsif view.scoped_state.complete?
282
+ elsif view.scoped_state.assignment_state == :completed
281
283
  puts
282
284
  puts "Assignment completed!"
283
285
  end
@@ -110,8 +110,14 @@ module Ace
110
110
  #
111
111
  # States (checked in priority order):
112
112
  # - :empty - No steps in queue
113
- # - :completed - All steps complete (done or failed)
114
- # - :failed - Has failed step(s) but NOT all complete (stuck)
113
+ # - :completed - Successful completion (all steps done), or a
114
+ # recovered success: every step terminal and every
115
+ # failed step has a done linked retry (the failed
116
+ # rows themselves stay failed for history)
117
+ # - :failed - Has failed step(s) not recovered by a done linked
118
+ # retry; failures are never summarized away, not
119
+ # even when every step has already reached a
120
+ # terminal status (an unsuccessful terminal state)
115
121
  # - :running - Has active step(s) with recent activity (< 1 hour)
116
122
  # - :stalled - Has active step(s) but all are stale (> 1 hour)
117
123
  # - :paused - Has pending but no active step (interrupted)
@@ -119,7 +125,7 @@ module Ace
119
125
  # @return [Symbol] Assignment state
120
126
  def assignment_state
121
127
  return :empty if empty?
122
- return :completed if complete?
128
+ return :completed if complete? && (failed.empty? || recovered?)
123
129
  return :failed if failed.any?
124
130
  return :running if active_steps.any? && recently_active?
125
131
  return :stalled if active_steps.any?
@@ -127,6 +133,55 @@ module Ace
127
133
  :paused
128
134
  end
129
135
 
136
+ # Truthful recovered-success verdict (aggregate level only): every
137
+ # step is terminal and every failed step has a done linked retry.
138
+ # The failed step rows keep their failed status — history is
139
+ # preserved; the aggregate reports that the failed work has a
140
+ # done outcome, so a recovered leg can leave the failed state
141
+ # through the normal lifecycle (handoff, outcome, discovery).
142
+ #
143
+ # @return [Boolean]
144
+ def recovered?
145
+ return false unless complete?
146
+
147
+ failed.all? { |step| recovered_failure?(step) }
148
+ end
149
+
150
+ # Whether the failed step has at least one done linked retry.
151
+ #
152
+ # @param step [Step] failed step
153
+ # @return [Boolean]
154
+ def recovered_failure?(step)
155
+ steps.any? { |other| other.retry? && other.status == :done && other.retry_of == step.number }
156
+ end
157
+
158
+ # Pending steps that are linked retries of failed steps.
159
+ #
160
+ # @return [Array<Step>] Pending linked retries in queue order
161
+ def pending_linked_retries
162
+ failed_numbers = failed.map(&:number)
163
+ pending.select { |step| step.retry? && failed_numbers.include?(step.retry_of) }
164
+ end
165
+
166
+ # Managed-recovery eligibility (read-only truth for explicit
167
+ # recovery selection by the overseer): the assignment reached an
168
+ # unsuccessful terminal state — failed steps, nothing active —
169
+ # and the owner recorded a pending linked retry of a failed step
170
+ # while no other work stays pending. Eligibility never reinterprets
171
+ # the aggregate: the failed history stays failed; the pending
172
+ # linked retry is the owner's explicit re-entry decision.
173
+ #
174
+ # @return [Boolean]
175
+ def recovery_eligible?
176
+ return false if failed.empty?
177
+ return false if active_steps.any?
178
+
179
+ linked = pending_linked_retries
180
+ return false if linked.empty?
181
+
182
+ pending.count == linked.count
183
+ end
184
+
130
185
  # Check if any active step has recent activity.
131
186
  # @param threshold [Integer] Seconds since started_at to consider active (default: 1 hour)
132
187
  # @return [Boolean]
@@ -414,6 +414,15 @@ module Ace
414
414
  # Find the step to retry
415
415
  original = state.find_by_number(step_ref.to_s)
416
416
  raise StepErrors::NotFound, "Step #{step_ref} not found in queue" unless original
417
+ # Keep retry linkage one-level by construction: a retry of a
418
+ # retry would create transitive chains the managed-recovery
419
+ # linkage (and the recovered-success verdict) cannot see. The
420
+ # original failed step is the unit of failure — point the
421
+ # operator at it.
422
+ if original.retry?
423
+ raise StepErrors::InvalidState,
424
+ "Step #{original.number} is itself a retry of #{original.retry_of}; retry the original step #{original.retry_of} instead"
425
+ end
417
426
  validate_retry_scope!(state, original, fork_root)
418
427
 
419
428
  # Get existing numbers
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ace
4
4
  module Assign
5
- VERSION = "0.73.2"
5
+ VERSION = "0.73.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ace-assign
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.73.2
4
+ version: 0.73.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Czyz
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-11-10 00:00:00.000000000 Z
10
+ date: 2026-11-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ace-llm-providers-cli