nemoclaw-maintainer-pr-comparator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PR Comparator

PR 比较工具

Picks the merge winner among competing PRs for a single issue. Tier 0 gates eliminate plumbing failures; Tiers 1-2 score correctness and quality; Tier 3 applies deterministic tiebreakers. Degraded mode handles the case where no PR passes gates.
为单个问题从多个竞争PR中选出应合并的最优项。第0层准入检查排除基础流程故障;第1-2层对正确性和质量进行评分;第3层应用确定性平局决胜规则。降级模式用于处理无PR通过准入检查的情况。

Prerequisites

前提条件

  • gh
    CLI installed and authenticated
  • A target repository with an issue that has 2+ open PRs
  • 已安装并完成认证的
    gh
    CLI
  • 目标仓库中存在一个带有2个及以上开放PR的问题

Repo policy

仓库策略

Defaults assume NemoClaw conventions (security CODEOWNERS, DCO, CodeRabbit,
docs/
directory). For other repos, edit
repo-policy.md
to override.
默认遵循NemoClaw约定(安全CODEOWNERS、DCO、CodeRabbit、
docs/
目录)。对于其他仓库,可编辑
repo-policy.md
来覆盖默认设置。

Workflow

工作流程

Copy this checklist into your response and check off each step:
text
PR Comparison Progress:
- [ ] Step 1: Parse issue (body + comments) for acceptance criteria
- [ ] Step 2: Discover candidate PRs (default-order search with stop conditions)
- [ ] Step 3: Detect supersession (parse PR bodies)
- [ ] Step 4: Run Tier 0 gates per PR
- [ ] Step 5: Run Tier 1 correctness checks per PR
- [ ] Step 6: Run Tier 2 quality checks per PR
- [ ] Step 7: Compute weighted scores
- [ ] Step 8: Apply Tier 3 ranking (happy path or degraded mode)
- [ ] Step 9: Emit verdict using templates/verdict.md
将以下检查清单复制到你的回复中,并勾选完成的步骤:
text
PR Comparison Progress:
- [ ] Step 1: Parse issue (body + comments) for acceptance criteria
- [ ] Step 2: Discover candidate PRs (default-order search with stop conditions)
- [ ] Step 3: Detect supersession (parse PR bodies)
- [ ] Step 4: Run Tier 0 gates per PR
- [ ] Step 5: Run Tier 1 correctness checks per PR
- [ ] Step 6: Run Tier 2 quality checks per PR
- [ ] Step 7: Compute weighted scores
- [ ] Step 8: Apply Tier 3 ranking (happy path or degraded mode)
- [ ] Step 9: Emit verdict using templates/verdict.md

Step 1: Parse issue

步骤1:解析问题

Extract acceptance criteria from issue body and all comments:
bash
gh issue view <issue-number> --json title,body,comments
Read every comment — commenters often add asks the body doesn't capture.
从问题正文及所有评论中提取验收标准:
bash
gh issue view <issue-number> --json title,body,comments
阅读所有评论——评论者常会提出正文未涵盖的需求。

Step 2: Discover candidate PRs

步骤2:发现候选PR

bash
scripts/find-candidates.sh <issue-number>
Applies a single default order with stop conditions.
bash
scripts/find-candidates.sh <issue-number>
应用带有终止条件的单一默认排序规则。

Step 3: Detect supersession

步骤3:检测替代关系

bash
scripts/parse-supersession.sh <pr-number-1> <pr-number-2> ...
Parses each PR body for
supersedes #N
,
replaces #N
,
closes in favor of #N
,
folds in #N
. A PR that supersedes another wins ties immediately.
bash
scripts/parse-supersession.sh <pr-number-1> <pr-number-2> ...
解析每个PR正文,查找
supersedes #N
replaces #N
closes in favor of #N
folds in #N
等标识。若一个PR替代了另一个PR,则在平局时直接胜出。

Step 4: Tier 0 gates

步骤4:第0层准入检查

bash
scripts/collect-gates.sh <pr-number>
scripts/check-coderabbit-threads.sh <pr-number>
Five gates, all mandatory. See
checks/tier-0-gates.md
for the full list and interpretation.
bash
scripts/collect-gates.sh <pr-number>
scripts/check-coderabbit-threads.sh <pr-number>
共5项准入检查,均为必填项。完整列表及说明请查看
checks/tier-0-gates.md

