Repository navigation
π fix(review): a reject is never resolved to approve, and every approve path needs full coverage - #17092
Merged
hivecommons-hive[bot] merged 2 commits intoNov 7, 2026
Conversation
β¦ path needs full coverage On a contributor PR, a perspective's reject next to another perspective's non-security decision question went to the hands-free rule, which made the question advisory and dropped the reject with it: approve and merge-eligible (or the fixer lane with a change request). The head now gets what the reject alone gives it, reject, and the question stays in reasons. On a hive-authored PR, the advisory approves for a non-risk decision question and for a bare non-risk requires_human never checked coverage, so a head whose security review never arrived (a dead kick, or a rate-limited review the relay no longer records, hivecommons#16994) was merge-eligible. With a perspective missing the head now reads incomplete and the planner re-asks only that perspective. A fully reviewed head still resolves as advisory. Refs hivecommons#16994 Refs hivecommons#17082 Refs hivecommons#17087 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
Contributor
Contributor
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.
Summary
Two review-aggregate paths could make a head merge-eligible when they shouldn't:
rejectand another asks a non-security decision question. The contributor hands-free rule (Contributor-lane PRs park at 085 needs-decision during CI/Review with no finding surfacedΒ #15640) treats the question as advisory, and it dropped the reject along with it. All five perspectives reported, and the aggregate was stillapproveand merge-eligible. If achanges_requestedwas also present, it went to the fixer lane instead.requires_human) never checked review coverage. A head whose security review never arrived was merge-eligible. The review can be missing because a reviewer kick died, or because the relay no longer records a rate-limited unread review (π fix(review): A review a rate limit kept from reading the PR is no verdict and is asked again, not a human decisionΒ #16994).Now a
rejectalways staysrejecton a contributor PR. Both hive-authored advisory approves also need every perspective the head is owed. If one is missing, the head readsincompleteand the planner re-asks only that perspective.What went wrong
In
aggregateReports(src/pkg/review/review.go):contributorHandsFreeAggregatewhenever no security finding backs the question. It never looked athasReject. The only input it got wasneedsFix, so the outcome wasapprovewith no change requests, or the fixer lane with one. A lonereject, orreject+changes_requested, goes toVerdictReject(close_recommended), and the planner and merge gates treat that as a hold for a person. I also checked the bare-requires_humanhands-free branch and thechanges_requested/ fix-cycle branch. Neither has this hole, because the reject check and the fix cycle both return before the hands-free code runs. A new test pins that.hasAllRequiredPerspectivesguards only the all-approve path.resolveSelfAuthoredDecisionQuestions(from β¨ Let the reviewer resolve non-risk design questions on Hive-authored PRsΒ #12834) and theself-authored non-risk requires_human recorded as advisoryreturn (from π fix(review): route incomplete fixes to fixer laneΒ #12888) approve on whatever reports arrived. On v6 tip, a hive-authored PR with correctness asking a non-risk question, three approvals and no security report resolved toapprove, merge-eligible. π fix(review): A stored "could not read, HTTP 429" requires_human no longer parks the PR; the head is asked againΒ #17082's collect-time guard covers this only while a set-aside "could not read" file is still on disk. After π fix(review): A review a rate limit kept from reading the PR is no verdict and is asked again, not a human decisionΒ #16994 the relay writes no file at all, so nothing caught it. The self-authored intent (β¨ Let Hive-authored PR reviewers resolve low-risk design decisionsΒ #12833 / β¨ Let the reviewer resolve non-risk design questions on Hive-authored PRsΒ #12834) is that the hive settles its own non-risk questions. Nothing in that history says a partly reviewed head should be approved.What changes
rejectgetsVerdictReject+close_recommended, which is the same as the reject without the question. The question stays inreasons(maintainer decision requested: β¦).decision_requestedstays false, because the contributor rule still asks nobody about the question itself. The reject is what holds the PR.hasRequiredCoverage(new). It counts reports againstrequiredPerspectiveCount, the same count π fix(review): the contributor hands-free rule approves only a fully reviewed headΒ #17087 uses. It does not reusehasAllRequiredPerspectives, because that also needs every verdict to be approve. If a perspective is missing, the head isincompletewithreview coverage incomplete: missing <perspectives>, andhuman_summaries/ the decision question are cleared, so nothing reads as a hold. The planner's incomplete path then re-asks only the missing perspective underpending_ttl/max_redispatch. Once it reports, the same reports resolve to the advisory approve. A stored partial-coverageapproveis replaced by the newincompleteon the next collect, becauseretainsOverIncompletekeeps only non-approve verdicts.src/docs/review-swarm.md, plus a changelog entry.Overlap with #17087 and #17082. #17087 (open) adds the same coverage check to the contributor hands-free approve in
contributorHandsFreeAggregate(security_finding.go). This PR doesn't touch that file. It covers the other approve paths inreview.go, and it adds the reject check before the hands-free call, so the two changes sit in different hunks. The new test helpers and test names don't collide with #17087's. The docs edits are in different paragraphs ofreview-swarm.mdfrom #17087's, with unchanged lines between them. The two can merge in either order. #17082 has already merged. Its collect-time guard still holds, and after this PR it covers less on its own.Files
src/pkg/review/review.go: the reject check (A), the coverage check on both self-authored approves (B), and the helpershasRequiredCoverageandincompleteForMissingCoverage.src/pkg/review/approve_needs_coverage_test.go: new tests.src/pkg/review/review_test.go,src/pkg/review/permissions_delta_test.go: four fixtures updated (see below).src/docs/review-swarm.md,changelog.d/fixed-review-reject-and-coverage.md.Tests
New tests that fail on the v6 tip (56423f1) and pass with the fix:
TestContributorRejectWithDecisionQuestionStaysReject: contributor PR, all five perspectives present,reject+ a non-security decision question. On tip it wasapprove/ merge-eligible, and with achanges_requestedadded it waschanges_requested. Now it isrejectin both cases, the same as without the question, with the question recorded.TestSelfAuthoredAdvisoryApproveNeedsFullCoverage(the security-missing subtests): hive-authored PR, security missing, with a bare non-riskrequires_humanor a non-risk decision question. On tip it wasapprove/ merge-eligible. Now it isincomplete,review coverage incomplete: missing security.TestSelfAuthoredIncompleteReasksOnlyMissingPerspective: the planner kicks onlysecurityand asks no person.Controls that pass both before and after:
TestContributorDecisionQuestionAloneStillApprovesHandsFree: the decision question alone, with the other four approving, is still the hands-free advisory approve.TestSelfAuthoredAdvisoryApproveNeedsFullCoverage(the full-coverage subtests, plus amax_perspectives_per_pr: 3case): with full coverage the advisory approve is unchanged.TestContributorBareRequiresHumanKeepsRejectAndChanges: pins that the bare-requires_humanandchanges_requestedpaths already keep a reject or a change request.Existing tests updated. Each of these got its advisory approve from a single hive-authored report under the default five-perspective set, which is the partial coverage this PR closes. Each now adds an approve from every other perspective (
alongsideApprovals), so the head is fully reviewed. What each test checks is unchanged.TestAggregateReportsResolvesNonRiskHiveAuthoredDecisionQuestionsTestAggregateReportsAdvisesSelfAuthoredNonRiskHumanWithoutRemediationTestAggregateReportsResolvesPermissionsTighteningDecisionTestAggregateReportsPermissionsTighteningSummaryIsAdvisoryFull runs:
go test ./pkg/review/... ./pkg/github/... ./pkg/dashboard/... ./cmd/hive/... ./pkg/writeback/...,go vet ./pkg/review/,src/scripts/check-docs-citations.pyandcheck-docs-links.py. I also applied #17087's diff on top of this branch and ran./pkg/review/...and./pkg/github/...: both pass.Refs #16994
Refs #17082
Refs #17087
Refs #15640
π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1