aidp 0.7.0 → 0.8.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 (119) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +60 -214
  3. data/bin/aidp +1 -1
  4. data/lib/aidp/analysis/kb_inspector.rb +38 -23
  5. data/lib/aidp/analysis/seams.rb +2 -31
  6. data/lib/aidp/analysis/tree_sitter_grammar_loader.rb +0 -13
  7. data/lib/aidp/analysis/tree_sitter_scan.rb +3 -20
  8. data/lib/aidp/analyze/error_handler.rb +2 -75
  9. data/lib/aidp/analyze/json_file_storage.rb +292 -0
  10. data/lib/aidp/analyze/progress.rb +12 -0
  11. data/lib/aidp/analyze/progress_visualizer.rb +12 -17
  12. data/lib/aidp/analyze/ruby_maat_integration.rb +13 -31
  13. data/lib/aidp/analyze/runner.rb +256 -87
  14. data/lib/aidp/cli/jobs_command.rb +100 -432
  15. data/lib/aidp/cli.rb +309 -239
  16. data/lib/aidp/config.rb +298 -10
  17. data/lib/aidp/debug_logger.rb +195 -0
  18. data/lib/aidp/debug_mixin.rb +187 -0
  19. data/lib/aidp/execute/progress.rb +9 -0
  20. data/lib/aidp/execute/runner.rb +221 -40
  21. data/lib/aidp/execute/steps.rb +17 -7
  22. data/lib/aidp/execute/workflow_selector.rb +211 -0
  23. data/lib/aidp/harness/completion_checker.rb +268 -0
  24. data/lib/aidp/harness/condition_detector.rb +1526 -0
  25. data/lib/aidp/harness/config_loader.rb +373 -0
  26. data/lib/aidp/harness/config_manager.rb +382 -0
  27. data/lib/aidp/harness/config_schema.rb +1006 -0
  28. data/lib/aidp/harness/config_validator.rb +355 -0
  29. data/lib/aidp/harness/configuration.rb +477 -0
  30. data/lib/aidp/harness/enhanced_runner.rb +494 -0
  31. data/lib/aidp/harness/error_handler.rb +616 -0
  32. data/lib/aidp/harness/provider_config.rb +423 -0
  33. data/lib/aidp/harness/provider_factory.rb +306 -0
  34. data/lib/aidp/harness/provider_manager.rb +1269 -0
  35. data/lib/aidp/harness/provider_type_checker.rb +88 -0
  36. data/lib/aidp/harness/runner.rb +411 -0
  37. data/lib/aidp/harness/state/errors.rb +28 -0
  38. data/lib/aidp/harness/state/metrics.rb +219 -0
  39. data/lib/aidp/harness/state/persistence.rb +128 -0
  40. data/lib/aidp/harness/state/provider_state.rb +132 -0
  41. data/lib/aidp/harness/state/ui_state.rb +68 -0
  42. data/lib/aidp/harness/state/workflow_state.rb +123 -0
  43. data/lib/aidp/harness/state_manager.rb +586 -0
  44. data/lib/aidp/harness/status_display.rb +888 -0
  45. data/lib/aidp/harness/ui/base.rb +16 -0
  46. data/lib/aidp/harness/ui/enhanced_tui.rb +545 -0
  47. data/lib/aidp/harness/ui/enhanced_workflow_selector.rb +252 -0
  48. data/lib/aidp/harness/ui/error_handler.rb +132 -0
  49. data/lib/aidp/harness/ui/frame_manager.rb +361 -0
  50. data/lib/aidp/harness/ui/job_monitor.rb +500 -0
  51. data/lib/aidp/harness/ui/navigation/main_menu.rb +311 -0
  52. data/lib/aidp/harness/ui/navigation/menu_formatter.rb +120 -0
  53. data/lib/aidp/harness/ui/navigation/menu_item.rb +142 -0
  54. data/lib/aidp/harness/ui/navigation/menu_state.rb +139 -0
  55. data/lib/aidp/harness/ui/navigation/submenu.rb +202 -0
  56. data/lib/aidp/harness/ui/navigation/workflow_selector.rb +176 -0
  57. data/lib/aidp/harness/ui/progress_display.rb +280 -0
  58. data/lib/aidp/harness/ui/question_collector.rb +141 -0
  59. data/lib/aidp/harness/ui/spinner_group.rb +184 -0
  60. data/lib/aidp/harness/ui/spinner_helper.rb +152 -0
  61. data/lib/aidp/harness/ui/status_manager.rb +312 -0
  62. data/lib/aidp/harness/ui/status_widget.rb +280 -0
  63. data/lib/aidp/harness/ui/workflow_controller.rb +312 -0
  64. data/lib/aidp/harness/user_interface.rb +2381 -0
  65. data/lib/aidp/provider_manager.rb +131 -7
  66. data/lib/aidp/providers/anthropic.rb +28 -103
  67. data/lib/aidp/providers/base.rb +170 -0
  68. data/lib/aidp/providers/cursor.rb +52 -181
  69. data/lib/aidp/providers/gemini.rb +24 -107
  70. data/lib/aidp/providers/macos_ui.rb +99 -5
  71. data/lib/aidp/providers/opencode.rb +194 -0
  72. data/lib/aidp/storage/csv_storage.rb +172 -0
  73. data/lib/aidp/storage/file_manager.rb +214 -0
  74. data/lib/aidp/storage/json_storage.rb +140 -0
  75. data/lib/aidp/version.rb +1 -1
  76. data/lib/aidp.rb +54 -39
  77. data/templates/COMMON/AGENT_BASE.md +11 -0
  78. data/templates/EXECUTE/00_PRD.md +4 -4
  79. data/templates/EXECUTE/02_ARCHITECTURE.md +5 -4
  80. data/templates/EXECUTE/07_TEST_PLAN.md +4 -1
  81. data/templates/EXECUTE/08_TASKS.md +4 -4
  82. data/templates/EXECUTE/10_IMPLEMENTATION_AGENT.md +4 -4
  83. data/templates/README.md +279 -0
  84. data/templates/aidp-development.yml.example +373 -0
  85. data/templates/aidp-minimal.yml.example +48 -0
  86. data/templates/aidp-production.yml.example +475 -0
  87. data/templates/aidp.yml.example +598 -0
  88. metadata +93 -69
  89. data/lib/aidp/analyze/agent_personas.rb +0 -71
  90. data/lib/aidp/analyze/agent_tool_executor.rb +0 -439
  91. data/lib/aidp/analyze/data_retention_manager.rb +0 -421
  92. data/lib/aidp/analyze/database.rb +0 -260
  93. data/lib/aidp/analyze/dependencies.rb +0 -335
  94. data/lib/aidp/analyze/export_manager.rb +0 -418
  95. data/lib/aidp/analyze/focus_guidance.rb +0 -517
  96. data/lib/aidp/analyze/incremental_analyzer.rb +0 -533
  97. data/lib/aidp/analyze/language_analysis_strategies.rb +0 -897
  98. data/lib/aidp/analyze/large_analysis_progress.rb +0 -499
  99. data/lib/aidp/analyze/memory_manager.rb +0 -339
  100. data/lib/aidp/analyze/metrics_storage.rb +0 -336
  101. data/lib/aidp/analyze/parallel_processor.rb +0 -454
  102. data/lib/aidp/analyze/performance_optimizer.rb +0 -691
  103. data/lib/aidp/analyze/repository_chunker.rb +0 -697
  104. data/lib/aidp/analyze/static_analysis_detector.rb +0 -577
  105. data/lib/aidp/analyze/storage.rb +0 -655
  106. data/lib/aidp/analyze/tool_configuration.rb +0 -441
  107. data/lib/aidp/analyze/tool_modernization.rb +0 -750
  108. data/lib/aidp/database/pg_adapter.rb +0 -148
  109. data/lib/aidp/database_config.rb +0 -69
  110. data/lib/aidp/database_connection.rb +0 -72
  111. data/lib/aidp/job_manager.rb +0 -41
  112. data/lib/aidp/jobs/base_job.rb +0 -45
  113. data/lib/aidp/jobs/provider_execution_job.rb +0 -83
  114. data/lib/aidp/project_detector.rb +0 -117
  115. data/lib/aidp/providers/agent_supervisor.rb +0 -348
  116. data/lib/aidp/providers/supervised_base.rb +0 -317
  117. data/lib/aidp/providers/supervised_cursor.rb +0 -22
  118. data/lib/aidp/sync.rb +0 -13
  119. data/lib/aidp/workspace.rb +0 -19