Step 5: Tier 1 correctness

步骤5:第1层正确性检查

Six checks, all LLM judgments. See
checks/tier-1-correctness.md
for evidence requirements per check.
共6项检查,均由LLM进行判断。每项检查的证据要求请查看
checks/tier-1-correctness.md

Step 6: Tier 2 quality

步骤6:第2层质量检查

Three checks, all LLM judgments. See
checks/tier-2-quality.md
.
共3项检查,均由LLM进行判断。详情请查看
checks/tier-2-quality.md

Step 7: Weighted score

步骤7:加权评分

  • Each pass = full points
  • Each yellow = half points
  • Each fail = zero
  • Tier 1 weight: 2.0× per check
  • Tier 2 weight: 1.0× per check
  • 通过:满分
  • 警告:半分
  • 失败:零分
  • 第1层检查权重:每项×2.0
  • 第2层检查权重:每项×1.0

Step 8: Tier 3 ranking

步骤8:第3层排名

Branch on whether any PR passes all Tier 0 gates. See
tiebreakers.md
for happy-path tiebreakers, degraded-mode distance-to-ready ranking, and the behavior-coverage matrix.
根据是否有PR通过所有第0层准入检查进行分支处理。正常流程平局决胜规则、降级模式下的就绪度距离排名以及行为覆盖矩阵请查看
tiebreakers.md

Step 9: Emit verdict

步骤9:输出裁决结果

Use
templates/verdict.md
. Every judgment must carry evidence (file:line refs, diff snippets), reasoning chain, and the score it contributed.
使用
templates/verdict.md
模板。每项判断必须附带证据(文件:行号引用、差异片段)、推理链及其对应的评分。

Reference files

参考文件

  • repo-policy.md
    — configurable defaults per target repo
  • checks/tier-0-gates.md
    — plumbing gates
  • checks/tier-1-correctness.md
    — six correctness checks
  • checks/tier-2-quality.md
    — three quality checks
  • tiebreakers.md
    — Tier 3 ranking and degraded mode
  • templates/verdict.md
    — output template
  • validation/backtest.md
    — backtest the skill against historical cases
  • repo-policy.md
    — 目标仓库的可配置默认设置
  • checks/tier-0-gates.md
    — 基础流程准入检查
  • checks/tier-1-correctness.md
    — 6项正确性检查
  • checks/tier-2-quality.md
    — 3项质量检查
  • tiebreakers.md
    — 第3层排名及降级模式
  • templates/verdict.md
    — 输出模板
  • validation/backtest.md
    — 基于历史案例对该技能进行回测

Scripts (execute, do not read)

脚本(仅执行,无需阅读)

  • scripts/find-candidates.sh
    — PR discovery
  • scripts/collect-gates.sh
    — Tier 0 gate evaluation
  • scripts/check-coderabbit-threads.sh
    — GraphQL thread resolution
  • scripts/parse-supersession.sh
    — body parsing for supersession refs
  • scripts/render-verdict.py
    — verdict scorecard renderer
  • scripts/find-candidates.sh
    — PR发现
  • scripts/collect-gates.sh
    — 第0层准入检查评估
  • scripts/check-coderabbit-threads.sh
    — GraphQL线程解析
  • scripts/parse-supersession.sh
    — 正文解析以查找替代关系引用
  • scripts/render-verdict.py
    — 裁决评分卡渲染器

What this skill does NOT do

该技能不支持的功能

These require infrastructure beyond GitHub API + LLM and are deferred to v2 modules:
  • Running each PR's code against adversarial inputs (sandboxed execution)
  • Cross-issue regression sweep (separate skill)
  • Revert simulation against neighbor PRs
  • Static analyzer integration (CodeQL, Semgrep)
这些功能需要GitHub API + LLM之外的基础设施,将推迟到v2版本模块实现:
  • 在对抗性输入下运行各PR代码(沙箱执行)
  • 跨问题回归扫描(独立技能)
  • 针对关联PR的回滚模拟
  • 静态分析器集成(CodeQL、Semgrep)