multi-review-aggregation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Multi-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值

TierN ReviewsRationale
max-20x3Quality priority -- full aggregation
max-5x3Balanced -- same recall benefit
pro/api1Budget priority -- single review
When N=1, skip this skill -- use standard single code review.
层级审查次数N理由
max-20x3优先保证质量——完整聚合结果
max-5x3平衡兼顾——获得相同的召回率收益
pro/api1优先控制预算——单次审查
当N=1时,无需使用本技能——使用标准的单次代码审查即可。

Parallel Dispatch Pattern

并行调度模式

After spec review passes, dispatch N independent reviews (
run_in_background=True
, each gets "Reviewer i of N"). If all approve with 0 Critical/Important: fast path, skip aggregation. Otherwise dispatch aggregator (haiku model).
Full dispatch code: see
references/dispatch-code.md
. Aggregator prompt: see
./aggregator-prompt.md
.
在规格审查通过后,发起N次独立审查(
run_in_background=True
,每次标记为“第i位审查者/共N位”)。如果所有审查者均批准且无Critical/Important问题:走快速通道,跳过聚合步骤。否则调度聚合器(haiku模型)。
完整调度代码:详见
references/dispatch-code.md
。聚合器提示词:详见
./aggregator-prompt.md

Aggregation Algorithm

聚合算法

Fast Path

快速通道

ALL N reviewers return
VERDICT: APPROVE
with
CRITICAL: 0
and
IMPORTANT: 0
-> skip aggregation. Unanimous clean = review output.
所有N位审查者均返回
VERDICT: APPROVE
,且
CRITICAL: 0
IMPORTANT: 0
→ 跳过聚合。一致通过的结果即为审查输出。

Severity Voting (When Any Reviewer Raises Issues)

严重程度投票(当有审查者提出问题时)

ConditionResult
All reviewers agree on severityKeep that severity
Reviewers disagreeUse highest severity
Lone finding Critical or ImportantKeep original severity (no downgrade)
Lone finding MinorDowngrade to Suggestion
Lone finding BUT security or data-lossKeep 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.md

Output Format

输出格式

undefined
undefined

Strengths

优势

  • [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

参考文件

  • references/dispatch-code.md
    : Full dispatch flow with on_spec_review_pass handler
  • references/aggregation-details.md
    : Deduplication, strengths merging, malformed output, timeout recovery
  • references/output-provenance.md
    : Provenance annotation rules and full output format spec
  • references/metrics-and-cost.md
    : Per-reviewer metric keys, cost impact, per-tier breakdown
  • aggregator-prompt.md
    : Aggregator Task dispatch prompt template
<!-- compressed: 2026-02-11, original: 673 words, compressed: 434 words -->
  • references/dispatch-code.md
    :包含on_spec_review_pass处理程序的完整调度流程
  • references/aggregation-details.md
    :去重、优势点合并、格式错误处理、超时恢复相关规则
  • references/output-provenance.md
    :来源标注规则及完整输出格式规范
  • references/metrics-and-cost.md
    :每位审查者的指标键、成本影响、各层级细分说明
  • aggregator-prompt.md
    :聚合器任务调度提示词模板
<!-- 压缩时间:2026-02-11,原文:673词,压缩后:434词 -->