@voria/cli 0.0.2

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 (67) hide show
  1. package/README.md +439 -0
  2. package/bin/voria +730 -0
  3. package/docs/ARCHITECTURE.md +419 -0
  4. package/docs/CHANGELOG.md +189 -0
  5. package/docs/CONTRIBUTING.md +447 -0
  6. package/docs/DESIGN_DECISIONS.md +380 -0
  7. package/docs/DEVELOPMENT.md +535 -0
  8. package/docs/EXAMPLES.md +434 -0
  9. package/docs/INSTALL.md +335 -0
  10. package/docs/IPC_PROTOCOL.md +310 -0
  11. package/docs/LLM_INTEGRATION.md +416 -0
  12. package/docs/MODULES.md +470 -0
  13. package/docs/PERFORMANCE.md +346 -0
  14. package/docs/PLUGINS.md +432 -0
  15. package/docs/QUICKSTART.md +184 -0
  16. package/docs/README.md +133 -0
  17. package/docs/ROADMAP.md +346 -0
  18. package/docs/SECURITY.md +334 -0
  19. package/docs/TROUBLESHOOTING.md +565 -0
  20. package/docs/USER_GUIDE.md +700 -0
  21. package/package.json +63 -0
  22. package/python/voria/__init__.py +8 -0
  23. package/python/voria/__pycache__/__init__.cpython-312.pyc +0 -0
  24. package/python/voria/__pycache__/engine.cpython-312.pyc +0 -0
  25. package/python/voria/core/__init__.py +1 -0
  26. package/python/voria/core/__pycache__/__init__.cpython-312.pyc +0 -0
  27. package/python/voria/core/__pycache__/setup.cpython-312.pyc +0 -0
  28. package/python/voria/core/agent/__init__.py +9 -0
  29. package/python/voria/core/agent/__pycache__/__init__.cpython-312.pyc +0 -0
  30. package/python/voria/core/agent/__pycache__/loop.cpython-312.pyc +0 -0
  31. package/python/voria/core/agent/loop.py +343 -0
  32. package/python/voria/core/executor/__init__.py +19 -0
  33. package/python/voria/core/executor/__pycache__/__init__.cpython-312.pyc +0 -0
  34. package/python/voria/core/executor/__pycache__/executor.cpython-312.pyc +0 -0
  35. package/python/voria/core/executor/executor.py +431 -0
  36. package/python/voria/core/github/__init__.py +33 -0
  37. package/python/voria/core/github/__pycache__/__init__.cpython-312.pyc +0 -0
  38. package/python/voria/core/github/__pycache__/client.cpython-312.pyc +0 -0
  39. package/python/voria/core/github/client.py +438 -0
  40. package/python/voria/core/llm/__init__.py +55 -0
  41. package/python/voria/core/llm/__pycache__/__init__.cpython-312.pyc +0 -0
  42. package/python/voria/core/llm/__pycache__/base.cpython-312.pyc +0 -0
  43. package/python/voria/core/llm/__pycache__/claude_provider.cpython-312.pyc +0 -0
  44. package/python/voria/core/llm/__pycache__/gemini_provider.cpython-312.pyc +0 -0
  45. package/python/voria/core/llm/__pycache__/modal_provider.cpython-312.pyc +0 -0
  46. package/python/voria/core/llm/__pycache__/model_discovery.cpython-312.pyc +0 -0
  47. package/python/voria/core/llm/__pycache__/openai_provider.cpython-312.pyc +0 -0
  48. package/python/voria/core/llm/base.py +152 -0
  49. package/python/voria/core/llm/claude_provider.py +188 -0
  50. package/python/voria/core/llm/gemini_provider.py +148 -0
  51. package/python/voria/core/llm/modal_provider.py +228 -0
  52. package/python/voria/core/llm/model_discovery.py +289 -0
  53. package/python/voria/core/llm/openai_provider.py +146 -0
  54. package/python/voria/core/patcher/__init__.py +9 -0
  55. package/python/voria/core/patcher/__pycache__/__init__.cpython-312.pyc +0 -0
  56. package/python/voria/core/patcher/__pycache__/patcher.cpython-312.pyc +0 -0
  57. package/python/voria/core/patcher/patcher.py +375 -0
  58. package/python/voria/core/planner/__init__.py +1 -0
  59. package/python/voria/core/setup.py +201 -0
  60. package/python/voria/core/token_manager/__init__.py +29 -0
  61. package/python/voria/core/token_manager/__pycache__/__init__.cpython-312.pyc +0 -0
  62. package/python/voria/core/token_manager/__pycache__/manager.cpython-312.pyc +0 -0
  63. package/python/voria/core/token_manager/manager.py +241 -0
  64. package/python/voria/engine.py +1185 -0
  65. package/python/voria/plugins/__init__.py +1 -0
  66. package/python/voria/plugins/python/__init__.py +1 -0
  67. package/python/voria/plugins/typescript/__init__.py +1 -0
