feat(read): github_read_pr_file — reads pinned to the PR head (v0.3.0)#22
Merged
Conversation
`github_read_file`'s `ref` is optional and defaults to the repo's DEFAULT BRANCH. A reviewer that omits it reads the PRE-PR file, then "confirms" that symbols the PR ADDS don't exist — blocker findings on correct code. That is not hypothetical: pr-reviewer-plugin#20. On protoAgent#2088 the verifier reported `goalDetailQuery` missing from apps/web/src/lib/queries.ts; it is exported at line 90 of the reviewed head. Prompt-level ref discipline was already in place in BOTH the review-finder and verifier system prompts, and the recipe passed the head SHA to every step — it still read the default branch. Telling the model to pass a ref is not a guarantee. `github_read_pr_file(number, path, repo)` takes no ref at all: it resolves the head SHA server-side from the PR, and a failed pinned read ERRORS rather than falling back to the default branch (a silent fallback is the bug itself). Additive — `github_read_file` is untouched, so nothing existing changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mabry1985
added a commit
to protoLabsAI/protoAgent
that referenced
this pull request
Jul 21, 2026
#2100) The review panel read PR files with `github_read_file`, whose `ref` is optional and defaults to the repo's DEFAULT BRANCH. Omit it and you read the code as it was BEFORE the PR — so the verifier "confirms" that symbols the PR ADDS don't exist, and a correct PR collects blocker findings. Observed on protoAgent#2088: the verifier reported `goalDetailQuery` missing from apps/web/src/lib/queries.ts; it is exported at line 90 of the reviewed head. #2094 drew 8 → 9 → 11 findings across three re-reviews about code the PR never touched (recalled prior_findings re-seed each panel, so a wrong-ref finding compounds). Prompt-level discipline was ALREADY here and did not hold: both the review-finder and verifier prompts said "pass ref=<head SHA>", the recipe passed the SHA to every step, and the reads still went to main. A rule the model has to remember on every call is not a guarantee. Both review seats now use github-plugin's `github_read_pr_file` (v0.3.0), which takes no ref at all — it resolves the head SHA server-side from the PR number. `github_read_file` stays for policy docs, which must still be read at the base (a PR must not rewrite the rules it is judged by), and the verifier now fails closed: an unreadable head means "uncertain", never "confirmed". Refs pr-reviewer-plugin#20, protoLabsAI/github-plugin#22. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the tool-shaped half of pr-reviewer-plugin#20.
github_read_file'srefis optional and defaults to the repo's default branch. A reviewer that omits it reads the pre-PR file and then "confirms" that symbols the PR adds don't exist — blocker findings on correct code.Reproduced: on protoAgent#2088 the verifier said
goalDetailQuerywas missing fromapps/web/src/lib/queries.ts; it is exported at line 90 of the reviewed head19c37f7a.Prompt-level discipline was already deployed and still failed — both
review-finderandverifiersystem prompts spell out "passref=<head SHA>", and the recipe passed the SHA to every step. So the fix has to remove the choice.github_read_pr_file(number, path, repo)takes no ref: the head SHA is resolved server-side from the PR number, and a failed pinned read errors rather than falling back to the default branch — a silent fallback is precisely the defect.Additive.
github_read_fileis untouched; existing callers are unaffected.Test
113 passed. Three new tests, mutation-verified (deleting the
ref=pin failstest_read_pr_file_reads_at_the_prs_head_sha):🤖 Generated with Claude Code