review-delta
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReview Delta
增量审查
Perform a focused, token-efficient code review of only the changed code and its blast radius.
Token optimization: Before starting, call for the optimized workflow. Use ONLY changed nodes + 2-hop neighbors in context.
get_docs_section_tool(section_name="review-delta")对变更代码及其影响范围进行聚焦式、低Token消耗的代码审查。
Token优化: 开始前,请调用获取优化工作流。上下文仅需包含变更节点 + 2跳邻接节点。
get_docs_section_tool(section_name="review-delta")Steps
步骤
-
Ensure the graph is current by calling(incremental update).
build_or_update_graph_tool() -
Get review context by calling. This returns:
get_review_context_tool()- Changed files (auto-detected from git diff)
- Impacted nodes and files (blast radius)
- Source code snippets for changed areas
- Review guidance (test coverage gaps, wide impact warnings, inheritance concerns)
-
Analyze the blast radius by reviewing theand
impacted_nodesin the context. Focus on:impacted_files- Functions whose callers changed (may need signature/behavior verification)
- Classes with inheritance changes (Liskov substitution concerns)
- Files with many dependents (high-risk changes)
-
Perform the review using the context. For each changed file:
- Review the source snippet for correctness, style, and potential bugs
- Check if impacted callers/dependents need updates
- Verify test coverage using
query_graph_tool(pattern="tests_for", target=<function_name>) - Flag any untested changed functions
-
Report findings in a structured format:
- Summary: One-line overview of the changes
- Risk level: Low / Medium / High (based on blast radius)
- Issues found: Bugs, style issues, missing tests
- Blast radius: List of impacted files/functions
- Recommendations: Actionable suggestions
-
调用(增量更新)确保图谱是最新的。
build_or_update_graph_tool() -
调用获取审查上下文,返回内容包括:
get_review_context_tool()- 变更文件(从git diff自动检测)
- 受影响的节点和文件(影响范围)
- 变更区域的源代码片段
- 审查指引(测试覆盖缺口、广影响警告、继承问题)
-
审查上下文中的和
impacted_nodes分析影响范围,重点关注:impacted_files- 调用方发生变更的函数(可能需要验证签名/行为)
- 存在继承变更的类(里氏替换原则问题)
- 有大量依赖项的文件(高风险变更)
-
基于上下文执行审查,针对每个变更文件:
- 审查代码片段的正确性、风格和潜在Bug
- 检查受影响的调用方/依赖项是否需要更新
- 调用验证测试覆盖情况
query_graph_tool(pattern="tests_for", target=<function_name>) - 标记所有未覆盖测试的变更函数
-
以结构化格式上报审查结果:
- 摘要:变更内容的单行概述
- 风险等级:低 / 中 / 高(基于影响范围判定)
- 发现的问题:Bug、风格问题、缺失测试
- 影响范围:受影响的文件/函数列表
- 建议:可落地的改进建议
Advantages Over Full-Repo Review
相比全仓库审查的优势
- Only sends changed + impacted code to the model (5-10x fewer tokens)
- Automatically identifies blast radius without manual file searching
- Provides structural context (who calls what, inheritance chains)
- Flags untested functions automatically
- 仅向模型发送变更+受影响代码(Token消耗量降低5-10倍)
- 无需手动搜索文件即可自动识别影响范围
- 提供结构化上下文(调用关系、继承链)
- 自动标记未覆盖测试的函数