Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions doc/architecture/SPEC/engine/steps/review.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- verified-against: 2026-09-26 -->

`patch gate + PR review + quality(8 个源文件) · step 库(评审) · refactor-status: ok`
`patch gate + PR review + quality(9 个源文件) · step 库(评审) · refactor-status: ok`

## 职责
条件式 patch 门 + PR 评审 agent step + 有界的 PR review-readiness 质量 step,
Expand All @@ -11,7 +11,7 @@ Pre-push patch 门必须审查显式 base 到当前 HEAD 的已提交变更;
tracked checkout、不可解析的 ref 或超过 reviewer 容量的 diff 都阻塞推送。
通过后记录批准的 base/head,后续推送必须验证当前 HEAD 仍匹配。
它曾是一个 341 行的模块;现在将提交范围的 mutation gate、只读 PR 评审
agent、评测调优过的 prompt 数据和确定性 helper 分开。
agent、评审结果的有界精炼、评测调优过的 prompt 数据和确定性 helper 分开。

## 包内布局(一个文件一个关注点)
- `__init__.py` —— import `patch_gate`、`quality` 和 `steps` 以触发各自的
Expand All @@ -23,8 +23,10 @@ agent、评测调优过的 prompt 数据和确定性 helper 分开。
- `patch_gate.py` —— `review.patch_gate`(validation/read):捕获已提交的
base/head 范围、计算触发条件、审查精确 diff 并记录批准的 head;不依赖
PR review agent 的 prompt/render 控制流。
- `steps.py` —— `agent.review_diff`(agent/read)及其评审覆盖、二轮检查、
评论核验控制流;不批准或推送 mutation。
- `steps.py` —— `agent.review_diff`(agent/read):冻结 evidence pack、
选择评审深度、调用评审 passes 并组装最终结果;不批准或推送 mutation。
- `refinement.py` —— 对 draft 结果进行覆盖补充、定向第二轮、逐评论核验;
接受 handler 提供的 frozen diff、工具和 trace,不注册 step 或发布评论。
- `anchor.py` —— 基于代码片段的评论锚定(2026-08 新增)。
- `repo_tools.py` —— 只读的变更考古工具组(2026-08 新增)。
- `quality.py` —— `agent.assess_pr_quality`:一次 tool-less、只读模型调用,
Expand Down
5 changes: 3 additions & 2 deletions src/infermatrix_copilot/engine/steps/review/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

Importing this package imports `patch_gate`, `quality`, and `steps` for
their `@step` registration side effects. The committed-range mutation gate
lives apart from the read-only review agent and its prompt/render helpers. The public contract below (spec: `engine/steps/review`) is re-exported
so existing `from ..steps.review import X` importers are unchanged.
lives apart from the read-only review agent; the agent's bounded refinement
passes live in `refinement`. The public contract below (spec:
`engine/steps/review`) is re-exported for existing importers.
"""

from __future__ import annotations
Expand Down
Loading
Loading