Repository navigation
🐛 fix: keep a contributor PR's security hold when a sibling perspective asks for changes - #16863
Conversation
…ve asks for changes On a PR the hive did not author, a security finding is the one early exit to a person while the PR is in CI/Review (#15640), and the decision-marker path already keeps a security-backed hold beside a change request. The bare requires_human path did not: any perspective's changes_requested folded the security perspective's requires_human into the fix cycle, so the PR went back to its author. projectbluefin/utah-packages#890 (2026-11-05 21:55): security returned requires_human on a new Mergeraptor App credential, intent-alignment asked to change `Closes #874` to `Refs #874`; the aggregate became changes_requested and the PR sat at stage/072-returned-to-contributor instead of stage/085-needs-decision. The aggregate now stays requires_human with the finding recorded when the contributor rule applies and securityFindingAcross backs the hold; an unbacked requires_human and hive-authored PRs keep the fix cycle. Signed-off-by: James Reilly <jreilly1821@gmail.com>
|
[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 |
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. |
There was a problem hiding this comment.
Style/maintainability review (head 4271e15) — approve; two advisory notes, no blockers.
- Finding dropped at the fix-cycle cap —
src/pkg/review/review.go:622-641. The new security-hold block sits after theopts.FixAttempts >= maxFixearly return, so a contributor PR that hits the cap with a backed securityrequires_humanstill parks at 085, but withoutDecisionFinding, and the 085 comment cannot printthe review found: …. The sibling route atreview.go:548-556setsDecisionFindingbefore the cap check; mirroring that order keeps the two paths consistent and the PR body's "stays requires_human with the finding recorded" true at the edge:
if seenVerdicts[VerdictChangesRequested] {
+ var securityBacked bool
+ if seenVerdicts[VerdictRequiresHuman] && contributorHandsFree(agg, opts) {
+ // A security finding is the contributor rule's one early exit
+ // to a person (hivecommons/hive#15640); a sibling change request
+ // does not fold it into the fix cycle (utah-packages#890).
+ var finding string
+ if finding, securityBacked = securityFindingAcross(reports, sensitivePaths); securityBacked {
+ agg.DecisionFinding = finding
+ }
+ }
if opts.FixAttempts >= maxFix {
agg.Verdict = VerdictRequiresHuman
agg.RequiresHuman = true
agg.Reasons = []string{fmt.Sprintf("fix cycle cap reached (%d/%d)", opts.FixAttempts, maxFix)}
return agg
}
- if seenVerdicts[VerdictRequiresHuman] && contributorHandsFree(agg, opts) {
- ...
- if finding, backed := securityFindingAcross(reports, sensitivePaths); backed {
- agg.DecisionFinding = finding
- agg.Verdict = VerdictRequiresHuman
- agg.RequiresHuman = true
- return agg
- }
- }
+ if securityBacked {
+ agg.Verdict = VerdictRequiresHuman
+ agg.RequiresHuman = true
+ return agg
+ }- Changelog fragment slug —
changelog.d/fixed-stage-drift-on-park.md. The slug describes neither the PR nor the change (no stage drift, no park logic touched);changelog.d/README.mdasks for<category>-<pr-or-slug>, e.g.fixed-16863-contributor-security-hold.md. Cosmetic, but the compiled changelog is easier to trace back to the PR.
Test placement and sequential-scenario shape match the neighbouring TestAggregateReportsContributorRequiresHumanNeedsSecurityFinding (review_test.go:775-789). Note: the contract reference #16818 is a merged PR, not an issue, and the body carries no closing keyword for it; I judged intent against the PR body and #15640.
— hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. Review findings from Security perspective (read at head 4271e15) The change only ever adds a hold for a person on a contributor PR, so no new trust surface. One gap in the fix's coverage:
( Review findings from Read What I verified
Nothing to change. Changelog fragment uses the |
There was a problem hiding this comment.
Read the change against src/pkg/review/review.go and security_finding.go at e7d19b3. Looks correct to me.
- The new guard (
review.go:636-648) sits inside theseenVerdicts[VerdictChangesRequested]branch after the fix-cycle-cap return, so an exhausted cycle still reports the cap, and it mirrors the existing bare-requires_humanbranch atreview.go:651-659exactly: samecontributorHandsFreegate, samesecurityFindingAcrosspredicate, sameDecisionFindingtext. The decision-marker path atreview.go:571-574already kept a backed hold beside a change request, so this closes the one remaining fold. IsSecuritySensitiveFinding(security_finding.go:78-84) treats the security perspective'srequires_humanas backed on its own, so the #890 scenario (securityrequires_human, intent-alignmentchanges_requested) now lands atrequires_human— matches the test. Hive-authored PRs are unaffected (contributorHandsFreeis false), also covered by the test.
One suggestion, not a defect: contributorHandsFree is also false under self_authored_decision_policy: escalate (security_finding.go:150-152), so an operator who opted into more escalation keeps the old behaviour — a security-backed hold on a contributor PR still folds into the fix cycle when a sibling asks for changes. That is pre-existing, but if the intent is "a security hold always survives", gating this block on !agg.HiveAuthored alone would make escalate strictly more conservative than the default rather than less. Fine to leave for a follow-up.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
On a PR the hive did not author, a security finding is the one early exit
to a person while the PR is in CI/Review (#15640), and the
decision-marker path already keeps a security-backed hold beside a change
request. The bare requires_human path did not: any perspective's
changes_requested folded the security perspective's requires_human into
the fix cycle, so the PR went back to its author.
projectbluefin/utah-packages#890 (2026-11-05 21:55): security returned
requires_human on a new Mergeraptor App credential, intent-alignment asked
to change
Closes #874toRefs #874; the aggregate becamechanges_requested and the PR sat at stage/072-returned-to-contributor
instead of stage/085-needs-decision.
The aggregate now stays requires_human with the finding recorded when the
contributor rule applies and securityFindingAcross backs the hold; an
unbacked requires_human and hive-authored PRs keep the fix cycle.
Found while auditing why hive stalls on projectbluefin/utah-packages (#890 sat at 072 when its security perspective required a human). The other label drifts from the audit match owner rules or were fixed upstream (#16818).
Verification:
gofmt -lis clean. Tests were not run locally, per AGENTS.md; CI is the verdict.