Repository navigation
🐛 fix(review): the contributor hands-free rule approves only a fully reviewed head - #17087
Merged
hivecommons-hive[bot] merged 2 commits intoNov 7, 2026
Conversation
…viewed head contributorHandsFreeAggregate resolved a bare non-security requires_human (or decision question) on a contributor PR to approve + merge_eligible with no coverage check. Since hivecommons#16994 the relay drops a rate-limited "could not read" review, so a head whose security review was dropped became merge-eligible on a correctness product question alone. A dead reviewer kick left the same hole. The approve branch now needs every perspective the head is owed (the configured set, capped by max_perspectives_per_pr), the same count the all-approve path uses. Short of that the head is incomplete with "review coverage incomplete: missing ...", and the planner re-asks only the missing perspective. The fixer lane, fix-cycle cap, decision questions and security findings are unchanged. Tests that approved hands-free on one report under the five-perspective default now add approving siblings or collect with max_perspectives_per_pr: 1. 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
|
Contributor
Contributor
hivecommons-hive Bot
added a commit
that referenced
this pull request
Nov 7, 2026
… path needs full coverage (#17092) 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, #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 #16994 Refs #17082 Refs #17087 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.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.
Summary
On a contributor PR, a bare non-security
requires_human(or decision question) resolves hands-free toapproveand merge-eligible. That path never checked review coverage, so a head that one perspective never reported on could still be merge-eligible. Since #16994 the relay drops a rate-limited "could not read" review instead of recording it, so the missing perspective can be security: correctness asks a product question, no security finding backs anything, and the head is merge-eligible with no security review. Now the hands-free approve needs the same coverage as the all-approve path. With a perspective missing the head readsincompleteand the planner asks for it.What went wrong
aggregateReports(src/pkg/review/review.go) has two ways to reachapprove:hasAllRequiredPerspectivesholds, otherwiseincompletewithreview coverage incomplete: missing ….requires_humanor decision question with no security finding goes tocontributorHandsFreeAggregate(src/pkg/review/security_finding.go). When there is nothing to fix, it setapprove+merge_eligiblewith no coverage check.Before #16994, an unread security review was recorded as a security-lens
requires_human, whichIsSecuritySensitiveFindingtreats as a finding, so the PR parked. Now the relay writes no file for it.securityFindingAcrossfinds nothing, and the hands-free rule approves. A reviewer kick that simply died leaves the same hole.I reproduced this on the v6 tip (2161745). Four default perspectives report: correctness gives a bare non-security
requires_human, and the other three approve. Security is missing. The result isapprove,merge_eligible=true. The same happens at the relay with a combined review whose security entry is a rate-limited "not read".How far the gap reaches: an untrusted author's PR still parks at
stage/090-ready-for-human-merge, so a person merges it. A contributor the hive trusts has no such stop. That means an operator-set registry tier, a verified claim marker, or a PR the hive adopted. The contributor-lane auto-merge tier (src/pkg/github/automerge/automerge_contributor_lane.go) merges that PR on a green head when the reviewer's verdict for it approves.What changes
contributorHandsFreeAggregate: before it resolves to approve, it checks that every perspective the head is owed has reported (the configured set, capped bymax_perspectives_per_pr). If one is missing, the head isincompleteand not merge-eligible, with the all-approve path's reason (review coverage incomplete: missing security). Nobody is asked, and the planner re-asks only the missing perspective underpending_ttl/max_redispatch. When the report arrives, the head resolves hands-free to approve as before.hasAllRequiredPerspectivesitself, because that function also requires every verdict to be approve. A siblingrejectwith a non-security question would then read "coverage incomplete" with nothing left to ask, and the head would never move.retainsOverIncomplete/mergeCollected: a stored partial-coverageapproveis not a settled non-approve verdict, so the freshincompletereplaces it on the next collect (a test covers this). A storedrequires_human/changes_requested/rejectstill wins overincompleteas before, which keeps the head held, so it cannot reopen the hole. There is no re-dispatch loop: the planner's incomplete path keeps the delivered perspectives off the pending list.src/docs/review-swarm.mdunder the contributor rule, plus a changelog entry.Overlap with #17082 (open,
fix/unreadable-stored-verdict): that PR adds a collect-time guard incollectForPRs(review.go). The guard turns a hands-freeapproveintoincompletewhen a set-aside unreadable report file is on disk for that head. This PR fixes the general case at the source: no file at all, as after the relay skip, or a dead kick. The code here is insecurity_finding.go, andreview.gois untouched. The docs edit is in a different section ofreview-swarm.mdfrom #17082's hunks. Either can land first. Once both are in, #17082's guard is a subset of this check and stays harmless.Files
src/pkg/review/security_finding.go: the coverage check incontributorHandsFreeAggregate.src/pkg/review/hands_free_coverage_test.go: new tests.src/pkg/review/review_test.go,src/pkg/github/review_verdict_relay_test.go: fixtures updated (see below).src/pkg/github/review_verdict_unreadable_test.go: new relay-level test.src/docs/review-swarm.md,changelog.d/fixed-hands-free-needs-full-coverage.md.Tests
New tests. Each fails on the v6 tip and passes with the fix:
TestContributorHandsFreeWithMissingPerspectiveIsIncomplete: security missing, correctness gives a barerequires_humanor a non-security decision question. The head isincomplete, not merge-eligible, with reasonreview coverage incomplete: missing security.TestContributorHandsFreeIncompleteReasksOnlyMissingPerspective: the planner kicks onlysecurityand asks no person, and the head approves once security reports.TestContributorHandsFreeIncompleteReplacesStoredPartialApprove: a stored partial-coverage approve is replaced byincompletethroughCollectAndMerge.TestRecordReviewVerdictDroppedSecurityLeavesHandsFreeHeadIncomplete(relay): a combined review with a rate-limited security entry (dropped byUnreadableReviewReason) and a real correctnessrequires_humangives no merge-eligible aggregate.Behaviour these pin, which passes both before and after:
TestContributorHandsFreeWithFullCoverageStillApproves: the same report set with all five perspectives still resolves hands-free to approve, and also undermax_perspectives_per_pr: 3.TestContributorHandsFreeFixOutcomesIgnoreCoverage: the fixer lane and the fix-cycle cap do not wait on coverage.Existing tests updated. Each one approved hands-free on a single report under the default five-perspective set, which is the partial coverage this PR closes:
TestAggregateReportsMatrix("unbacked decision request on a contributor PR is advisory"),TestAggregateReportsContributorDecisionNeedsBackingand the first case ofTestAggregateReportsContributorRequiresHumanNeedsSecurityFindingnow add an approve from every other perspective (withApprovingSiblings), so the head is fully reviewed.TestRecordReviewVerdictIsCollectableandTestRecordReviewVerdictPromotesDecisionMarkercollect withmax_perspectives_per_pr: 1, so their one relayed report is full coverage. What each test checks is unchanged.Full runs:
go test ./pkg/review/... ./pkg/github/... ./pkg/dashboard/... ./cmd/hive/... ./pkg/writeback/...,go vet ./pkg/review/ ./pkg/github/, andsrc/scripts/check-docs-citations.py/check-docs-links.py.Refs #16994
Refs #17082
Refs #15640
🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1