Commit 9d9bee8
feat: audit fixes — graceful OTEL, async-safe plugins, URL validation, +100 tests (#36)
* feat: audit fixes — graceful OTEL, async-safe plugins, URL validation, +100 tests
- OTEL init no longer panics on misconfigured endpoints; falls back gracefully
- Semgrep/ESLint plugins use tokio::spawn_blocking to avoid blocking the runtime
- Added semgrep --timeout flag (30s) for process execution safety
- Git clone URL validation: only https://, git@, and http://*.git accepted
- Added PartialEq derive to ContextType for test assertions
- 100+ new tests across storage_json, interactive commands, plugins,
CLI commands (pr.rs, git.rs), and duplicate_filter
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: 4 TDD-discovered bugs — comment detection, function boundaries, dedup severity, empty LLM responses
Bug 1: `is_comment_line` missed bare `#` (shell/Makefile/Python comments)
- Changed `#!` → `#![` in non-comment prefixes (Rust inner attrs always have `[`)
- Any `#` line not matching a known code prefix is now treated as a comment
Bug 2: `find_function_end` ignored single-quoted strings
- `'{'` in JS/Python strings was counted as a real brace, breaking function
boundary detection. Now tracks both `"` and `'` string delimiters.
Bug 3: `deduplicate_comments` could drop higher-severity comments
- `dedup_by` keeps the first element; sort didn't include severity.
Now sorts by severity (highest first) within same file/line/content group.
Bug 4: OpenAI/Anthropic silently returned empty string for empty responses
- Empty `choices`/`content` arrays now return errors instead of succeeding
with empty content, preventing silent failures in the review pipeline.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: 5 TDD-discovered bugs — error rate, diff parsing, default model, file status
- Error rate now counts only explicit review.failed events, not all non-completed
- Empty lines in diffs treated as context instead of being silently skipped
- parse_text_diff sets is_new/is_deleted based on empty old/new content
- Default model changed from Sonnet to Opus per project conventions
- Added 5 new tests covering all discovered issues
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: address PR review feedback — Rust lifetimes and shebang detection
- Skip single-quote tracking for Rust in find_function_end (lifetimes
like 'a/'static are not string delimiters, were breaking brace count)
- Add #!/ to HASH_NON_COMMENT_PREFIXES so shebang lines are not
misclassified as comments (changing interpreter is a real code change)
- Added 2 regression tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style: cargo fmt
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: dedup severity bug in composable pipeline, accept ssh:// URLs, clean up comments
- Fix DeduplicateStage in composable_pipeline.rs to preserve highest
severity when deduplicating (same bug as comment.rs, different path)
- Accept ssh:// URLs in is_safe_git_url (was rejecting legitimate SSH)
- Consolidate is_git_source to delegate to is_safe_git_url
- Replace stale "BUG:" test comments with "Regression:" phrasing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: process timeouts, test quality, and review cleanup
- Wrap semgrep/eslint spawn_blocking in tokio::time::timeout to prevent
hanging subprocesses from permanently consuming blocking pool threads
- Replace false-positive semgrep test (tested struct construction, not
analyzer) with actual timeout behavior test
- Replace eslint extension test with direct JS_EXTENSIONS unit test
that verifies filter membership rather than relying on end-to-end run
- Fix DeduplicateStage in composable_pipeline to preserve highest
severity (same bug as comment.rs dedup, different code path)
- Accept ssh:// URLs in is_safe_git_url
- Clean up stale BUG: comments to Regression: phrasing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: align PG backend error_rate with JSON backend
Both backends now count only explicit review.failed events as failures,
not all non-completed events. Fixes inconsistency where PG counted
timeouts as failures but JSON did not.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent c8af0ed commit 9d9bee8
File tree
17 files changed
+1942
-102
lines changed- src
- adapters
- core
- plugins/builtin
- review
- server
17 files changed
+1942
-102
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | 124 | | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| |||
292 | 296 | | |
293 | 297 | | |
294 | 298 | | |
295 | | - | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| |||
311 | 315 | | |
312 | 316 | | |
313 | 317 | | |
314 | | - | |
315 | | - | |
316 | 318 | | |
317 | | - | |
318 | | - | |
319 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
320 | 327 | | |
321 | 328 | | |
322 | 329 | | |
323 | 330 | | |
324 | | - | |
| 331 | + | |
325 | 332 | | |
326 | 333 | | |
327 | 334 | | |
| |||
340 | 347 | | |
341 | 348 | | |
342 | 349 | | |
343 | | - | |
344 | | - | |
345 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
346 | 360 | | |
347 | 361 | | |
348 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
419 | | - | |
| 421 | + | |
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
| |||
435 | 437 | | |
436 | 438 | | |
437 | 439 | | |
438 | | - | |
439 | | - | |
440 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
441 | 450 | | |
442 | 451 | | |
443 | 452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1061 | 1061 | | |
1062 | 1062 | | |
1063 | 1063 | | |
1064 | | - | |
| 1064 | + | |
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
| |||
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
1767 | 1779 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
452 | 460 | | |
453 | 461 | | |
454 | 462 | | |
455 | 463 | | |
456 | 464 | | |
| 465 | + | |
457 | 466 | | |
| 467 | + | |
| 468 | + | |
458 | 469 | | |
459 | 470 | | |
460 | 471 | | |
| |||
548 | 559 | | |
549 | 560 | | |
550 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
551 | 605 | | |
552 | 606 | | |
553 | 607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
214 | 221 | | |
215 | 222 | | |
216 | 223 | | |
217 | 224 | | |
218 | 225 | | |
| 226 | + | |
219 | 227 | | |
| 228 | + | |
220 | 229 | | |
221 | 230 | | |
222 | 231 | | |
| |||
688 | 697 | | |
689 | 698 | | |
690 | 699 | | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
691 | 722 | | |
692 | 723 | | |
693 | 724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
185 | | - | |
| 184 | + | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| |||
540 | 541 | | |
541 | 542 | | |
542 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
543 | 602 | | |
0 commit comments