Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/infermatrix_copilot/engine/steps/review/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 "
Expand Down
26 changes: 26 additions & 0 deletions test/test_agent_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading