aidp 0.15.2 → 0.16.0

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -0
  3. data/lib/aidp/analyze/error_handler.rb +14 -15
  4. data/lib/aidp/analyze/runner.rb +27 -5
  5. data/lib/aidp/analyze/steps.rb +4 -0
  6. data/lib/aidp/cli/jobs_command.rb +2 -1
  7. data/lib/aidp/cli.rb +812 -3
  8. data/lib/aidp/concurrency/backoff.rb +148 -0
  9. data/lib/aidp/concurrency/exec.rb +192 -0
  10. data/lib/aidp/concurrency/wait.rb +148 -0
  11. data/lib/aidp/concurrency.rb +71 -0
  12. data/lib/aidp/config.rb +20 -0
  13. data/lib/aidp/daemon/runner.rb +9 -8
  14. data/lib/aidp/debug_mixin.rb +1 -0
  15. data/lib/aidp/errors.rb +12 -0
  16. data/lib/aidp/execute/interactive_repl.rb +102 -11
  17. data/lib/aidp/execute/repl_macros.rb +776 -2
  18. data/lib/aidp/execute/runner.rb +27 -5
  19. data/lib/aidp/execute/steps.rb +2 -0
  20. data/lib/aidp/harness/config_loader.rb +24 -2
  21. data/lib/aidp/harness/enhanced_runner.rb +16 -2
  22. data/lib/aidp/harness/error_handler.rb +1 -1
  23. data/lib/aidp/harness/provider_info.rb +19 -15
  24. data/lib/aidp/harness/provider_manager.rb +47 -41
  25. data/lib/aidp/harness/runner.rb +3 -11
  26. data/lib/aidp/harness/state/persistence.rb +1 -6
  27. data/lib/aidp/harness/state_manager.rb +115 -7
  28. data/lib/aidp/harness/status_display.rb +11 -18
  29. data/lib/aidp/harness/ui/navigation/submenu.rb +1 -0
  30. data/lib/aidp/harness/ui/workflow_controller.rb +1 -1
  31. data/lib/aidp/harness/user_interface.rb +12 -15
  32. data/lib/aidp/jobs/background_runner.rb +15 -5
  33. data/lib/aidp/providers/codex.rb +0 -1
  34. data/lib/aidp/providers/cursor.rb +0 -1
  35. data/lib/aidp/providers/github_copilot.rb +0 -1
  36. data/lib/aidp/providers/opencode.rb +0 -1
  37. data/lib/aidp/skills/composer.rb +178 -0
  38. data/lib/aidp/skills/loader.rb +205 -0
  39. data/lib/aidp/skills/registry.rb +220 -0
  40. data/lib/aidp/skills/skill.rb +174 -0
  41. data/lib/aidp/skills.rb +30 -0
  42. data/lib/aidp/version.rb +1 -1
  43. data/lib/aidp/watch/build_processor.rb +93 -28
  44. data/lib/aidp/watch/runner.rb +3 -2
  45. data/lib/aidp/workstream_executor.rb +244 -0
  46. data/lib/aidp/workstream_state.rb +212 -0
  47. data/lib/aidp/worktree.rb +208 -0
  48. data/lib/aidp.rb +6 -0
  49. metadata +17 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0691816c2748d6704d61bba9ed4c992f1b7d3ac8f70385ac94cb199916b71491'
4
- data.tar.gz: e0a8b4a7c9ece98972565635894d7312c4253c2adb3341192c7622e8e28d3a12
3
+ metadata.gz: 9bbab73392b0bc0fdcd74bb0f0e0bbf09716b2d2451b04aaa64c4ca4ccc7638e
4
+ data.tar.gz: af0d8b6d8937a1781b3b379ab6328ff17c5f0c96ea00c80f5886ce15b2265e2f
5
5
  SHA512:
