multi-review-aggregation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMulti-Review Aggregation
多轮审查聚合
Dispatch N independent code reviews and aggregate findings. Each reviewer catches different bugs -- union preserves the long tail that single-shot misses.
Research basis: SWR-Bench (arXiv 2509.01494) -- N independent reviews: 43.67% F1 improvement, 118.83% recall improvement. Diminishing returns past N=5; N=3 captures most improvement.
Core principle: Independence via separate Task dispatches -- same base prompt, no shared context.
发起N次独立的代码审查并汇总结果。每位审查者会发现不同的问题——合并结果能覆盖单次审查遗漏的长尾问题。
研究依据: SWR-Bench(arXiv 2509.01494)——N次独立审查:F1值提升43.67%,召回率提升118.83%。当N超过5时收益递减;N=3时即可获得大部分提升效果。
核心原则: 通过独立的任务调度保证独立性——使用相同的基础提示词,无共享上下文。
N Selection by Tier
按层级选择N值
| Tier | N Reviews | Rationale |
|---|---|---|
| max-20x | 3 | Quality priority -- full aggregation |
| max-5x | 3 | Balanced -- same recall benefit |
| pro/api | 1 | Budget priority -- single review |
When N=1, skip this skill -- use standard single code review.
| 层级 | 审查次数N | 理由 |
|---|---|---|
| max-20x | 3 | 优先保证质量——完整聚合结果 |
| max-5x | 3 | 平衡兼顾——获得相同的召回率收益 |
| pro/api | 1 | 优先控制预算——单次审查 |
当N=1时,无需使用本技能——使用标准的单次代码审查即可。
Parallel Dispatch Pattern
并行调度模式
After spec review passes, dispatch N independent reviews (, each gets "Reviewer i of N"). If all approve with 0 Critical/Important: fast path, skip aggregation. Otherwise dispatch aggregator (haiku model).
run_in_background=TrueFull dispatch code: see . Aggregator prompt: see .
references/dispatch-code.md./aggregator-prompt.md在规格审查通过后,发起N次独立审查(,每次标记为“第i位审查者/共N位”)。如果所有审查者均批准且无Critical/Important问题:走快速通道,跳过聚合步骤。否则调度聚合器(haiku模型)。
run_in_background=True完整调度代码:详见。聚合器提示词:详见。
references/dispatch-code.md./aggregator-prompt.mdAggregation Algorithm
聚合算法
Fast Path
快速通道
ALL N reviewers return with and -> skip aggregation. Unanimous clean = review output.
VERDICT: APPROVECRITICAL: 0IMPORTANT: 0所有N位审查者均返回,且、 → 跳过聚合。一致通过的结果即为审查输出。
VERDICT: APPROVECRITICAL: 0IMPORTANT: 0Severity Voting (When Any Reviewer Raises Issues)
严重程度投票(当有审查者提出问题时)
| Condition | Result |
|---|---|
| All reviewers agree on severity | Keep that severity |
| Reviewers disagree | Use highest severity |
| Lone finding Critical or Important | Keep original severity (no downgrade) |
| Lone finding Minor | Downgrade to Suggestion |
| Lone finding BUT security or data-loss | Keep original severity (no downgrade) |
Severity levels: Critical > Important > Minor > Suggestion
| 条件 | 结果 |
|---|---|
| 所有审查者对严重程度意见一致 | 保留该严重程度 |
| 审查者意见分歧 | 使用最高的严重程度 |
| 单一发现为Critical或Important | 保留原严重程度(不降级) |
| 单一发现为Minor | 降级为Suggestion |
| 单一发现但涉及安全或数据丢失 | 保留原严重程度(不降级) |
严重程度等级:Critical > Important > Minor > Suggestion
Verdict
结论
- "Ready to merge: Yes" -- zero Critical AND zero Important AND majority approved
- "Ready to merge: With fixes" -- only Minor/Suggestion after aggregation
- "Ready to merge: No" -- any Critical or Important remain
Full deduplication/merging rules: see .
references/aggregation-details.md- "Ready to merge: Yes" —— 无Critical问题且无Important问题,且多数审查者批准
- "Ready to merge: With fixes" —— 聚合后仅存在Minor/Suggestion问题
- "Ready to merge: No" —— 仍存在任何Critical或Important问题
完整的去重/合并规则:详见。
references/aggregation-details.mdOutput Format
输出格式
undefinedundefinedStrengths
优势
- [strength] [Reviewers: 1, 2, 3]
- [优势点] [审查者:1, 2, 3]
Issues
问题
Critical / Important / Minor / Suggestion
Critical / Important / Minor / Suggestion
- [issue] [Reviewers: N, N] -- file:line (note downgrade/security provenance as applicable)
- [问题描述] [审查者:N, N] -- 文件:行号 (如有降级/安全相关来源请注明)
Assessment
评估
Ready to merge: [Yes/With fixes/No]
Reviewers: X/N approved, Y requested changes
Full format spec: see `references/output-provenance.md`.Ready to merge: [Yes/With fixes/No]
审查者:X/N批准,Y要求修改
完整格式规范:详见`references/output-provenance.md`。Red Flags
注意事项
Never:
- Share context between reviewers (defeats independence)
- Use N>1 for pro/api tier (budget constraint)
- Skip aggregation when reviewers disagree
- Downgrade security findings even as lone findings
Always:
- Dispatch all N reviews in parallel
- Include reviewer number in each dispatch prompt
- Use haiku for aggregation
- Record per-reviewer metrics separately
绝对禁止:
- 在审查者之间共享上下文(会破坏独立性)
- 对pro/api层级使用N>1(受预算限制)
- 当审查者意见分歧时跳过聚合步骤
- 即使是单一发现,也不得降级安全相关问题的严重程度
必须执行:
- 并行发起所有N次审查
- 在每次调度的提示词中包含审查者编号
- 使用haiku模型进行聚合
- 单独记录每位审查者的指标
Reference Files
参考文件
- : Full dispatch flow with on_spec_review_pass handler
references/dispatch-code.md - : Deduplication, strengths merging, malformed output, timeout recovery
references/aggregation-details.md - : Provenance annotation rules and full output format spec
references/output-provenance.md - : Per-reviewer metric keys, cost impact, per-tier breakdown
references/metrics-and-cost.md - : Aggregator Task dispatch prompt template
aggregator-prompt.md
- :包含on_spec_review_pass处理程序的完整调度流程
references/dispatch-code.md - :去重、优势点合并、格式错误处理、超时恢复相关规则
references/aggregation-details.md - :来源标注规则及完整输出格式规范
references/output-provenance.md - :每位审查者的指标键、成本影响、各层级细分说明
references/metrics-and-cost.md - :聚合器任务调度提示词模板
aggregator-prompt.md