aidp 0.7.0 ā 0.8.1
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 +4 -4
- data/README.md +60 -214
- data/bin/aidp +1 -1
- data/lib/aidp/analysis/kb_inspector.rb +38 -23
- data/lib/aidp/analysis/seams.rb +2 -31
- data/lib/aidp/analysis/tree_sitter_grammar_loader.rb +1 -13
- data/lib/aidp/analysis/tree_sitter_scan.rb +3 -20
- data/lib/aidp/analyze/error_handler.rb +2 -75
- data/lib/aidp/analyze/json_file_storage.rb +292 -0
- data/lib/aidp/analyze/progress.rb +12 -0
- data/lib/aidp/analyze/progress_visualizer.rb +12 -17
- data/lib/aidp/analyze/ruby_maat_integration.rb +13 -31
- data/lib/aidp/analyze/runner.rb +256 -87
- data/lib/aidp/cli/jobs_command.rb +100 -432
- data/lib/aidp/cli.rb +309 -239
- data/lib/aidp/config.rb +298 -10
- data/lib/aidp/debug_logger.rb +195 -0
- data/lib/aidp/debug_mixin.rb +187 -0
- data/lib/aidp/execute/progress.rb +9 -0
- data/lib/aidp/execute/runner.rb +221 -40
- data/lib/aidp/execute/steps.rb +17 -7
- data/lib/aidp/execute/workflow_selector.rb +211 -0
- data/lib/aidp/harness/completion_checker.rb +268 -0
- data/lib/aidp/harness/condition_detector.rb +1526 -0
- data/lib/aidp/harness/config_loader.rb +373 -0
- data/lib/aidp/harness/config_manager.rb +382 -0
- data/lib/aidp/harness/config_schema.rb +1006 -0
- data/lib/aidp/harness/config_validator.rb +355 -0
- data/lib/aidp/harness/configuration.rb +477 -0
- data/lib/aidp/harness/enhanced_runner.rb +494 -0
- data/lib/aidp/harness/error_handler.rb +616 -0
- data/lib/aidp/harness/provider_config.rb +423 -0
- data/lib/aidp/harness/provider_factory.rb +306 -0
- data/lib/aidp/harness/provider_manager.rb +1269 -0
- data/lib/aidp/harness/provider_type_checker.rb +88 -0
- data/lib/aidp/harness/runner.rb +411 -0
- data/lib/aidp/harness/state/errors.rb +28 -0
- data/lib/aidp/harness/state/metrics.rb +219 -0
- data/lib/aidp/harness/state/persistence.rb +128 -0
- data/lib/aidp/harness/state/provider_state.rb +132 -0
- data/lib/aidp/harness/state/ui_state.rb +68 -0
- data/lib/aidp/harness/state/workflow_state.rb +123 -0
- data/lib/aidp/harness/state_manager.rb +586 -0
- data/lib/aidp/harness/status_display.rb +888 -0
- data/lib/aidp/harness/ui/base.rb +16 -0
- data/lib/aidp/harness/ui/enhanced_tui.rb +545 -0
- data/lib/aidp/harness/ui/enhanced_workflow_selector.rb +252 -0
- data/lib/aidp/harness/ui/error_handler.rb +132 -0
- data/lib/aidp/harness/ui/frame_manager.rb +361 -0
- data/lib/aidp/harness/ui/job_monitor.rb +500 -0
- data/lib/aidp/harness/ui/navigation/main_menu.rb +311 -0
- data/lib/aidp/harness/ui/navigation/menu_formatter.rb +120 -0
- data/lib/aidp/harness/ui/navigation/menu_item.rb +142 -0
- data/lib/aidp/harness/ui/navigation/menu_state.rb +139 -0
- data/lib/aidp/harness/ui/navigation/submenu.rb +202 -0
- data/lib/aidp/harness/ui/navigation/workflow_selector.rb +176 -0
- data/lib/aidp/harness/ui/progress_display.rb +280 -0
- data/lib/aidp/harness/ui/question_collector.rb +141 -0
- data/lib/aidp/harness/ui/spinner_group.rb +184 -0
- data/lib/aidp/harness/ui/spinner_helper.rb +152 -0
- data/lib/aidp/harness/ui/status_manager.rb +312 -0
- data/lib/aidp/harness/ui/status_widget.rb +280 -0
- data/lib/aidp/harness/ui/workflow_controller.rb +312 -0
- data/lib/aidp/harness/user_interface.rb +2381 -0
- data/lib/aidp/provider_manager.rb +131 -7
- data/lib/aidp/providers/anthropic.rb +28 -103
- data/lib/aidp/providers/base.rb +170 -0
- data/lib/aidp/providers/cursor.rb +52 -181
- data/lib/aidp/providers/gemini.rb +24 -107
- data/lib/aidp/providers/macos_ui.rb +99 -5
- data/lib/aidp/providers/opencode.rb +194 -0
- data/lib/aidp/storage/csv_storage.rb +172 -0
- data/lib/aidp/storage/file_manager.rb +214 -0
- data/lib/aidp/storage/json_storage.rb +140 -0
- data/lib/aidp/version.rb +1 -1
- data/lib/aidp.rb +54 -39
- data/templates/COMMON/AGENT_BASE.md +11 -0
- data/templates/EXECUTE/00_PRD.md +4 -4
- data/templates/EXECUTE/02_ARCHITECTURE.md +5 -4
- data/templates/EXECUTE/07_TEST_PLAN.md +4 -1
- data/templates/EXECUTE/08_TASKS.md +4 -4
- data/templates/EXECUTE/10_IMPLEMENTATION_AGENT.md +4 -4
- data/templates/README.md +279 -0
- data/templates/aidp-development.yml.example +373 -0
- data/templates/aidp-minimal.yml.example +48 -0
- data/templates/aidp-production.yml.example +475 -0
- data/templates/aidp.yml.example +598 -0
- metadata +93 -69
- data/lib/aidp/analyze/agent_personas.rb +0 -71
- data/lib/aidp/analyze/agent_tool_executor.rb +0 -439
- data/lib/aidp/analyze/data_retention_manager.rb +0 -421
- data/lib/aidp/analyze/database.rb +0 -260
- data/lib/aidp/analyze/dependencies.rb +0 -335
- data/lib/aidp/analyze/export_manager.rb +0 -418
- data/lib/aidp/analyze/focus_guidance.rb +0 -517
- data/lib/aidp/analyze/incremental_analyzer.rb +0 -533
- data/lib/aidp/analyze/language_analysis_strategies.rb +0 -897
- data/lib/aidp/analyze/large_analysis_progress.rb +0 -499
- data/lib/aidp/analyze/memory_manager.rb +0 -339
- data/lib/aidp/analyze/metrics_storage.rb +0 -336
- data/lib/aidp/analyze/parallel_processor.rb +0 -454
- data/lib/aidp/analyze/performance_optimizer.rb +0 -691
- data/lib/aidp/analyze/repository_chunker.rb +0 -697
- data/lib/aidp/analyze/static_analysis_detector.rb +0 -577
- data/lib/aidp/analyze/storage.rb +0 -655
- data/lib/aidp/analyze/tool_configuration.rb +0 -441
- data/lib/aidp/analyze/tool_modernization.rb +0 -750
- data/lib/aidp/database/pg_adapter.rb +0 -148
- data/lib/aidp/database_config.rb +0 -69
- data/lib/aidp/database_connection.rb +0 -72
- data/lib/aidp/job_manager.rb +0 -41
- data/lib/aidp/jobs/base_job.rb +0 -45
- data/lib/aidp/jobs/provider_execution_job.rb +0 -83
- data/lib/aidp/project_detector.rb +0 -117
- data/lib/aidp/providers/agent_supervisor.rb +0 -348
- data/lib/aidp/providers/supervised_base.rb +0 -317
- data/lib/aidp/providers/supervised_cursor.rb +0 -22
- data/lib/aidp/sync.rb +0 -13
- data/lib/aidp/workspace.rb +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a295d267b134bc6f1c28aef126969254203d4f07f98d39e686c85c4479954eca
|
4
|
+
data.tar.gz: 23b7bef369a2d423d3e141492f857da0d66640c337d4cd530befa52d6f3c9392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2544ee1a9ba91033d2b8b9eee057df06c2a15aa3d90725028f72a839c09d3d3f1b95545b937cc9206e360bb8f137174cb495b591ae9890fc26ef5e58e235c0d2
|
7
|
+
data.tar.gz: 4e634535c9cfdcae56400ac073b79334e5a0311342f53e26d6a9b1ace929c5bae5210ae92467e0c47cca3afa902935857d315886bdbc1a6dd07880b55878dd07
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# AI Dev Pipeline (aidp) - Ruby Gem
|
2
2
|
|
3
|
-
A portable CLI that automates a complete AI development workflow from idea to implementation using your existing IDE assistants.
|
3
|
+
A portable CLI that automates a complete AI development workflow from idea to implementation using your existing IDE assistants. Now with **Enhanced TUI** - a rich terminal interface that runs complete workflows with intelligent provider management and error recovery.
|
4
4
|
|
5
5
|
## Quick Start
|
6
6
|
|
@@ -11,91 +11,74 @@ gem install aidp
|
|
11
11
|
# Navigate to your project
|
12
12
|
cd /your/project
|
13
13
|
|
14
|
-
# Start the
|
15
|
-
aidp
|
14
|
+
# Start the interactive TUI (default)
|
15
|
+
aidp
|
16
16
|
```
|
17
17
|
|
18
|
-
##
|
18
|
+
## Enhanced TUI
|
19
19
|
|
20
|
-
|
20
|
+
AIDP features a rich terminal interface that transforms it from a step-by-step tool into an intelligent development assistant. The enhanced TUI provides beautiful, interactive terminal components while running complete workflows automatically.
|
21
21
|
|
22
|
-
###
|
22
|
+
### Features
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
### 2. Handle Gate Steps
|
31
|
-
|
32
|
-
When you reach a **gate step** (PRD, Architecture, Tasks, Implementation), the AI will:
|
33
|
-
|
34
|
-
1. **Generate questions** in a file (e.g., `PRD_QUESTIONS.md`) if it needs more information
|
35
|
-
2. **Create the main output** (e.g., `docs/PRD.md`)
|
36
|
-
3. **Wait for your approval** before proceeding
|
37
|
-
|
38
|
-
**Your actions at gates:**
|
39
|
-
|
40
|
-
```bash
|
41
|
-
# Review the generated files
|
42
|
-
cat PRD_QUESTIONS.md # Check if AI needs more information
|
43
|
-
cat docs/PRD.md # Review the output
|
44
|
-
|
45
|
-
# If PRD_QUESTIONS.md exists, answer the questions:
|
46
|
-
# Edit the questions file directly with your answers
|
47
|
-
nano PRD_QUESTIONS.md # Add your answers below each question
|
48
|
-
|
49
|
-
# Re-run the step to use your answers
|
50
|
-
aidp execute prd # AI will read your answers and complete the step
|
51
|
-
|
52
|
-
# Once satisfied with the output, approve and continue
|
53
|
-
aidp approve current # Mark the step complete
|
54
|
-
aidp execute next # Continue to next step
|
55
|
-
```
|
56
|
-
|
57
|
-
### 3. Continue the Pipeline
|
24
|
+
- **šØ Rich Terminal Interface**: Beautiful CLI UI components with progress bars, spinners, and frames
|
25
|
+
- **š Interactive Navigation**: Hierarchical menu system with breadcrumb navigation
|
26
|
+
- **āØļø Keyboard Shortcuts**: Full keyboard navigation and control
|
27
|
+
- **š Real-time Progress**: Live monitoring of progress and system status
|
28
|
+
- **š Workflow Control**: Pause, resume, cancel, and stop workflows with visual feedback
|
29
|
+
- **š¬ Smart Question Collection**: Interactive prompts with validation and error handling
|
58
30
|
|
59
|
-
|
31
|
+
### Usage
|
60
32
|
|
61
33
|
```bash
|
62
|
-
|
63
|
-
aidp
|
64
|
-
```
|
65
|
-
|
66
|
-
### 4. Complete the Workflow
|
34
|
+
# Start the interactive TUI (default)
|
35
|
+
aidp
|
67
36
|
|
68
|
-
|
37
|
+
# Show version information
|
38
|
+
aidp --version
|
69
39
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
## Key Commands
|
74
|
-
|
75
|
-
```bash
|
76
|
-
aidp status # Show progress of all steps
|
77
|
-
aidp execute next # Run next pending step
|
78
|
-
aidp approve current # Approve current gate step
|
79
|
-
aidp jobs # Monitor background jobs (real-time)
|
80
|
-
aidp detect # See which AI provider will be used
|
81
|
-
aidp execute <step> # Run specific step (e.g., prd, arch, tasks)
|
82
|
-
aidp approve <step> # Approve specific step
|
83
|
-
aidp reset # Reset all progress (start over)
|
40
|
+
# Show help information
|
41
|
+
aidp --help
|
84
42
|
```
|
85
43
|
|
86
44
|
## AI Providers
|
87
45
|
|
88
|
-
|
89
|
-
|
90
|
-
- **
|
91
|
-
- **
|
92
|
-
- **
|
46
|
+
AIDP intelligently manages multiple providers with automatic switching:
|
47
|
+
|
48
|
+
- **Claude API** - Primary provider for complex analysis and code generation
|
49
|
+
- **Gemini API** - Cost-effective fallback for general tasks
|
50
|
+
- **Cursor CLI** - IDE-integrated provider for code-specific tasks
|
51
|
+
|
52
|
+
The TUI automatically switches providers when:
|
53
|
+
|
54
|
+
- Rate limits are hit
|
55
|
+
- Providers fail or timeout
|
56
|
+
- Cost limits are reached
|
57
|
+
- Performance optimization is needed
|
58
|
+
|
59
|
+
### Provider Configuration
|
60
|
+
|
61
|
+
```yaml
|
62
|
+
# aidp.yml
|
63
|
+
providers:
|
64
|
+
claude:
|
65
|
+
type: "api"
|
66
|
+
api_key: "${AIDP_CLAUDE_API_KEY}"
|
67
|
+
max_tokens: 100000
|
68
|
+
gemini:
|
69
|
+
type: "api"
|
70
|
+
api_key: "${AIDP_GEMINI_API_KEY}"
|
71
|
+
max_tokens: 50000
|
72
|
+
cursor:
|
73
|
+
type: "package"
|
74
|
+
```
|
93
75
|
|
94
|
-
###
|
76
|
+
### Environment Variables
|
95
77
|
|
96
78
|
```bash
|
97
|
-
|
98
|
-
|
79
|
+
# Set API keys
|
80
|
+
export AIDP_CLAUDE_API_KEY="your-claude-api-key"
|
81
|
+
export AIDP_GEMINI_API_KEY="your-gemini-api-key"
|
99
82
|
```
|
100
83
|
|
101
84
|
## Tree-sitter Static Analysis
|
@@ -152,37 +135,6 @@ echo 'export TREE_SITTER_PARSERS="$(pwd)/.aidp/parsers"' >> ~/.zshrc
|
|
152
135
|
source ~/.zshrc
|
153
136
|
```
|
154
137
|
|
155
|
-
### Tree-sitter Analysis Commands
|
156
|
-
|
157
|
-
```bash
|
158
|
-
# Run Tree-sitter static analysis
|
159
|
-
aidp analyze code
|
160
|
-
|
161
|
-
# Analyze specific languages
|
162
|
-
aidp analyze code --langs ruby,javascript,typescript
|
163
|
-
|
164
|
-
# Use multiple threads for faster analysis
|
165
|
-
aidp analyze code --threads 8
|
166
|
-
|
167
|
-
# Rebuild knowledge base from scratch
|
168
|
-
aidp analyze code --rebuild
|
169
|
-
|
170
|
-
# Specify custom KB directory
|
171
|
-
aidp analyze code --kb-dir .aidp/custom-kb
|
172
|
-
|
173
|
-
# Inspect generated knowledge base
|
174
|
-
aidp kb show
|
175
|
-
|
176
|
-
# Show specific KB data
|
177
|
-
aidp kb show symbols
|
178
|
-
aidp kb show imports
|
179
|
-
aidp kb show seams
|
180
|
-
|
181
|
-
# Generate dependency graphs
|
182
|
-
aidp kb graph imports
|
183
|
-
aidp kb graph calls
|
184
|
-
```
|
185
|
-
|
186
138
|
### Knowledge Base Structure
|
187
139
|
|
188
140
|
The Tree-sitter analysis generates structured JSON files in `.aidp/kb/`:
|
@@ -206,56 +158,6 @@ The Tree-sitter analysis specifically supports:
|
|
206
158
|
- **Test Coverage**: Identifies untested public APIs
|
207
159
|
- **Refactoring Opportunities**: Suggests dependency injection points and seam locations
|
208
160
|
|
209
|
-
## Background Jobs
|
210
|
-
|
211
|
-
AIDP uses background jobs to handle all AI provider executions, providing better reliability and real-time monitoring capabilities.
|
212
|
-
|
213
|
-
### Job Monitoring
|
214
|
-
|
215
|
-
Monitor running and completed jobs in real-time:
|
216
|
-
|
217
|
-
```bash
|
218
|
-
aidp jobs # Show job status with real-time updates
|
219
|
-
```
|
220
|
-
|
221
|
-
The jobs view displays:
|
222
|
-
|
223
|
-
- **Running jobs** with live progress updates
|
224
|
-
- **Queued jobs** waiting to be processed
|
225
|
-
- **Completed jobs** with execution results
|
226
|
-
- **Failed jobs** with error details
|
227
|
-
|
228
|
-
### Job Controls
|
229
|
-
|
230
|
-
From the jobs view, you can:
|
231
|
-
|
232
|
-
- **Retry failed jobs** by pressing `r` on a failed job
|
233
|
-
- **View job details** by pressing `d` on any job
|
234
|
-
- **Exit monitoring** by pressing `q`
|
235
|
-
|
236
|
-
### Job Persistence
|
237
|
-
|
238
|
-
- Jobs persist across CLI restarts
|
239
|
-
- Job history is preserved for analysis
|
240
|
-
- Failed jobs can be retried at any time
|
241
|
-
- All job metadata and logs are stored
|
242
|
-
|
243
|
-
### Database Setup
|
244
|
-
|
245
|
-
AIDP uses PostgreSQL for job management. Ensure PostgreSQL is installed and running:
|
246
|
-
|
247
|
-
```bash
|
248
|
-
# macOS (using Homebrew)
|
249
|
-
brew install postgresql
|
250
|
-
brew services start postgresql
|
251
|
-
|
252
|
-
# Ubuntu/Debian
|
253
|
-
sudo apt-get install postgresql postgresql-contrib
|
254
|
-
sudo systemctl start postgresql
|
255
|
-
|
256
|
-
# The database will be created automatically on first use
|
257
|
-
```
|
258
|
-
|
259
161
|
## File-Based Interaction
|
260
162
|
|
261
163
|
At gate steps, the AI creates files for interaction instead of requiring real-time chat:
|
@@ -278,45 +180,13 @@ The questions file is only created when the AI needs additional information beyo
|
|
278
180
|
|
279
181
|
```bash
|
280
182
|
# Enable debug output to see AI provider communication
|
281
|
-
AIDP_DEBUG=1 aidp
|
183
|
+
AIDP_DEBUG=1 aidp
|
282
184
|
|
283
185
|
# Log to a file for debugging
|
284
|
-
AIDP_LOG_FILE=aidp.log aidp
|
186
|
+
AIDP_LOG_FILE=aidp.log aidp
|
285
187
|
|
286
188
|
# Combine both for full debugging
|
287
|
-
AIDP_DEBUG=1 AIDP_LOG_FILE=aidp.log aidp
|
288
|
-
```
|
289
|
-
|
290
|
-
## Workflow Example
|
291
|
-
|
292
|
-
Here's a typical session:
|
293
|
-
|
294
|
-
```bash
|
295
|
-
# 1. Start the workflow
|
296
|
-
aidp execute next
|
297
|
-
# ā Creates docs/PRD.md and PRD_QUESTIONS.md
|
298
|
-
|
299
|
-
# 2. Monitor job progress (optional)
|
300
|
-
aidp jobs
|
301
|
-
# ā Shows real-time job status and progress
|
302
|
-
|
303
|
-
# 3. Review the questions (if any)
|
304
|
-
cat PRD_QUESTIONS.md
|
305
|
-
# ā If questions exist, edit the file with your answers, then re-run
|
306
|
-
|
307
|
-
# 4. Review the PRD
|
308
|
-
cat docs/PRD.md
|
309
|
-
# ā Edit if needed
|
310
|
-
|
311
|
-
# 5. Approve and continue
|
312
|
-
aidp approve current
|
313
|
-
aidp execute next
|
314
|
-
# ā Creates docs/NFRs.md automatically
|
315
|
-
|
316
|
-
# 6. Continue through gates
|
317
|
-
aidp execute next
|
318
|
-
# ā Creates docs/Architecture.md and ARCH_QUESTIONS.md
|
319
|
-
# ā Repeat review/approve cycle
|
189
|
+
AIDP_DEBUG=1 AIDP_LOG_FILE=aidp.log aidp
|
320
190
|
```
|
321
191
|
|
322
192
|
## Development
|
@@ -353,43 +223,19 @@ bundle exec rake build
|
|
353
223
|
The following system dependencies are required for development:
|
354
224
|
|
355
225
|
- **Tree-sitter** - System library for parsing (install via `brew install tree-sitter` or package manager)
|
356
|
-
- **PostgreSQL** - Database for job management
|
357
226
|
- **Ruby gems** - All required gems are specified in `aidp.gemspec` and installed via `bundle install`
|
358
227
|
|
359
|
-
Optional gems with fallbacks:
|
360
|
-
|
361
|
-
- **`concurrent-ruby`** - Parallel processing (fallback to basic threading if not available)
|
362
|
-
- **`tty-table`** - Table rendering (fallback to basic ASCII tables if not available)
|
363
|
-
|
364
228
|
## Contributing
|
365
229
|
|
366
230
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and conventional commit guidelines.
|
367
231
|
|
368
|
-
##
|
369
|
-
|
370
|
-
The gem automates a complete 15-step development pipeline:
|
371
|
-
|
372
|
-
### Gate Steps (Require Approval)
|
373
|
-
|
374
|
-
- **PRD** ā Product Requirements Document (`docs/PRD.md`)
|
375
|
-
- **Architecture** ā System architecture and ADRs (`docs/Architecture.md`)
|
376
|
-
- **Tasks** ā Implementation tasks and backlog (`tasks/backlog.yaml`)
|
377
|
-
- **Implementation** ā Implementation strategy and guidance (`docs/ImplementationGuide.md`)
|
232
|
+
## Documentation
|
378
233
|
|
379
|
-
|
234
|
+
For detailed information:
|
380
235
|
|
381
|
-
- **
|
382
|
-
- **
|
383
|
-
- **
|
384
|
-
- **Contracts** ā API/Event contracts (`contracts/`)
|
385
|
-
- **Threat Model** ā Security analysis (`docs/ThreatModel.md`)
|
386
|
-
- **Test Plan** ā Testing strategy (`docs/TestPlan.md`)
|
387
|
-
- **Scaffolding** ā Project structure guidance (`docs/ScaffoldingGuide.md`)
|
388
|
-
- **Static Analysis** ā Code quality tools and Tree-sitter analysis (`docs/StaticAnalysis.md`, `.aidp/kb/`)
|
389
|
-
- **Observability** ā Monitoring and SLOs (`docs/Observability.md`)
|
390
|
-
- **Delivery** ā Deployment strategy (`docs/DeliveryPlan.md`)
|
391
|
-
- **Docs Portal** ā Documentation portal (`docs/DocsPortalPlan.md`)
|
392
|
-
- **Post-Release** ā Post-release analysis (`docs/PostReleaseReport.md`)
|
236
|
+
- **[TUI User Guide](docs/TUI_USER_GUIDE.md)** - Complete guide to using the enhanced TUI
|
237
|
+
- **[Configuration Guide](docs/harness-configuration.md)** - Detailed configuration options and examples
|
238
|
+
- **[Troubleshooting Guide](docs/harness-troubleshooting.md)** - Common issues and solutions
|
393
239
|
|
394
240
|
## Manual Workflow (Alternative)
|
395
241
|
|
data/bin/aidp
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "json"
|
4
|
-
require "tty-
|
4
|
+
require "tty-box"
|
5
5
|
|
6
6
|
module Aidp
|
7
7
|
module Analysis
|
@@ -57,7 +57,23 @@ module Aidp
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def create_table(header, rows)
|
60
|
-
TTY::
|
60
|
+
# Use TTY::Box for table display
|
61
|
+
content = []
|
62
|
+
rows.each_with_index do |row, index|
|
63
|
+
row_content = []
|
64
|
+
header.each_with_index do |col_header, col_index|
|
65
|
+
row_content << "#{col_header}: #{row[col_index]}"
|
66
|
+
end
|
67
|
+
content << "Row #{index + 1}:\n#{row_content.join("\n")}"
|
68
|
+
end
|
69
|
+
|
70
|
+
box = TTY::Box.frame(
|
71
|
+
content.join("\n\n"),
|
72
|
+
title: {top_left: "Knowledge Base Data"},
|
73
|
+
border: :thick,
|
74
|
+
padding: [1, 2]
|
75
|
+
)
|
76
|
+
puts box
|
61
77
|
end
|
62
78
|
|
63
79
|
def load_kb_data
|
@@ -69,7 +85,10 @@ module Aidp
|
|
69
85
|
begin
|
70
86
|
data[type.to_sym] = JSON.parse(File.read(file_path), symbolize_names: true)
|
71
87
|
rescue JSON::ParserError => e
|
72
|
-
|
88
|
+
# Suppress warnings in test mode to avoid CI failures
|
89
|
+
unless ENV["RACK_ENV"] == "test" || defined?(RSpec)
|
90
|
+
puts "Warning: Could not parse #{file_path}: #{e.message}"
|
91
|
+
end
|
73
92
|
data[type.to_sym] = []
|
74
93
|
end
|
75
94
|
else
|
@@ -125,7 +144,10 @@ module Aidp
|
|
125
144
|
end
|
126
145
|
|
127
146
|
def show_seams_table
|
128
|
-
|
147
|
+
puts "\nš§ Seams Analysis"
|
148
|
+
puts "=" * 80
|
149
|
+
|
150
|
+
create_table(
|
129
151
|
["Type", "File", "Line", "Symbol", "Suggestion"],
|
130
152
|
@data[:seams].map do |seam|
|
131
153
|
[
|
@@ -137,10 +159,6 @@ module Aidp
|
|
137
159
|
]
|
138
160
|
end
|
139
161
|
)
|
140
|
-
|
141
|
-
puts "\nš§ Seams Analysis"
|
142
|
-
puts "=" * 80
|
143
|
-
puts table.render
|
144
162
|
end
|
145
163
|
|
146
164
|
def show_seams_summary
|
@@ -180,7 +198,10 @@ module Aidp
|
|
180
198
|
end
|
181
199
|
|
182
200
|
def show_hotspots_table
|
183
|
-
|
201
|
+
puts "\nš„ Code Hotspots"
|
202
|
+
puts "=" * 80
|
203
|
+
|
204
|
+
create_table(
|
184
205
|
["Rank", "File", "Method", "Score", "Complexity", "Touches"],
|
185
206
|
@data[:hotspots].map.with_index do |hotspot, i|
|
186
207
|
[
|
@@ -193,10 +214,6 @@ module Aidp
|
|
193
214
|
]
|
194
215
|
end
|
195
216
|
)
|
196
|
-
|
197
|
-
puts "\nš„ Code Hotspots"
|
198
|
-
puts "=" * 80
|
199
|
-
puts table.render
|
200
217
|
end
|
201
218
|
|
202
219
|
def show_hotspots_summary
|
@@ -283,7 +300,10 @@ module Aidp
|
|
283
300
|
end
|
284
301
|
|
285
302
|
def show_symbols_table
|
286
|
-
|
303
|
+
puts "\nšļø Symbols"
|
304
|
+
puts "=" * 80
|
305
|
+
|
306
|
+
create_table(
|
287
307
|
["Type", "Name", "File", "Line", "Visibility"],
|
288
308
|
@data[:symbols].map do |symbol|
|
289
309
|
[
|
@@ -295,10 +315,6 @@ module Aidp
|
|
295
315
|
]
|
296
316
|
end
|
297
317
|
)
|
298
|
-
|
299
|
-
puts "\nšļø Symbols"
|
300
|
-
puts "=" * 80
|
301
|
-
puts table.render
|
302
318
|
end
|
303
319
|
|
304
320
|
def show_symbols_summary
|
@@ -326,7 +342,10 @@ module Aidp
|
|
326
342
|
end
|
327
343
|
|
328
344
|
def show_imports_table
|
329
|
-
|
345
|
+
puts "\nš¦ Imports"
|
346
|
+
puts "=" * 80
|
347
|
+
|
348
|
+
create_table(
|
330
349
|
["Type", "Target", "File", "Line"],
|
331
350
|
@data[:imports].map do |import|
|
332
351
|
[
|
@@ -337,10 +356,6 @@ module Aidp
|
|
337
356
|
]
|
338
357
|
end
|
339
358
|
)
|
340
|
-
|
341
|
-
puts "\nš¦ Imports"
|
342
|
-
puts "=" * 80
|
343
|
-
puts table.render
|
344
359
|
end
|
345
360
|
|
346
361
|
def show_imports_summary
|
data/lib/aidp/analysis/seams.rb
CHANGED
@@ -23,35 +23,6 @@ module Aidp
|
|
23
23
|
/include Singleton/, /extend Singleton/, /@singleton/
|
24
24
|
].freeze
|
25
25
|
|
26
|
-
# Constructor with work indicators
|
27
|
-
CONSTRUCTOR_WORK_INDICATORS = [
|
28
|
-
/File\./, /IO\./, /Net::/, /HTTP/, /Database/, /Redis/,
|
29
|
-
/system\(/, /exec\(/, /spawn\(/, /fork\(/
|
30
|
-
].freeze
|
31
|
-
|
32
|
-
def self.io_call?(receiver, method)
|
33
|
-
fq = [receiver, method].compact.join(".")
|
34
|
-
IO_PATTERNS.any? { |pattern| fq.match?(pattern) }
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.external_service_call?(receiver, method)
|
38
|
-
fq = [receiver, method].compact.join(".")
|
39
|
-
EXTERNAL_SERVICE_PATTERNS.any? { |pattern| fq.match?(pattern) }
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.global_or_singleton?(ast_node_texts)
|
43
|
-
ast_node_texts.any? { |text| GLOBAL_PATTERNS.any? { |pattern| text.match?(pattern) } }
|
44
|
-
end
|
45
|
-
|
46
|
-
def self.constructor_with_work?(node, metrics)
|
47
|
-
return false unless node[:type] == "method" && node[:name] == "initialize"
|
48
|
-
|
49
|
-
# Check if constructor has significant work based on metrics
|
50
|
-
metrics[:branch_count].to_i > 2 ||
|
51
|
-
metrics[:fan_out].to_i > 3 ||
|
52
|
-
metrics[:lines].to_i > 10
|
53
|
-
end
|
54
|
-
|
55
26
|
def self.detect_seams_in_ast(ast_nodes, file_path)
|
56
27
|
seams = []
|
57
28
|
|
@@ -164,8 +135,8 @@ module Aidp
|
|
164
135
|
end
|
165
136
|
|
166
137
|
private_class_method def self.extract_io_calls(_method_node)
|
167
|
-
#
|
168
|
-
#
|
138
|
+
# Extract I/O calls from the method's AST
|
139
|
+
# TODO: Implement actual AST analysis
|
169
140
|
[]
|
170
141
|
end
|
171
142
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "pathname"
|
3
4
|
require "tree_sitter"
|
4
5
|
require "fileutils"
|
5
6
|
|
@@ -77,11 +78,6 @@ module Aidp
|
|
77
78
|
@loaded_grammars[language] = create_parser(language, config)
|
78
79
|
end
|
79
80
|
|
80
|
-
# Get supported languages
|
81
|
-
def supported_languages
|
82
|
-
GRAMMAR_CONFIGS.keys
|
83
|
-
end
|
84
|
-
|
85
81
|
# Get file patterns for a language
|
86
82
|
def file_patterns_for_language(language)
|
87
83
|
config = GRAMMAR_CONFIGS[language]
|
@@ -90,14 +86,6 @@ module Aidp
|
|
90
86
|
config[:file_patterns]
|
91
87
|
end
|
92
88
|
|
93
|
-
# Get node types for a language
|
94
|
-
def node_types_for_language(language)
|
95
|
-
config = GRAMMAR_CONFIGS[language]
|
96
|
-
return {} unless config
|
97
|
-
|
98
|
-
config[:node_types]
|
99
|
-
end
|
100
|
-
|
101
89
|
private
|
102
90
|
|
103
91
|
def ensure_grammar_available(language, config)
|
@@ -3,7 +3,6 @@
|
|
3
3
|
require "json"
|
4
4
|
require "fileutils"
|
5
5
|
require "digest"
|
6
|
-
require "concurrent"
|
7
6
|
require "etc"
|
8
7
|
|
9
8
|
require_relative "tree_sitter_grammar_loader"
|
@@ -157,21 +156,10 @@ module Aidp
|
|
157
156
|
# Load grammar for this language
|
158
157
|
grammar = @grammar_loader.load_grammar(lang)
|
159
158
|
|
160
|
-
# Process files
|
161
|
-
pool = Concurrent::FixedThreadPool.new(@threads)
|
162
|
-
futures = []
|
163
|
-
|
159
|
+
# Process files synchronously (simplified)
|
164
160
|
lang_files.each do |file|
|
165
|
-
|
166
|
-
parse_file(file, grammar)
|
167
|
-
end
|
168
|
-
futures << future
|
161
|
+
parse_file(file, grammar)
|
169
162
|
end
|
170
|
-
|
171
|
-
# Wait for all futures to complete
|
172
|
-
futures.each(&:value!)
|
173
|
-
pool.shutdown
|
174
|
-
pool.wait_for_termination
|
175
163
|
end
|
176
164
|
|
177
165
|
save_cache
|
@@ -468,11 +456,6 @@ module Aidp
|
|
468
456
|
end
|
469
457
|
end
|
470
458
|
|
471
|
-
def extract_string_content(string_content_node, _line_number)
|
472
|
-
# Extract the actual string content from the source code using node position
|
473
|
-
extract_node_text_from_source(string_content_node)
|
474
|
-
end
|
475
|
-
|
476
459
|
def extract_identifier_name(identifier_node, file_path)
|
477
460
|
# Extract the actual identifier name from the source code using node position
|
478
461
|
extract_node_text_from_source(identifier_node, file_path)
|
@@ -659,7 +642,7 @@ module Aidp
|
|
659
642
|
|
660
643
|
def generate_hotspots
|
661
644
|
# Merge structural metrics with git churn data
|
662
|
-
#
|
645
|
+
# Generate hotspots based on complexity and change frequency
|
663
646
|
@hotspots = @metrics.select { |m| m[:symbol_id] }
|
664
647
|
.map do |metric|
|
665
648
|
{
|