feat(examples): add skills-based code review agent with sandbox and database#138
Open
coder-mtj wants to merge 2 commits into
Open
feat(examples): add skills-based code review agent with sandbox and database#138coder-mtj wants to merge 2 commits into
coder-mtj wants to merge 2 commits into
Conversation
…atabase Implements trpc-group#92 — automated code review agent with: - 6 rule scanners (security, async, resource leak, DB lifecycle, missing tests, secret info) - Filter chain for pre-execution safety interception - Local sandbox with timeout/output limits/env isolation - Deduplication and sensitive info redaction - JSON + Markdown report generation - SQLite persistence (4 tables: tasks, findings, sandbox_runs, filter_logs) - 8 test fixture diffs covering all acceptance criteria - 116 tests across 8 test modules (unit + integration + acceptance) Signed-off-by: coder-mtj <coder-mtj@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
==========================================
Coverage ? 87.51874%
==========================================
Files ? 467
Lines ? 44018
Branches ? 0
==========================================
Hits ? 38524
Misses ? 5494
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…, 3-tier confidence, AST analysis, SARIF output, schema versioning, and full documentation Bug fixes: - Fix report.py severity/category confusion (secret_info is a category, not severity) - Fix sandbox script path resolution to locate skills/ from repo root - Fix run_review.py emoji to ASCII-safe for Windows GBK compatibility - Fix agent.py hardcoded model → env-var-driven configuration - Fix SKILL.md missing references (create OUTPUT_SCHEMA.md, rules/rules.json) - Fix run_checks.py from stub to functional scanner execution Feature enhancements: - Three-tier confidence system (high >=0.8 / warning >=0.55 / needs_human_review) - Policy-as-code filter governance (filter_policy.json) - FakeSandboxRunner with trigger-based edge case simulation - AST taint analysis (Python AST + JS/TS regex) - 4 new scanners: bare_except, mutable_defaults, assert_control_flow, hardcoded_paths - Per-scanner confidence thresholds - Schema versioning with incremental column migrations (v1→v4) - SARIF v2.1.0 output for GitHub Code Scanning - Fixture evaluation framework with precision/recall/F1 - Multi-input support (--diff-file, --repo-path, stdin) Test expansion (116 → 205 tests, 9 → 15 files): - test_agent.py (8), test_ast_analyzer.py (18), test_cli.py (12) - test_edge_cases.py (22), test_performance.py (8), test_fixture_evaluation.py (10) Documentation: - DESIGN.md (159 lines): architecture, design decisions, trade-offs - README.md: bilingual, CLI reference, scan categories table - ai-prompts.md: 4-round development record
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description | 描述
Automated code review agent using Skills + sandbox + database storage.
Implements the full pipeline: diff parsing → Filter safety check → 6-category rule scanning → sandbox execution → deduplication + redaction → JSON/MD report → SQLite persistence.
Related Issue | 关联 Issue
Fix #92
Change Type | 修改类型
Test Coverage | 测试覆盖
python -m pytest examples/skills_code_review_agent/tests/ -vSelf-test Checklist | 自测清单