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