6
- metadata.gz: 0d3ffce4b6aa8913658862e4412c165c4f20e8164845267d9d85c574b340d4140e63abbae359c47387255081c2738cbdaae215c159e1aeb4d36e7a84b5405dfc
7
- data.tar.gz: d2a809ea1b79bbe97e8adfe90903ecb610851837d7b744da208c20e74574346e18e4e3a25ebb136f702fb2501cf5855f1aac0d70d31b6be618c0843a51d5d90f
6
+ metadata.gz: ee40afa8126a8f8d6f92a7df6fbc634c6eb054499bb7dfdec53946f05ecf8faf8c1bcae1eb02274a7441bdd7685751363e20207587df818c8bb8fe300bfbc50f
7
+ data.tar.gz: 010a5afdd1a06905f09a423efe3bfde2ef84aca498f939667871191b1c9174168c31807959cbc3d50e7f7ab2cc552301032c1d232f6e70331ee8918debb7aba5
data/README.md CHANGED
@@ -93,6 +93,34 @@ aidp checkpoint history 20
93
93
  - PRD task completion percentage
94
94
  - File count and growth trends
95
95
 
96
+ ### Parallel Workstreams
97
+
98
+ Work on multiple tasks simultaneously using isolated git worktrees:
99
+
100
+ ```bash
101
+ # Create a workstream for each task
102
+ aidp ws new issue-123-fix-auth
103
+ aidp ws new feature-dashboard
104
+
105
+ # List all workstreams
106
+ aidp ws list
107
+
108
+ # Check status
109
+ aidp ws status issue-123-fix-auth
110
+
111
+ # Remove when complete
112
+ aidp ws rm issue-123-fix-auth --delete-branch
113
+ ```
114
+
115
+ **Benefits:**
116
+
117
+ - Complete isolation between tasks
118
+ - Separate git branches for each workstream
119
+ - Independent state and history
120
+ - Work on multiple features in parallel
121
+
122
+ See [Workstreams Guide](docs/WORKSTREAMS.md) for detailed usage.
123
+
96
124
  ## Command Reference
97
125
 
98
126
  ### Copilot Mode
@@ -147,6 +175,25 @@ aidp checkpoint clear
147
175
  aidp checkpoint clear --force # Skip confirmation
148
176
  ```
149
177
 
178
+ ### Workstream Commands
179
+
180
+ ```bash
181
+ # Create a new workstream
182
+ aidp ws new <slug>
183
+ aidp ws new <slug> --base-branch <branch>
184
+
185
+ # List all workstreams
186
+ aidp ws list
187
+
188
+ # Check workstream status
189
+ aidp ws status <slug>
190
+
191
+ # Remove a workstream
192
+ aidp ws rm <slug>
193
+ aidp ws rm <slug> --delete-branch # Also delete git branch
194
+ aidp ws rm <slug> --force # Skip confirmation
195
+ ```
196
+
150
197
  ### System Commands
151
198
 
152
199
  ```bash
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "logger"
4
+ require_relative "../concurrency"
4
5
 
5
6
  module Aidp
6
7
  module Analyze
@@ -38,21 +39,19 @@ module Aidp
38
39
 
39
40
  # Recovery strategies
40
41
  def retry_with_backoff(operation, max_retries: 3, base_delay: 1)
41
- retry_count = 0
42
- begin
42
+ Aidp::Concurrency::Backoff.retry(
43
+ max_attempts: max_retries,
44
+ base: base_delay,
45
+ strategy: :exponential,
46
+ jitter: 0.2,
47
+ on: [StandardError]
48
+ ) do
43
49
  operation.call
44
- rescue => e
45
- retry_count += 1
46
- if retry_count <= max_retries
47
- delay = base_delay * (2**(retry_count - 1))
48
- logger.warn("Retrying operation in #{delay} seconds (attempt #{retry_count}/#{max_retries})")
49
- Async::Task.current.sleep(delay)
50
- retry
51
- else
52
- logger.error("Operation failed after #{max_retries} retries: #{e.message}")
53
- raise e
54
- end
55
50
  end
51
+ rescue Aidp::Concurrency::MaxAttemptsError => e
52
+ logger.error("Operation failed after #{max_retries} retries")
53
+ # Re-raise the MaxAttemptsError to preserve error chain and context
54
+ raise e
56
55
  end
57
56
 
58
57
  def skip_step_with_warning(step_name, error)
@@ -176,8 +175,8 @@ module Aidp
176
175
  logger.warn("HTTP error: #{error.message}")
177
176
  case error.response&.code
178
177
  when "429" # Rate limited
179
- Async::Task.current.sleep(60) # Wait 1 minute
180
- retry_with_backoff(-> { context[:operation].call }, max_retries: 2)
178
+ # For rate limiting, use longer base delay
179
+ retry_with_backoff(-> { context[:operation].call }, max_retries: 2, base_delay: 60)
181
180
  when "500".."599" # Server errors
