From 755f9a5193df0f2732d0e5b4c9132f09c0fea0d2 Mon Sep 17 00:00:00 2001 From: Zhou Taichang Date: Mon, 30 Nov 2026 14:55:13 +0800 Subject: [PATCH 1/2] Review recipe runtime claims against their named revisions --- .../engine/steps/review/prompts.py | 12 +++++++-- test/test_agent_ensemble.py | 26 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/infermatrix_copilot/engine/steps/review/prompts.py b/src/infermatrix_copilot/engine/steps/review/prompts.py index 56c29ede..68b10739 100644 --- a/src/infermatrix_copilot/engine/steps/review/prompts.py +++ b/src/infermatrix_copilot/engine/steps/review/prompts.py @@ -101,6 +101,13 @@ inclusion/absence; a repo-wide grep falsifies "only"/"all" claims) and record the result \ as a `[claim-verified]`/`[claim-refuted]` findings line. Accepting the author's framing \ without checking is the single most measured recall failure. +13a. For a recipe or benchmark that identifies a tested release, commit, patch, or \ +container, distinguish that runtime from the frozen PR head. Check the implementation \ +and flags at the exact named runtime revision when accessible; absence at the PR head \ +does not refute a claim about that runtime. If the runtime pin is unavailable, record \ +a verification gap, not a confirmed contradiction. Source proves a code path, not that \ +it ran: check matching run evidence separately. Still check whether the recipe's \ +commands, dependency pins, and links let a reader reproduce the qualified setup. 14. Sibling contrast: when the diff ADDS a class/dataclass/config/file into a package, \ list that package and READ the closest in-tree sibling (its merged twin) — every \ invariant, validation, warning, or dedup the sibling enforces that the new code lacks \ @@ -467,8 +474,9 @@ "focus": "You review DOCUMENTATION as a skeptical user who will run every " "command. (a) CLAIMS AUDIT: every factual statement the doc " "makes about code ('X is the only consumer', 'default is Y', " - "'verified on Z') gets falsified against the tree — grep for " - "the counterexample, not the confirmation; every quantitative " + "'verified on Z') gets tested against the revision it describes " + "(checklist 13a), not automatically against the review tree; grep " + "for the counterexample, not the confirmation. Every quantitative " "claim (timing tables, memory models, fitted formulas, " "speedups) gets `calc`-checked for self-consistency (plug the " "doc's own numbers back in; flag unlabeled derived-vs-measured " diff --git a/test/test_agent_ensemble.py b/test/test_agent_ensemble.py index a067f033..f0932a14 100644 --- a/test/test_agent_ensemble.py +++ b/test/test_agent_ensemble.py @@ -1491,3 +1491,29 @@ def test_reducer_keeps_evidence_from_each_investigator_when_it_drops_all_comment assert output["_assessment_incomplete"] is False assert [r["claim"] for r in output["claim_checks"]] == ["raw output", "comparison"] assert [r["dimension"] for r in output["dimension_ratings"]] == ["validation", "claim_evidence"] + + +def test_recipe_review_distinguishes_runtime_pin_from_review_head( + settings, trace, tmp_path, git_repo): + """A docs-only PR can document a runtime that is not in its checkout.""" + settings.review_ensemble = True + settings.review_depth = "light" + settings.review_light_zero_yield_escalate = False + llm = ScriptedLLM([contract(review_comments=[])]) + state = { + "diff_text": "diff --git a/recipes/device.md b/recipes/device.md\n" + "--- /dev/null\n+++ b/recipes/device.md\n" + "@@ -0,0 +1 @@\n" + "+Qualified on release + patch commit 1234abc.\n", + "task_spec": {"pr": 9}, + "repo_path": str(git_repo), + } + registry = register_builtin_steps(StepRegistry()) + result = asyncio.run(registry.get("agent.review_diff").handler( + _ctx(settings, trace, tmp_path, state, llm=llm))) + + assert result.ok, result.summary + prompt = " ".join(llm.calls[0]["messages"][0]["content"].split()) + assert "absence at the PR head does not refute a claim about that runtime" in prompt + assert "If the runtime pin is unavailable, record a verification gap" in prompt + assert "Source proves a code path, not that it ran" in prompt From a49f854664e5c84b5725f1745973723aaa19f649 Mon Sep 17 00:00:00 2001 From: Zhou Taichang Date: Tue, 1 Dec 2026 14:58:50 +0800 Subject: [PATCH 2/2] Document frozen review head and recipe runtime evidence separately --- doc/architecture/SPEC/engine/steps/review.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/architecture/SPEC/engine/steps/review.md b/doc/architecture/SPEC/engine/steps/review.md index 012928ed..601715a4 100644 --- a/doc/architecture/SPEC/engine/steps/review.md +++ b/doc/architecture/SPEC/engine/steps/review.md @@ -1,6 +1,6 @@ # engine/steps/review/ —— 规范 - + `patch gate + PR review + quality(9 个源文件) · step 库(评审) · refactor-status: ok` @@ -82,6 +82,11 @@ agent、评审结果的有界精炼、评测调优过的 prompt 数据和确定 `repo.language` 为键,**诚实降级**;裁决自洽(任何 ≥minor 的评论 ⇒ REQUEST CHANGES); 确定性的按严重度排序的评论上限。 - prompt 是仓库中立的(**A5**)。 +- **区分评审 head 与文档所述的运行版本**:共享 checklist 与文档 lens 都要求按 + recipe 或 benchmark 标明的 release、commit、补丁或容器版本查证实现和参数。 + 冻结的 PR head 仍是审查本次 diff 和可发布锚点的依据,但它没有该实现并不能反驳 + 另一个运行版本。指定版本不可读时记录核验缺口;能读到源码只证明路径存在, + 不证明测试实际执行。运行证据和命令、依赖、链接的可复现性仍须单独检查。 - 质量 step **fail-closed**:枚举/JSON/模型不可用即 BLOCKED; `needs_rework` 少于两条完整依据会机械降为低置信度 `concerns`。短描述、标题、 体量、文件数或没有测试修改任何一项都不得单独成为 needs-rework 理由;其中体量