Skip to content

Commit dc0edd5

Browse files
tzhouamclaude
andcommitted
Make test evidence answerable against the CI definition
A PR body that says tests pass is not evidence that the guard cases CI runs for the changed feature were executed. The lane selects by marker, so running a test file directly can prove nothing about what the lane collects. REV-3a makes that comparison a gate: find the guard steps from the pipeline definition at the frozen head, compare their commands with what the PR reports running by selector rather than by literal text, and treat a missing, unrun or mismatched case as a blocking finding. The rule reaches every review channel it applies to. Direct consumers get it through the first-review checklist; the Strict reviewer gets the repo-shaped form through the injected checklist page. That injection had no room left. The page was 6,991 characters against a 7,000-character cap, so anything appended would have been cut off mid-sentence and the gate would have looked present while never reaching the model. The cap moves to 8,000, and the three places that documented it as 4k or 7k now agree with the code. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JCk5xJGRyydouK7tuhs8kk
1 parent e40258d commit dc0edd5

11 files changed

Lines changed: 50 additions & 14 deletions

File tree

‎doc/architecture/SPEC/direct_routing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# direct_routing.py —— 规范
22

3-
<!-- verified-against: 2026-08-31 -->
3+
<!-- verified-against: 2026-09-10 -->
44

55
`LOC ~917 · Direct 模式完整策略包与知识路由 · refactor-status: known-debt`
66

‎doc/architecture/SPEC/engine/steps/review.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# engine/steps/review/ —— 规范
22

3-
<!-- verified-against: 2026-08-31 -->
3+
<!-- verified-against: 2026-09-10 -->
44

55
`LOC ~900(6 个文件) · step 库(评审) · refactor-status: ok`
66

@@ -40,7 +40,8 @@
4040
`_EXPECTED_PLANNER_CAUSES`(`unavailable` / `rejected_depth:`)时记
4141
trace 缺口 —— 配置了的 planner 答非所问(transport / 空回复 / 不可解析)
4242
与"没配"和"守卫在履职"是三件事(见 `review/planner.md` 的 5 种 cause)。
43-
- 评审:领域 checklist 由 profile 的 `review.md` 扩展;`_sweep_targets` 以
43+
- 评审:领域 checklist 由 adapter 的 `knowledge.review_checklist` 或 profile 的
44+
`review.md` 扩展,**注入上限 8k 字符**(页面写满上限时新增门禁会被静默截断);`_sweep_targets` 以
4445
`repo.language` 为键,**诚实降级**;裁决自洽(任何 ≥minor 的评论 ⇒ REQUEST CHANGES);
4546
确定性的按严重度排序的评论上限。
4647
- prompt 是仓库中立的(**A5**)。

‎doc/features/review-recall.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Validated 账本改为**排序**(`[resolved]`/`[claim-*]` 在前)并封顶 1
117117
**旧路径原封不动**。离线测试覆盖新的 planner 规则、文档 pass 选择、
118118
第二轮(触发/跳过/近重复)、溢出门、账本排序、锚点回退、循环追问,
119119
以及每一个新工具(含 calc 的沙箱)。知识 checklist 页按 teacher 蒸馏出的仓库先验重写
120-
(注入上限 4k→7k 字符)。
120+
(注入上限 4k→8k 字符)。
121121

122122
## 实测结果(在各道门之后补记)
123123

‎doc/knowledge/writing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ baseline、catalog、source map、SHA pin 和 manifest,不做 owner 归属判
9494
- `briefing_docs_extra` —— 所有档位都加载的扩展切片,vllm-omni 目前是
9595
`repos/vllm-omni/review/guides/maintainer-pattern-routing.md`;
9696
- 强模型额外的 `performance_briefing_docs`(精简版评审模式);
97-
- `review_checklist` —— 单页仓库评审清单,前 4k 字符注入 Strict reviewer 的
97+
- `review_checklist` —— 单页仓库评审清单,前 8k 字符注入 Strict reviewer 的
9898
system prompt,vllm-omni 指向
9999
`repos/vllm-omni/review/guides/strict-review-checklist.md`。
100100
- **按需** —— `doc_search` / `doc_read` 工具可递归到达 `general/` 里每一页更深的

‎knowledge/general/review/_index.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "代码审查"
33
created: 2026-07-10
4-
updated: 2026-07-30
4+
updated: 2026-09-10
55
type: index
66
tags: [general, review]
77
sources: []
@@ -22,6 +22,6 @@ sources: []
2222

2323
| 遇到什么 | 查看哪里 | 说明 |
2424
|---|---|---|
25-
| 检查同族实现覆盖和条件分支对称性 | [通用设计审查规则](rules.md) | 由代码结构触发的跨仓库设计门禁 |
25+
| 检查同族实现覆盖、条件分支对称性,或 PR 测试证据是否对齐 CI | [通用设计审查规则](rules.md) | 由代码结构和测试证据触发的跨仓库门禁 |
2626
| 从维护者视角审查当前改动,或只拿到 PR 链接 | [独立审查执行合同](guides/review-execution-contract.md) | 一次 Direct 审查复用同一证据,同时完成正确性和设计减法,只输出一篇评论 |
2727
| 查找其他审查专项 | [guides 索引](guides/_index.md) | 只继续读取当前风险命中的专项 |

‎knowledge/general/review/rules.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: "通用设计审查规则"
33
created: 2026-07-30
4-
updated: 2026-07-31
4+
updated: 2026-09-10
55
type: rule
66
tags: [general, review]
7-
sources: ["InferMatrixCopilot Issue #17", "InferMatrixCopilot Issue #24", "vllm-project/vllm-omni PR #5394", "zuiho-kai/claude-workflow-starter@c217fc6"]
7+
sources: ["InferMatrixCopilot Issue #17", "InferMatrixCopilot Issue #24", "vllm-project/vllm-omni PR #5394", "zuiho-kai/claude-workflow-starter@c217fc6", "owner review-rule request 2026-09-10", "JiusiServe/omni-reviewbot PR #56"]
88
confidence: high
99
---
1010

