Skip to content

πŸ› fix(review): a reject is never resolved to approve, and every approve path needs full coverage - #17092

Merged
hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/review-reject-and-coverage
Nov 7, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/review-reject-and-coverage

Conversation

@Danathar

@Danathar Danathar commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Two review-aggregate paths could make a head merge-eligible when they shouldn't:

Now a reject always stays reject on a contributor PR. Both hive-authored advisory approves also need every perspective the head is owed. If one is missing, the head reads incomplete and the planner re-asks only that perspective.

What went wrong

In aggregateReports (src/pkg/review/review.go):

What changes

  • A: in the decision-question branch, a contributor PR with a reject gets VerdictReject + close_recommended, which is the same as the reject without the question. The question stays in reasons (maintainer decision requested: …). decision_requested stays false, because the contributor rule still asks nobody about the question itself. The reject is what holds the PR.
  • B: both self-authored advisory approves now check hasRequiredCoverage (new). It counts reports against requiredPerspectiveCount, the same count πŸ› fix(review): the contributor hands-free rule approves only a fully reviewed headΒ #17087 uses. It does not reuse hasAllRequiredPerspectives, because that also needs every verdict to be approve. If a perspective is missing, the head is incomplete with review coverage incomplete: missing <perspectives>, and human_summaries / the decision question are cleared, so nothing reads as a hold. The planner's incomplete path then re-asks only the missing perspective under pending_ttl / max_redispatch. Once it reports, the same reports resolve to the advisory approve. A stored partial-coverage approve is replaced by the new incomplete on the next collect, because retainsOverIncomplete keeps only non-approve verdicts.
  • The self-authored fix-cycle routes (change requests, concrete remediation) don't wait on coverage. That matches πŸ› fix(review): the contributor hands-free rule approves only a fully reviewed headΒ #17087's choice for the contributor fixer lane.
  • Docs: one paragraph in each of two places in 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 in review.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 of review-swarm.md from #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 helpers hasRequiredCoverage and incompleteForMissingCoverage.
  • 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 was approve / merge-eligible, and with a changes_requested added it was changes_requested. Now it is reject in 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-risk requires_human or a non-risk decision question. On tip it was approve / merge-eligible. Now it is incomplete, review coverage incomplete: missing security.
  • TestSelfAuthoredIncompleteReasksOnlyMissingPerspective: the planner kicks only security and 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 a max_perspectives_per_pr: 3 case): with full coverage the advisory approve is unchanged.
  • TestContributorBareRequiresHumanKeepsRejectAndChanges: pins that the bare-requires_human and changes_requested paths 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.

  • TestAggregateReportsResolvesNonRiskHiveAuthoredDecisionQuestions
  • TestAggregateReportsAdvisesSelfAuthoredNonRiskHumanWithoutRemediation
  • TestAggregateReportsResolvesPermissionsTighteningDecision
  • TestAggregateReportsPermissionsTighteningSummaryIsAdvisory

Full runs: go test ./pkg/review/... ./pkg/github/... ./pkg/dashboard/... ./cmd/hive/... ./pkg/writeback/..., go vet ./pkg/review/, src/scripts/check-docs-citations.py and check-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

… 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>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 7, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive
hivecommons-hive Bot merged commit 35e8e67 into hivecommons:v6 Nov 7, 2026
67 of 68 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#17092c148add` sha256:57c33de21871b14c76ef6cc72db624b792c5d303f36f3e1c58a9156b8a0339f5 β€” download from the dashboard or `hivectl review evidence #17092`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @Danathar holds role owner and GitHub permission maintain on repo; CI green at c148add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant