Skip to content

Bind direct review evidence to the frozen head SHA - #56

Merged
zuiho-kai merged 1 commit into
JiusiServe:mainfrom
congw729:fix/imreview-evidence-head-sha
Aug 9, 2026
Merged

Bind direct review evidence to the frozen head SHA#56
zuiho-kai merged 1 commit into
JiusiServe:mainfrom
congw729:fix/imreview-evidence-head-sha

Conversation

@congw729

@congw729 congw729 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #55.

Problem

Direct reviews freeze one head snapshot, but nothing requires the source files cited as evidence to be read at that commit. With REPO_PATHS pointing at a long-lived local checkout, a review of a PR that targets another branch can quote stale code and still pass validate_direct_review. This produced a concrete false-positive P1 against vllm-project/vllm-omni#5890: the local checkout (on main) showed num_cards=2 for the duplex tests while the PR head (base minicpm-challenge) declares num_cards=1, and the resulting finding asked for a hardware change the PR does not need. Details in #55.

Changes

  • imreview prompts (plugin skill and Cursor integration): replace the ambiguous "inspect the live code/target" with reading every cited file at the pinned head SHA, fetching the PR head ref (or reading files by ref) when the local checkout does not contain that commit, and never citing the working tree as evidence for a different revision. The final gate call now passes the pinned head SHA as evidence_head_sha.
  • first_review_checklist: add the same evidence-binding rule right after the snapshot-freeze item, mirroring the existing rule that binds validation commands to the head SHA.
  • validate_direct_review / _direct_completion_result: add a required evidence_head_sha argument (7-40 hex characters). A missing or implausible value returns partial_review, same fail-closed shape as the subtraction gate. Like that gate, this checks structure rather than truth: it forces an explicit "which commit did I read?" declaration before the only final comment.
  • completion_gate payload and server instructions mention the new requirement; interface docs in README.md and docs/codex/README.md updated.

Validation

  • pytest test/test_thin_mcp_server.py test/test_imreview_output_contract.py — 22 passed, including new cases for the missing/implausible evidence_head_sha paths and the updated checklist/gate payloads.
  • Full offline suite: the only failures are test_provider_selection_and_gaps and test_repo_neutral_core, which fail identically on clean main (02e16c25) and are unrelated to this change.

Direct reviews froze one head snapshot but never required the source
files cited as evidence to be read at that commit. A reviewer holding a
local checkout on another branch could quote stale code and still pass
the completion gate, producing false findings against the PR head.

Require the evidence binding at both ends: the review checklist and the
imreview prompts now direct reading every cited file at the pinned head
SHA (fetching the PR head ref when the checkout holds another revision),
and validate_direct_review now takes a mandatory evidence_head_sha and
returns partial_review without a plausible commit reference.
@congw729
congw729 force-pushed the fix/imreview-evidence-head-sha branch from 8d0168d to 9f3655d Compare August 7, 2026 18:42
@congw729

congw729 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@zuiho-kai

@zuiho-kai
zuiho-kai merged commit b64cea7 into JiusiServe:main Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

imreview: source evidence is not bound to the frozen head SHA, allowing false findings from a stale local checkout

2 participants