@@ -78,5 +78,23 @@ confidence: high
7878
- 验收:10 分钟内给用户 actionable findings 或明确的 `partial review`;更深验证作为
7979
后续可选任务,不阻塞本轮答复。 ^[InferMatrixCopilot Issue #24]
8080

81+
## 测试证据
82+
83+
### REV-3a — PR 的测试证据必须对齐 CI 实际执行的命令
84+
85+
- 触发:PR 描述声称已验证(Test Plan / Test Result、贴出命令或结果),或改动落在有
86+
CI 看护用例的特性、模型或硬件路径上。
87+
- 强制:以冻结 head 的 CI 定义为准反查看护 step —— pipeline step 的 `commands` 是 CI
88+
真正执行的命令,`source_file_dependencies` 声明它看护哪些改动路径,marker 语义以
89+
`pyproject.toml` 为准。逐条比对 lane 命令与 PR 报告的命令是否选中同一组用例:test
90+
target、`-m` 表达式、run-level 或等价门必须一致。
91+
- 禁止:把"跑过某个测试文件"当成该用例在 lane 内被执行的证据 —— marker 会把它
92+
deselect;用 `timeout`、`--cov*`、容器或环境前缀的字面差异判定不一致;PR 完全没有
93+
测试证据时保持沉默。
94+
- 验收:审查记录列出命中的看护 step、其 lane 命令、PR 报告的命令和等价结论。缺测试
95+
证据、看护 step 未执行或 selector 不一致时给出阻断级 finding,点名 step label 与两条
96+
命令;只跑子集时必须写明未覆盖部分。
97+
^[owner review-rule request 2026-09-10] ^[JiusiServe/omni-reviewbot PR #56]
98+
8199
具体审查执行顺序见[独立审查执行合同](guides/review-execution-contract.md),输入、输出与
82100
边界矩阵写法见[Reviewer Lens Contracts](guides/reviewer-lens-contracts.md)。

‎knowledge/repos/vllm-omni/review/guides/strict-review-checklist.md‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Strict 审查触发式检查单"
33
created: 2026-08-12
4-
updated: 2026-08-25
4+
updated: 2026-09-10
55
type: guide
66
tags: [vllm-omni, review]
77
sources: []
@@ -10,7 +10,7 @@ sources: []
1010
# Strict 审查触发式检查单
1111

1212
Train-distilled trigger→check lines (20-PR campaign + teacher traces
13-
2026-08-15). The Strict reviewer injects the first 7,000 chars
13+
2026-08-15). The Strict reviewer injects the first 8,000 chars
1414
(`knowledge.review_checklist`); keep the core inside that budget.
1515

1616
## Streaming / TTS serving
@@ -105,6 +105,13 @@ Train-distilled trigger→check lines (20-PR campaign + teacher traces
105105
loads that config; propose the single most plausible in-diff mechanism.
106106
- L2 covers CPU/mock plumbing only; serving/entrypoints tests may not collect
107107
under the installed vLLM — classify as environment, not defect.
108+
- PR body vs lane: a `.buildkite/**` step's `commands` are what CI runs and
109+
its `source_file_dependencies` say which changed paths it guards. Compare
110+
the Test Plan/Test Result against them by SELECTOR (targets, `-m`
111+
expression, run-level), never by literal text — `timeout`, `--cov*` and
112+
container prefixes differ by design. A guard step never run, a command
113+
that drops the lane's marker, or no test evidence at all is a blocking
114+
finding naming the step label and both commands.
108115

109116
## Benchmarks / audio numerics
110117

‎knowledge/tools/check_wiki_lint.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"briefing_docs_extra",
3535
"performance_briefing_docs",
3636
# single knowledge page injected as the Strict reviewer's repo-specific
37-
# checklist (first 4k chars); resolved relative to the knowledge root
37+
# checklist (first 8k chars); resolved relative to the knowledge root
3838
"review_checklist",
3939
}
4040
DATE = re.compile(r"^\d{4}-\d{2}-\d{2}$")

‎src/infermatrix_copilot/direct_routing.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def _knowledge_root() -> Path:
182182
"After preflight passes, run targeted tests and low-cost static checks alongside source review.",
183183
"When the diff adds or changes a test, check the assertions bind to real behavior and not to values the fixture, mock, or fake injected.",
184184
"When the PR is a bugfix (title, labels, or linked issue), require a regression test that pins the original failure path; happy-path-only additions do not count, and a missing pin becomes an explicit blocking or non-blocking finding, never silence.",
185+
"Check the PR body's Test Plan and Test Result against the CI definition at the frozen head: name the guard steps whose declared source dependencies cover the changed paths, then compare their commands with what the PR reports running by selector — test targets, marker expression, run level — not by literal text. A guard step never run, a dropped marker, or absent test evidence is a blocking finding naming the step and both commands.",
185186
"When the diff passes a new argument to a dependency, check it against the lowest version the project's own constraints still permit, not the version installed here.",
186187
"For resource or cache changes, trace budget measurement through reservation and physical consumption, including warmup/profile/activation ordering and low-resource behavior.",
187188
"For runtime changes, trace exception propagation, partial-allocation cleanup, cancellation, timeout, shutdown, and concurrent scheduling to the terminal user-visible signal.",

‎src/infermatrix_copilot/engine/steps/review/steps.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,11 @@ async def _review_diff(ctx: StepContext) -> StepResult:
672672
for review_md in candidates:
673673
try:
674674
if review_md.exists() and ctx.settings.profile_briefing_enabled:
675+
# budget: the largest checklist in the tree sat at
676+
# 6,991 chars, flush against the old 7k cap, so a
677+
# newly added gate was silently cut off mid-page
675678
guidance += ("\n\n## Repo-specific review checklist\n"
676-
+ review_md.read_text(encoding="utf-8")[:7_000])
679+
+ review_md.read_text(encoding="utf-8")[:8_000])
677680
break
678681
except OSError:
679682
continue

0 commit comments

Comments
 (0)