182
181
  retry_with_backoff(-> { context[:operation].call }, max_retries: 3)
183
182
  else
@@ -5,6 +5,7 @@ require_relative "steps"
5
5
  require_relative "progress"
6
6
  require_relative "../storage/file_manager"
7
7
  require_relative "../debug_mixin"
8
+ require_relative "../skills"
8
9
 
9
10
  module Aidp
10
11
  module Analyze
@@ -18,6 +19,8 @@ module Aidp
18
19
  @is_harness_mode = !harness_runner.nil?
19
20
  @file_manager = Aidp::Storage::FileManager.new(File.join(project_dir, ".aidp"))
20
21
  @prompt = prompt
22
+ @skills_registry = nil # Lazy-loaded
23
+ @skills_composer = Aidp::Skills::Composer.new
21
24
  end
22
25
 
23
26
  def progress
@@ -199,18 +202,37 @@ module Aidp
199
202
  step_spec = Aidp::Analyze::Steps::SPEC[step_name]
200
203
  raise "Step '#{step_name}' not found" unless step_spec
201
204
 
205
+ # Load template
202
206
  template_name = step_spec["templates"].first
203
207
  template_path = find_template(template_name)
204
208
  raise "Template not found for step #{step_name}" unless template_path
205
-
206
209
  template = File.read(template_path)
207
210
 
208
- # Replace template variables in the format {{key}} with option values
209
- options.each do |key, value|
210
- template = template.gsub("{{#{key}}}", value.to_s)
211
+ # Load skill if specified
212
+ skill = nil
213
+ if step_spec["skill"]
214
+ skill = skills_registry.find(step_spec["skill"])
215
+ if skill.nil?
216
+ Aidp.log_warn(
217
+ "skills",
218
+ "Skill not found for step",
219
+ step: step_name,
220
+ skill_id: step_spec["skill"]
221
+ )
222
+ end
211
223
  end
212
224
 
213
- template
225
+ # Compose skill + template
226
+ @skills_composer.compose(skill: skill, template: template, options: options)
227
+ end
228
+
229
+ def skills_registry
230
+ @skills_registry ||= begin
231
+ provider = get_harness_provider_safely if @is_harness_mode
232
+ registry = Aidp::Skills::Registry.new(project_dir: @project_dir, provider: provider)
233
+ registry.load_skills
234
+ registry
235
+ end
214
236
  end
215
237
 
216
238
  # Compose prompt with harness context and user input
@@ -5,20 +5,24 @@ module Aidp
5
5
  module Steps
6
6
  # Analysis step specifications
7
7
  # Templates are organized by purpose and named with action verbs
8
+ # Skills define WHO the agent is, templates define WHAT task to do
8
9
  SPEC = {
9
10
  "01_REPOSITORY_ANALYSIS" => {
11
+ "skill" => "repository_analyst",
10
12
  "templates" => ["analysis/analyze_repository.md"],
11
13
  "description" => "Initial code-maat based repository mining",
12
14
  "outs" => ["docs/analysis/repository_analysis.md"],
13
15
  "gate" => false
14
16
  },
15
17
  "02_ARCHITECTURE_ANALYSIS" => {
18
+ "skill" => "architecture_analyst",
16
19
  "templates" => ["analysis/analyze_architecture.md"],
17
20
  "description" => "Identify architectural patterns, dependencies, and violations",
18
21
  "outs" => ["docs/analysis/architecture_analysis.md"],
19
22
  "gate" => true
20
23
  },
21
24
  "03_TEST_ANALYSIS" => {
25
+ "skill" => "test_analyzer",
22
26
  "templates" => ["analysis/analyze_tests.md"],
23
27
  "description" => "Analyze existing test coverage and identify gaps",
24
28
  "outs" => ["docs/analysis/test_analysis.md"],
@@ -206,7 +206,8 @@ module Aidp
206
206
  # Exit if job is done
207
207
  break unless status[:running]
208
208
 
209
- # Wait before next update
209
+ # Periodic status polling - acceptable for UI updates
210
+ # Alternative: event-driven updates via IPC/file watching
210
211
  sleep 2
211
212
  end
212
213
  rescue Interrupt