Repository navigation
fix(pr-review): never publish a clean verdict when the reviewer drops its findings #541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
39c1d7e
fix(pr-review): never publish a clean verdict when the reviewer drops…
charlesrhoward 9968598
refactor(pr-review): keep report-state helpers under the complexity cap
charlesrhoward 3006956
fix(pr-review): refuse in-run merges when every issue report was reje…
charlesrhoward b41a436
fix(pr-review): read a flow's verdict from its last review node, not …
charlesrhoward 5325051
fix(pr-review): count issue claims the report schema rejects for any …
charlesrhoward a857ac8
fix(pr-review): keep a flow's autofix outcome beside its review node'…
charlesrhoward 974cd9c
refactor(pr-review): keep flow functions at their existing complexity
charlesrhoward File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warning: In-run merge guard blind spot: claims rejected by base schema never set claimedIssues
claimedIssues is set inside reportReviewInputSchema's superRefine (lib/agents/pr-reviewer.ts:L61-L79), which Zod only runs when the base object parses successfully. A reportReview call that fails base validation — missing summary, an invalid severity string like "blocker" in findings, line: 0, or more than 20 findings — never sets claimedIssues, so droppedFindingsRefusal() returns null and mergePullRequest/queuePullRequestForMerge proceed even though the reviewer claimed issues in this run (e.g., malformed-issues report, then clean accepted report, then merge). Post-run publication still detects dropped_findings via readReviewReportState, but the merge will already have executed before the post-run gate can block it — the in-run guard is the only control that acts before the merge.
The in-code comment acknowledges the blind spot ("Zod skips it for input missing a required field... the published verdict does not depend on this"), but that reassurance covers publication only; the merge refusal does depend on it. Observed retry behavior usually re-triggers superRefine and sets the flag, so this needs a single malformed claim followed by a flip to clean to slip through.
Suggestion: make the claim observable before strict validation rejects it — e.g., move required-field and finding-shape enforcement into superRefine itself (with the base object typed permissively so superRefine can set claimedIssues before adding its rejection issues), or record the flag from raw step data outside the schema. A regression test with a claim containing an invalid severity would pin the guarantee either way.