@@ -0,0 +1,475 @@
1
+ # Production AIDP Configuration
2
+ # This is a production-ready configuration with comprehensive monitoring and security
3
+ # Copy this file to your project root as 'aidp.yml' and customize as needed
4
+
5
+ # Harness configuration
6
+ harness:
7
+ # Default provider to use
8
+ default_provider: "claude"
9
+
10
+ # Fallback providers in order of preference
11
+ fallback_providers: ["cursor", "gemini"]
12
+
13
+ # Production settings
14
+ max_retries: 3
15
+ request_timeout: 300
16
+ user_feedback_timeout: 300
17
+ work_completion_timeout: 1800
18
+
19
+ # Advanced features
20
+ auto_switch_on_error: true
21
+ auto_switch_on_rate_limit: true
22
+ max_concurrent_requests: 10
23
+
24
+ # Circuit breaker configuration
25
+ circuit_breaker:
26
+ enabled: true
27
+ failure_threshold: 5
28
+ timeout: 300
29
+ half_open_max_calls: 3
30
+
31
+ # Retry configuration
32
+ retry:
33
+ enabled: true
34
+ max_attempts: 3
35
+ base_delay: 2.0
36
+ max_delay: 120.0
37
+ exponential_base: 2.0
38
+ jitter: true
39
+
40
+ # Rate limiting configuration
41
+ rate_limit:
42
+ enabled: true
43
+ default_reset_time: 3600
44
+ burst_limit: 20
45
+ sustained_limit: 10
46
+
47
+ # Load balancing configuration
48
+ load_balancing:
49
+ enabled: true
50
+ strategy: "weighted_round_robin"
51
+ health_check_interval: 30
52
+ unhealthy_threshold: 3
53
+
54
+ # Health check configuration
55
+ health_check:
56
+ enabled: true
57
+ interval: 60
58
+ timeout: 15
59
+ failure_threshold: 3
60
+ success_threshold: 2
61
+
62
+ # Metrics configuration
63
+ metrics:
64
+ enabled: true
65
+ retention_days: 90
66
+ aggregation_interval: 300
67
+ export_interval: 3600
68
+
69
+ # Session configuration
70
+ session:
71
+ enabled: true
72
+ timeout: 3600
73
+ sticky_sessions: true
74
+ session_affinity: "provider_model"
75
+
76
+ # User interface configuration
77
+ ui:
78
+ enabled: true
79
+ interactive_mode: true
80
+ file_selection: true
81
+ progress_display: true
82
+ status_updates: true
83
+ pause_resume: true
84
+
85
+ # Error handling configuration
86
+ error_handling:
87
+ enabled: true
88
+ log_errors: true
89
+ retry_on_error: true
90
+ fallback_on_error: true
91
+ error_notification: true
92
+
93
+ # Performance optimization
94
+ performance:
95
+ enabled: true
96
+ cache_responses: true
97
+ parallel_processing: true
98
+ batch_requests: true
99
+ connection_pooling: true
100
+
101
+ # Security configuration
102
+ security:
103
+ enabled: true
104
+ ssl_verify: true
105
+ allowed_hosts: []
106
+ blocked_hosts: []
107
+ api_key_rotation: true
108
+ audit_logging: true
109
+
110
+ # Provider configurations
111
+ providers:
112
+ # Claude provider (primary)
113
+ claude:
114
+ type: "api"
115
+ priority: 1
116
+ max_tokens: 200000
117
+ default_flags: ["--dangerously-skip-permissions"]
118
+
119
+ # Available models
120
+ models: ["claude-3-5-sonnet-20241022", "claude-3-5-haiku-20241022"]
121
+
122
+ # Model weights for load balancing
123
+ model_weights:
124
+ claude-3-5-sonnet-20241022: 3
125
+ claude-3-5-haiku-20241022: 2
126
+
127
+ # Model-specific configurations
128
+ models_config:
129
+ claude-3-5-sonnet-20241022:
130
+ flags: ["--dangerously-skip-permissions"]
131
+ max_tokens: 200000
132
+ timeout: 300
133
+ claude-3-5-haiku-20241022:
134
+ flags: ["--dangerously-skip-permissions"]
135
+ max_tokens: 200000
136
+ timeout: 180
137
+
138
+ # Authentication configuration
139
+ auth:
140
+ api_key_env: "ANTHROPIC_API_KEY"
141
+
142
+ # Endpoint configuration
143
+ endpoints:
144
+ default: "https://api.anthropic.com/v1/messages"
145
+
146
+ # Provider features
147
+ features:
148
+ file_upload: true
149
+ code_generation: true
150
+ analysis: true
151
+ vision: true
152
+ streaming: true
153
+ function_calling: true
154
+ tool_use: true
155
+
156
+ # Monitoring configuration
157
+ monitoring:
158
+ enabled: true
159
+ metrics_interval: 30
160
+
161
+ # Rate limiting configuration
162
+ rate_limit:
163
+ enabled: true
164
+ requests_per_minute: 50
165
+ requests_per_hour: 5000
166
+ tokens_per_minute: 40000
167
+ tokens_per_hour: 2000000
168
+ burst_limit: 5
169
+
170
+ # Retry configuration
171
+ retry:
172
+ enabled: true
173
+ max_attempts: 3
174
+ base_delay: 2.0
175
+ max_delay: 120.0
176
+ exponential_base: 2.0
177
+ jitter: true
178
+ retry_on_rate_limit: true
179
+
180
+ # Circuit breaker configuration
181
+ circuit_breaker:
182
+ enabled: true
183
+ failure_threshold: 5
184
+ timeout: 300
185
+ half_open_max_calls: 3
186
+
187
+ # Cost tracking
188
+ cost:
189
+ input_cost_per_token: 0.000003
190
+ output_cost_per_token: 0.000015
191
+ fixed_cost_per_request: 0.0
192
+ currency: "USD"
193
+
194
+ # Health check configuration
195
+ health_check:
196
+ enabled: true
197
+ interval: 60
198
+ timeout: 15
199
+ failure_threshold: 3
200
+ success_threshold: 2
201
+ check_url: "https://api.anthropic.com/v1/messages"
202
+
203
+ # Logging configuration
204
+ log:
205
+ enabled: true
206
+ level: "info"
207
+ file: "logs/claude.log"
208
+ max_size: 52428800 # 50MB
209
+ max_files: 10
210
+ format: "json"
211
+ log_requests: true
212
+ log_responses: false
213
+
214
+ # Cache configuration
215
+ cache:
216
+ enabled: true
217
+ ttl: 1800
218
+ max_size: 500
219
+ strategy: "lru"
220
+
221
+ # Security configuration
222
+ security:
223
+ ssl_verify: true
224
+ allowed_hosts: ["api.anthropic.com"]
225
+ blocked_hosts: []
226
+ timeout: 30
227
+ max_redirects: 5
228
+
229
+ # Cursor provider (fallback)
230
+ cursor:
231
+ type: "package"
232
+ priority: 2
233
+ default_flags: []
234
+
235
+ # Available models
236
+ models: ["cursor-default", "cursor-fast"]
237
+
238
+ # Model weights for load balancing
239
+ model_weights:
240
+ cursor-default: 3
241
+ cursor-fast: 2
242
+
243
+ # Model-specific configurations
244
+ models_config:
245
+ cursor-default:
246
+ flags: []
247
+ timeout: 600
248
+ cursor-fast:
249
+ flags: ["--fast"]
250
+ timeout: 300
251
+
252
+ # Provider features
253
+ features:
254
+ file_upload: true
255
+ code_generation: true
256
+ analysis: true
257
+ streaming: true
258
+
259
+ # Monitoring configuration
260
+ monitoring:
261
+ enabled: true
262
+ metrics_interval: 30
263
+
264
+ # Rate limiting configuration
265
+ rate_limit:
266
+ enabled: true
267
+ requests_per_minute: 60
268
+ requests_per_hour: 1000
269
+ burst_limit: 10
270
+
271
+ # Retry configuration
272
+ retry:
273
+ enabled: true
274
+ max_attempts: 3
275
+ base_delay: 1.0
276
+ max_delay: 60.0
277
+ exponential_base: 2.0
278
+ jitter: true
279
+
280
+ # Circuit breaker configuration
281
+ circuit_breaker:
282
+ enabled: true
283
+ failure_threshold: 5
284
+ timeout: 300
285
+ half_open_max_calls: 3
286
+
287
+ # Cost tracking
288
+ cost:
289
+ input_cost_per_token: 0.0
290
+ output_cost_per_token: 0.0
291
+ fixed_cost_per_request: 0.0
292
+ currency: "USD"
293
+
294
+ # Health check configuration
295
+ health_check:
296
+ enabled: true
297
+ interval: 60
298
+ timeout: 10
299
+ failure_threshold: 3
300
+ success_threshold: 2
301
+
302
+ # Logging configuration
303
+ log:
304
+ enabled: true
305
+ level: "info"
306
+ file: "logs/cursor.log"
307
+ max_size: 52428800 # 50MB
308
+ max_files: 10
309
+ format: "json"
310
+ log_requests: true
311
+ log_responses: false
312
+
313
+ # Cache configuration
314
+ cache:
315
+ enabled: true
316
+ ttl: 3600
317
+ max_size: 200
318
+ strategy: "lru"
319
+
320
+ # Security configuration
321
+ security:
322
+ ssl_verify: true
323
+ allowed_hosts: []
324
+ blocked_hosts: []
325
+ timeout: 30
326
+ max_redirects: 5
327
+
328
+ # Gemini provider (fallback)
329
+ gemini:
330
+ type: "api"
331
+ priority: 3
332
+ max_tokens: 100000
333
+ default_flags: []
334
+
335
+ # Available models
336
+ models: ["gemini-1.5-pro", "gemini-1.5-flash"]
337
+
338
+ # Model weights for load balancing
339
+ model_weights:
340
+ gemini-1.5-pro: 3
341
+ gemini-1.5-flash: 2
342
+
343
+ # Model-specific configurations
344
+ models_config:
345
+ gemini-1.5-pro:
346
+ flags: []
347
+ max_tokens: 100000
348
+ timeout: 300
349
+ gemini-1.5-flash:
350
+ flags: []
351
+ max_tokens: 100000
352
+ timeout: 180
353
+
354
+ # Authentication configuration
355
+ auth:
356
+ api_key_env: "GEMINI_API_KEY"
357
+
358
+ # Endpoint configuration
359
+ endpoints:
360
+ default: "https://generativelanguage.googleapis.com/v1beta/models"
361
+
362
+ # Provider features
363
+ features:
364
+ file_upload: true
365
+ code_generation: true
366
+ analysis: true
367
+ vision: true
368
+ streaming: true
369
+
370
+ # Monitoring configuration
371
+ monitoring:
372
+ enabled: true
373
+ metrics_interval: 30
374
+
375
+ # Rate limiting configuration
376
+ rate_limit:
377
+ enabled: true
378
+ requests_per_minute: 60
379
+ requests_per_hour: 1500
380
+ tokens_per_minute: 32000
381
+ tokens_per_hour: 1000000
382
+ burst_limit: 10
383
+
384
+ # Retry configuration
385
+ retry:
386
+ enabled: true
387
+ max_attempts: 3
388
+ base_delay: 1.0
389
+ max_delay: 60.0
390
+ exponential_base: 2.0
391
+ jitter: true
392
+ retry_on_rate_limit: true
393
+
394
+ # Circuit breaker configuration
395
+ circuit_breaker:
396
+ enabled: true
397
+ failure_threshold: 5
398
+ timeout: 300
399
+ half_open_max_calls: 3
400
+
401
+ # Cost tracking
402
+ cost:
403
+ input_cost_per_token: 0.00000125
404
+ output_cost_per_token: 0.000005
405
+ fixed_cost_per_request: 0.0
406
+ currency: "USD"
407
+
408
+ # Health check configuration
409
+ health_check:
410
+ enabled: true
411
+ interval: 60
412
+ timeout: 15
413
+ failure_threshold: 3
414
+ success_threshold: 2
415
+ check_url: "https://generativelanguage.googleapis.com/v1beta/models"
416
+
417
+ # Logging configuration
418
+ log:
419
+ enabled: true
420
+ level: "info"
421
+ file: "logs/gemini.log"
422
+ max_size: 52428800 # 50MB
423
+ max_files: 10
424
+ format: "json"
425
+ log_requests: true
426
+ log_responses: false
427
+
428
+ # Cache configuration
429
+ cache:
430
+ enabled: true
431
+ ttl: 1800
432
+ max_size: 500
433
+ strategy: "lru"
434
+
435
+ # Security configuration
436
+ security:
437
+ ssl_verify: true
438
+ allowed_hosts: ["generativelanguage.googleapis.com"]
439
+ blocked_hosts: []
440
+ timeout: 30
441
+ max_redirects: 5
442
+
443
+ # Environment-specific configurations
444
+ environments:
445
+ production:
446
+ harness:
447
+ max_retries: 3
448
+ request_timeout: 300
449
+ providers:
450
+ claude:
451
+ rate_limit:
452
+ requests_per_minute: 50
453
+ log:
454
+ level: "info"
455
+ cursor:
456
+ log:
457
+ level: "warn"
458
+ gemini:
459
+ rate_limit:
460
+ requests_per_minute: 60
461
+ log:
462
+ level: "info"
463
+
464
+ # Configuration tips for production:
465
+ # - Set up proper API keys in environment variables
466
+ # - Configure monitoring and alerting
467
+ # - Set up log rotation and retention
468
+ # - Configure rate limits based on your API plans
469
+ # - Enable circuit breakers for fault tolerance
470
+ # - Use load balancing for high availability
471
+ # - Configure health checks for all providers
472
+ # - Set up cost tracking and budgeting
473
+ # - Enable audit logging for compliance
474
+ # - Configure security settings appropriately
475
+ # - Test failover scenarios regularly