nemoclaw-maintainer-pr-comparator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePR 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
前提条件
- CLI installed and authenticated
gh - A target repository with an issue that has 2+ open PRs
- 已安装并完成认证的CLI
gh - 目标仓库中存在一个带有2个及以上开放PR的问题
Repo policy
仓库策略
Defaults assume NemoClaw conventions (security CODEOWNERS, DCO, CodeRabbit, directory). For other repos, edit to override.
docs/repo-policy.md默认遵循NemoClaw约定(安全CODEOWNERS、DCO、CodeRabbit、目录)。对于其他仓库,可编辑来覆盖默认设置。
docs/repo-policy.mdWorkflow
工作流程
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.mdStep 1: Parse issue
步骤1:解析问题
Extract acceptance criteria from issue body and all comments:
bash
gh issue view <issue-number> --json title,body,commentsRead 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 , , , . A PR that supersedes another wins ties immediately.
supersedes #Nreplaces #Ncloses in favor of #Nfolds in #Nbash
scripts/parse-supersession.sh <pr-number-1> <pr-number-2> ...解析每个PR正文,查找、、、等标识。若一个PR替代了另一个PR,则在平局时直接胜出。
supersedes #Nreplaces #Ncloses in favor of #Nfolds in #NStep 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 for the full list and interpretation.
checks/tier-0-gates.mdbash
scripts/collect-gates.sh <pr-number>
scripts/check-coderabbit-threads.sh <pr-number>共5项准入检查,均为必填项。完整列表及说明请查看。
checks/tier-0-gates.mdStep 5: Tier 1 correctness
步骤5:第1层正确性检查
Six checks, all LLM judgments. See for evidence requirements per check.
checks/tier-1-correctness.md共6项检查,均由LLM进行判断。每项检查的证据要求请查看。
checks/tier-1-correctness.mdStep 6: Tier 2 quality
步骤6:第2层质量检查
Three checks, all LLM judgments. See .
checks/tier-2-quality.md共3项检查,均由LLM进行判断。详情请查看。
checks/tier-2-quality.mdStep 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 for happy-path tiebreakers, degraded-mode distance-to-ready ranking, and the behavior-coverage matrix.
tiebreakers.md根据是否有PR通过所有第0层准入检查进行分支处理。正常流程平局决胜规则、降级模式下的就绪度距离排名以及行为覆盖矩阵请查看。
tiebreakers.mdStep 9: Emit verdict
步骤9:输出裁决结果
Use . Every judgment must carry evidence (file:line refs, diff snippets), reasoning chain, and the score it contributed.
templates/verdict.md使用模板。每项判断必须附带证据(文件:行号引用、差异片段)、推理链及其对应的评分。
templates/verdict.mdReference files
参考文件
- — configurable defaults per target repo
repo-policy.md - — plumbing gates
checks/tier-0-gates.md - — six correctness checks
checks/tier-1-correctness.md - — three quality checks
checks/tier-2-quality.md - — Tier 3 ranking and degraded mode
tiebreakers.md - — output template
templates/verdict.md - — backtest the skill against historical cases
validation/backtest.md
- — 目标仓库的可配置默认设置
repo-policy.md - — 基础流程准入检查
checks/tier-0-gates.md - — 6项正确性检查
checks/tier-1-correctness.md - — 3项质量检查
checks/tier-2-quality.md - — 第3层排名及降级模式
tiebreakers.md - — 输出模板
templates/verdict.md - — 基于历史案例对该技能进行回测
validation/backtest.md
Scripts (execute, do not read)
脚本(仅执行,无需阅读)
- — PR discovery
scripts/find-candidates.sh - — Tier 0 gate evaluation
scripts/collect-gates.sh - — GraphQL thread resolution
scripts/check-coderabbit-threads.sh - — body parsing for supersession refs
scripts/parse-supersession.sh - — verdict scorecard renderer
scripts/render-verdict.py
- — PR发现
scripts/find-candidates.sh - — 第0层准入检查评估
scripts/collect-gates.sh - — GraphQL线程解析
scripts/check-coderabbit-threads.sh - — 正文解析以查找替代关系引用
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)