@@ -0,0 +1,434 @@
1
+ # Examples
2
+
3
+ Real-world examples of using voria to fix open source issues.
4
+
5
+ ## Example 1: Simple Bug Fix
6
+
7
+ ### Scenario
8
+ A simple bug in a Python library where a function returns wrong type.
9
+
10
+ ### Command
11
+ ```bash
12
+ voria issue 42
13
+ ```
14
+
15
+ ### What Happens
16
+
17
+ 1. **Fetch Issue**
18
+ ```
19
+ Issue #42: TypeError in calculate_total()
20
+ Description: When given empty list, returns None instead of 0
21
+ ```
22
+
23
+ 2. **Plan**
24
+ ```
25
+ Detected: Simple return value bug
26
+ Plan: Add condition to return 0 for empty input
27
+ Estimated effort: 5 minutes
28
+ ```
29
+
30
+ 3. **Generate Patch**
31
+ ```diff
32
+ -def calculate_total(items):
33
+ +def calculate_total(items):
34
+ + if not items:
35
+ + return 0
36
+ return sum(items)
37
+ ```
38
+
39
+ 4. **Test**
40
+ ```
41
+ Running pytest...
42
+ ✓ All 12 tests pass
43
+ ✓ New test cases pass
44
+ ```
45
+
46
+ 5. **Result**
47
+ ```
48
+ ✅ Issue fixed!
49
+ Pull Request created: #1234
50
+ ```
51
+
52
+ ## Example 2: Feature Implementation with Iteration
53
+
54
+ ### Scenario
55
+ Adding a new feature that requires multiple iterations to get tests passing.
56
+
57
+ ### Command
58
+ ```bash
59
+ voria issue 100 --verbose --max-iterations 5
60
+ ```
61
+
62
+ ### Iteration Details
63
+
64
+ **Iteration 1:**
65
+ - Plan: Add new `filter()` method
66
+ - Patch: Adds basic filter implementation
67
+ - Test: FAILED - Missing parameter validation
68
+
69
+ **Iteration 2:**
70
+ - Analysis: Tests expect validation error
71
+ - Patch: Add parameter type checking
72
+ - Test: FAILED - Missing docstring
73
+
74
+ **Iteration 3:**
75
+ - Analysis: Linting checks require docs
76
+ - Patch: Add docstring and examples
77
+ - Test: PASSED ✓
78
+
79
+ Result: Feature ready after 3 iterations
80
+
81
+ ## Example 3: Complex Multi-File Change
82
+
83
+ ### Scenario
84
+ API migration requiring changes across 5+ files.
85
+
86
+ ### Command
87
+ ```bash
88
+ voria issue 200 --dry-run --verbose
89
+ ```
90
+
91
+ ### Dry Run Output
92
+ ```
93
+ Would modify:
94
+ ✓ src/api.py (3 changes)
95
+ ✓ src/models.py (2 changes)
96
+ ✓ tests/test_api.py (5 changes)
97
+ ✓ docs/api.md (1 change)
98
+ ✓ setup.py (1 change)
99
+
100
+ Would run tests:
101
+ ✓ pytest tests/ (estimated 2m)
102
+ ✓ Coverage report (estimated 30s)
103
+
104
+ Estimated impact:
105
+ - Lines added: 120
106
+ - Lines removed: 85
107
+ - Files modified: 5
108
+ ```
109
+
110
+ **After verification:**
111
+ ```bash
112
+ voria issue 200 --create-pr
113
+ ```
114
+
115
+ ## 🧪 Example 4: Using Different LLM Providers
116
+
117
+ ### Compare LLMs
118
+
119
+ **Modal (Fastest, Free)**
120
+ ```bash
121
+ voria issue 50 --llm modal --verbose
122
+ Time: 2 minutes
123
+ Cost: $0
124
+ Result: Works but basic
125
+ ```
126
+
127
+ **OpenAI GPT-5.4 (Best Quality)**
128
+ ```bash
129
+ voria issue 50 --llm openai --verbose
130
+ Time: 5 minutes
131
+ Cost: $0.15
132
+ Result: Excellent, well-documented
133
+ ```
134
+
135
+ **Google Gemini (Best Balance)**
136
+ ```bash
137
+ voria issue 50 --llm gemini --verbose
138
+ Time: 3 minutes
139
+ Cost: $0.05
140
+ Result: Good quality, fast
141
+ ```
142
+
143
+ ## Example 5: Custom Test Command
144
+
145
+ ### Scenario
146
+ Repository uses custom test framework (not auto-detected).
147
+
148
+ ### Setup
149
+ ```bash
150
+ voria issue 75 --test-cmd "npm run test:coverage" --test-pattern "*.test.js"
151
+ ```
152
+
153
+ ### What Happens
154
+ 1. Generates patch
155
+ 2. Applies patch
156
+ 3. Runs: `npm run test:coverage`
157
+ 4. Parses custom coverage output
158
+ 5. Determines success/failure
159
+ 6. Iterates if needed
160
+
161
+ ## Example 6: Code Quality Issues
162
+
163
+ ### Scenario
164
+ Issue about code formatting/linting violations.
165
+
166
+ ### Command
167
+ ```bash
168
+ voria issue 15 --hook "pre-test: black src/ && pylint src/"
169
+ ```
170
+
171
+ ### Workflow
172
+ 1. Plan: Identify formatting needed
173
+ 2. Patch: Generate fixes
174
+ 3. Apply patch
175
+ 4. Pre-test: Run black formatter + pylint
176
+ 5. Test: Run test suite
177
+ 6. Success: Clean code + passing tests
178
+
179
+ ## Example 7: Documentation Update
180
+
181
+ ### Scenario
182
+ GitHub issue requesting documentation improvements.
183
+
184
+ ### Command
185
+ ```bash
186
+ voria issue 88 --save-iterations --output markdown
187
+ ```
188
+
189
+ ### Result: Markdown Report
190
+ ```markdown
191
+ # Issue #88: Fix Documentation
192
+
193
+ ## Plan
194
+ Add examples and API reference for new module
195
+
196
+ ## Changes Made
197
+ - Added quickstart guide
198
+ - Added 5 practical examples
199
+ - Updated API documentation
200
+ - Added troubleshooting section
201
+
202
+ ## Test Results
203
+ - ✅ All documentation builds successfully
204
+ - ✅ Links are valid
205
+ - ✅ Code examples run without errors
206
+ ```
207
+
208
+ ## Example 8: Security-Related Fix
209
+
210
+ ### Scenario
211
+ Security vulnerability that needs careful handling.
212
+
213
+ ### Command
214
+ ```bash
215
+ voria issue 300 \
216
+ --require-approval \
217
+ --skip-auto-pr \
218
+ --save-analysis \
219
+ --verbose
220
+ ```
221
+
222
+ ### Output
223
+ ```
224
+ [SECURITY] Analyzing vulnerability...
225
+ Identified: SQL injection in user input handling
226
+ Severity: HIGH
227
+
228
+ Generated fix:
229
+ ✓ Adds parameterized queries
230
+ ✓ Adds input validation
231
+ ✓ Adds security tests
232
+
233
+ Awaiting approval before:
234
+ - Applying patch
235
+ - Running tests
236
+ - Creating PR
237
+
238
+ Review: ./analysis/issue-300-security-review.md
239
+ ```
240
+
241
+ ## Example 9: Performance Optimization
242
+
243
+ ### Scenario
244
+ Issue about slow function that needs optimization.
245
+
246
+ ### Command
247
+ ```bash
248
+ voria issue 42 \
249
+ --test-cmd "pytest benchmarks/" \
250
+ --performance-baseline 2.5s \
251
+ --verbose
252
+ ```
253
+
254
+ ### Workflow
255
+ 1. Plan: Identify optimization opportunity
256
+ 2. Generate: Optimize algorithm/caching
257
+ 3. Benchmark: `pytest benchmarks/` shows 0.8s (3x faster!)
258
+ 4. Test: All tests pass
259
+ 5. Success: "30% performance improvement"
260
+
261
+ ## Example 10: Batch Processing Multiple Issues
262
+
263
+ ### Scenario
264
+ Fix multiple related issues at once.
265
+
266
+ ### Script
267
+ ```bash
268
+ #!/bin/bash
269
+ ISSUES=(42 43 44 45 46)
270
+ for issue in "${ISSUES[@]}"; do
271
+ echo "Processing issue #$issue..."
272
+ voria issue $issue --create-pr --llm gemini
273
+ sleep 2 # Rate limiting
274
+ done
275
+ ```
276
+
277
+ ### Output
278
+ ```
279
+ Processing issue #42...
280
+ ✅ Created PR #1234
281
+
282
+ Processing issue #43...
283
+ ✅ Created PR #1235
284
+
285
+ Processing issue #44...
286
+ ✅ Created PR #1236
287
+
288
+ ...
289
+
290
+ All issues processed! 5 PRs created.
291
+ ```
292
+
293
+ ## Example 11: Investigating Before Fixing
294
+
295
+ ### Scenario
296
+ Complex issue - want to analyze before fixing.
297
+
298
+ ### Commands
299
+ ```bash
300
+ # Step 1: Just plan
301
+ voria plan 999 --verbose
302
+
303
+ # Step 2: Dry run
304
+ voria issue 999 --dry-run
305
+
306
+ # Step 3: Dry run with specific LLM
307
+ voria issue 999 --dry-run --llm claude
308
+
309
+ # Step 4: Dry run with custom tests
310
+ voria issue 999 --dry-run --test-cmd "npm run test:all"
311
+
312
+ # Step 5: Actually run it
313
+ voria issue 999 --create-pr
314
+ ```
315
+
316
+ ## Example 12: Handling Failures
317
+
318
+ ### Scenario
319
+ Fix attempt fails - how to debug and retry.
320
+
321
+ ### Commands
322
+ ```bash
323
+ # First attempt
324
+ voria issue 50 --verbose
325
+
326
+ # If it fails, review logs
327
+ voria logs issue 50 --level DEBUG
328
+
329
+ # Try with different LLM
330
+ voria issue 50 --llm claude
331
+
332
+ # Or with higher iterations
333
+ voria issue 50 --max-iterations 8
334
+
335
+ # Or manually fix and apply
336
+ voria apply manual-plan
337
+ ```
338
+
339
+ ## Example 13: Progress Monitoring
340
+
341
+ ### Scenario
342
+ Monitor voria's progress on an issue.
343
+
344
+ ### Commands
345
+ ```bash
346
+ # Terminal 1: Start voria
347
+ voria issue 42 --verbose --follow-logs
348
+
349
+ # Terminal 2: Monitor status
350
+ while true; do
351
+ voria status issue 42
352
+ sleep 5
353
+ done
354
+
355
+ # Terminal 3: Check token usage
356
+ watch voria token info
357
+ ```
358
+
359
+ ## Example 14: GitHub Enterprise Integration
360
+
361
+ ### Scenario
362
+ Using voria with GitHub Enterprise (on-premise).
363
+
364
+ ### Setup
365
+ ```bash
366
+ # Configure GitHub Enterprise
367
+ python3 -m voria.core.setup
368
+
369
+ # Select: github-enterprise
370
+ # Enter: https://github.enterprise.com
371
+ # Token: ghp_...
372
+ ```
373
+
374
+ ### Usage
375
+ ```bash
376
+ voria issue 42 --github https://github.enterprise.com
377
+ ```
378
+
379
+ ## Best Practice: The Complete Workflow
380
+
381
+ ### Full Workflow Example
382
+ ```bash
383
+ # 1. Investigate
384
+ voria plan 42 --verbose
385
+
386
+ # 2. Dry run (no modifications)
387
+ voria issue 42 --dry-run --verbose
388
+
389
+ # 3. Check what changed (before applying)
390
+ voria logs issue 42 --dry-run
391
+
392
+ # 4. Run with minimal risk
393
+ voria issue 42 \
394
+ --max-iterations 3 \
395
+ --require-approval \
396
+ --save-analysis
397
+
398
+ # 5. If successful, create PR
399
+ voria issue 42 --create-pr
400
+
401
+ # 6. Monitor the PR
402
+ voria status pr-id
403
+
404
+ # 7. Review results
405
+ voria logs issue 42 --output markdown > review.md
406
+ ```
407
+
408
+ ## Learning from Examples
409
+
410
+ **Run the Examples:**
411
+ ```bash
412
+ # Try all examples in sequence
413
+ for ex in {1..5}; do
414
+ echo "Running example $ex..."
415
+ voria example $ex --verbose
416
+ done
417
+ ```
418
+
419
+ **Understand the Output:**
420
+ ```bash
421
+ # Generate detailed analysis
422
+ voria issue 42 --output json | jq . | less
423
+
424
+ # Export to markdown
425
+ voria issue 42 --output markdown > report.md
426
+
427
+ # Compare different approaches
428
+ diff <(voria issue 42 --llm openai --output json) \
429
+ <(voria issue 42 --llm modal --output json)
430
+ ```
431
+
432
+ ---
433
+
434
+ **Try these examples!** Start with simplest (Example 1) and work up to more complex ones.