examples: add skill-driven code review agent#233
Conversation
Add a code review example that loads the code-review Skill, stages review inputs in supported workspace runtimes, applies execution governance, and persists structured reports and audit metadata. The example supports dry-run, FakeModel, and OpenAI-compatible model paths, with Docker/Cube runtime configuration, fixtures, and Chinese documentation. RELEASE NOTES: Added a skill-driven code review Agent example with sandboxed review execution and structured reports.
|
I have read the CLA Document and I hereby sign the CLA |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #233 +/- ##
==========================================
Coverage ? 87.84906%
==========================================
Files ? 482
Lines ? 45157
Branches ? 0
==========================================
Hits ? 39670
Misses ? 5487
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
AI Code Review发现的问题
|
AI Code Review发现的问题🚨 Critical
|
| continue | ||
| seen.add(key) | ||
| (human if item["confidence"] < 0.7 else accepted).append(item) | ||
| root, task_root = Path(output_dir or Path(__file__).parents[1] / "review-output"), None |
There was a problem hiding this comment.
save_review_report 未校验 task_id/output_dir 致路径穿越
该函数作为 FunctionTool 暴露给模型,task_id 与 output_dir 由不可信上下文提供,未做校验即拼接 task_root 并 mkdir/写文件,存在任意文件写入风险。建议对 task_id 做白名单字符校验(如 ^[A-Za-z0-9._-]+$ 且禁止 ..),并强制 task_root.resolve().is_relative_to(root.resolve())。
Summary
新增
examples/skills_code_review_agent自动代码评审 Agent 示例。该示例支持输入 unified diff、Git 工作区变更或文件列表;通过加载代码评审 Skill、在隔离 Workspace 中执行受控检查,生成结构化 findings、JSON/Markdown 报告和可按 task id 回读的审计记录。
Related Issue
Fixes #92
PR Type
type/featureChanges
LlmAgent、SkillToolSet与Runner的代码评审流程。review_report.json与review_report.md。--dry-run、--fake-model与真实 OpenAI 兼容模型三种运行模式。Skill Attribution
skills/code-review/从 awesome-skills/code-review-skill 引入,并保留上游许可证。Validation
已手动验证 Docker Runtime 下的
--diff-file和--repo-path输入路径。