Repository navigation
π review: a hive-authored ask on a sensitive path stays a person's decision - #16096
Conversation
β¦cision Under self_authored_decision_policy: resolve, a hive-authored requires_human or decision-requested perspective whose in-scope finding sits on a sensitive path (sentinel defaults plus security.sensitive_paths) now stays requires_human with a decision_finding naming the file, so no fix is dispatched and the PR parks at stage/085-needs-decision with the reviewer's ask. The sensitive-paths risk class used to read only the question's wording: projectbluefin/bonedigger#106's "apply the pr-validate.yml + BASELINE hunks" named no risk term, was routed to the fixer as changes_requested, and sat at 070 with stage/stalled flapping through six fix attempts that never pushed, nobody asked. Aggregate.Normalize and prstage.NormalizeReviewVerdict leave a requires_human with a recorded decision_finding alone. Asks for changes, asks off the sensitive paths, out-of-scope findings, permissions- tightening-only diffs and the escalate policy are unchanged. 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>
|
[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.
Decision needed: @clubanderson should decide whether an in-scope finding on a sensitive path (workflows, OWNERS, security.sensitive_paths) is enough to override self_authored_decision_policy: resolve and park a hive-authored PR at 085, as this PR makes it.
The code does what it says; the question is whether the hive should do it. This widens the sensitive-paths risk class from how the ask is worded to where the finding sits, which changes when the hive stops resolving its own review questions. That is merge/trust policy for every repo this hive serves, so a person should own it.
What I verified on this head:
src/pkg/review/review.go:835-840βreportRequiresRiskEscalationnow returns true for a hive-authoredrequires_human/decision-requested report with an in-scope finding underSecuritySensitivePaths(opts.SensitivePaths), soriskEscalationkeeps the hold through the existingresolveSelfAuthoredDecisionQuestionsbranch. Both callers (:491,:797) take the newopts;AggregateOptions.SensitivePathsalready exists on v6 (review.go:203).review.go:615-620βDecisionFindingis only filled on the path that already returnsrequires_human, andNormalize(:666-671) now returns early whenever it is set. The two pre-existingDecisionFindingsets (:532,:590) are the contributor hands-free cases, whichNormalizealready exits for viaHiveAuthoredKnown && !HiveAuthored/DecisionRequested, so the early return does not change routing for those.security_finding.goβ the path check is lifted intosensitivePathFinding;IsSecuritySensitiveFindingevaluates question β path β term in the same order as before, so no change there beyond the extraction.- The carve-outs are real:
PermissionsTighteningOnly,escalatepolicy, out-of-scope findings andchanges_requestedon a workflow file all fall through (:874-880, covered byTestSelfAuthoredAsksOffSensitivePathsStillGoToTheFixer). prstage.NormalizeReviewVerdictgains the sameDecisionFindingguard, withTestNormalizeReviewVerdictKeepsARecordedDecisionFindingpinning both the kept and the legacy branch.
One consequence worth stating for the decision: this applies to any perspective, so a docs-currency or style requires_human with an in-scope finding on .github/workflows/*.yml on a hive PR now parks that PR for a person, where today it is resolved. src/docs/review-swarm.md:324-339 describes that as intended. If that is the policy you want, the implementation looks correct to me and I have no code findings.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Needs a decision, not a merge:
Head: verdict requires_human @452af37, 57/57 checks green, DCO yes, soak 0s of 10m0s. How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Evidence bundle `#16096d1e1dc4` sha256:1e5531af0e3d1bc03e50bf06a9e3b0e6f66cfd659de640a37fb668c0dcf46df4 β download from the dashboard or `hivectl review evidence #16096`.Review findings from Read the diff on d1e1dc4 against the surrounding aggregation code: The mechanism holds up:
One scope note, not a defect: the |
There was a problem hiding this comment.
Read the diff at d1e1dc4 against v6 and the surrounding code before the body. What I verified:
- The new sensitive-path gate only fires for a hive-authored report that is
requires_humanorDecisionRequested, outsideescalate, and not permissions-tightening-only (src/pkg/review/review.go:873-880); achanges_requestedperspective on a workflow file is untouched, matching the body's "not covered" list. - It enters through
reportRequiresRiskEscalation(review.go:840), soriskEscalationbecomes true inaggregateReportsand both self-authored resolve branches (:595,:607) are skipped; the fall-through at:615-623then recordsDecisionFindingand returnsrequires_human.Aggregate.DecisionFindingandprstage.ReviewVerdict.DecisionFindingalready existed on v6 (review.go:254,types.go:224), so the two normalizer early-returns (review.go:666,types.go:273) only change behaviour for aggregates that now carry the finding β previously a hive-authored aggregate never reached that path with one set. - The
security_finding.gorefactor is behaviour-preserving:IsSecuritySensitiveFindingstill checks question class β sensitive path β finding terms β summary terms in the same order, with the path loop factored intosensitivePathFinding(security_finding.go:90-122). self_authored_workflow_ask_test.gogoes throughcontributorLaneVerdictFromArtifactandstageengine.ClassifyStage, so the prstage wiring ofDecisionFindingis covered end to end, not only in the aggregate.
Body and diff agree. Looks correct to me. This changes which hive-authored PRs park at 085 instead of going to the fixer, which is the hive's own policy call rather than a defect question, so nothing here needs a maintainer decision from my side.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary
On a hive-authored PR, a review perspective that asks a person (
requires_human, or a decision question) about a change on a sensitive path, such as a workflow file, now stays a person's decision under the defaultself_authored_decision_policy: resolve.requires_humanwithdecision_finding: sensitive path <file>: β¦.stage/085-needs-decision, and the comment names the finding and the reviewer's ask.Asks for changes, and asks about ordinary files, still go to the fixer at 070 exactly as before.
The bug
Seen on projectbluefin/bonedigger#106 ("ci: pin the Python tools the pull-request checks install"). That hive runs v6 and was on c6185a2 β 5a82ae2 β 74a1ebe during the window; none of the code below changed between those builds and 6f6a5ca.
pr-validate.yml+BASELINEhunks from the PR body on this branch before merging". The intent-alignment finding was on.github/workflows/pr-validate.yml:28. The PR body said the authoring agent's token could not push under the workflows folder.stage/070-fixing, not 085.review-fixkicks went toscannerevery 2h (19:02Z, 21:06Z, 23:08Z, 01:11Z, 03:13Z). None of them pushed. From 10-30 the dispatcher loggedreview fix dispatch excluded β¦ reason=fix-attempts-exhausted attempts=6on every cycle.stage/stalledwas added 11 times between 10-29 21:04Z and 10-31 10:57Z (issues/106/events).projectbluefin/utah#938hit the same exhausted state on the same days.Why, at 6f6a5ca:
self_authored_decision_policy: resolve(review_config.go:338) resolves a hive-authored decision question unless it matches aDecisionRiskClass, andsensitive-pathsis one of them (review.go:955). But the class is tested only against the question's wording (selfAuthoredDecisionResolvable,reportRequiresRiskEscalation). "apply thepr-validate.ymlhunks" contains noworkflowor.github/workflowsterm, so it read as a non-risk engineering call.changes_requestedperspective beside it, or concrete wording,aggregateReportssetchanges_requested+FixCycle(review.go:542). On read, bothAggregate.Normalize(review.go:645) and the stage-sideprstage.NormalizeReviewVerdict(types.go:255) rewrite a hive-authoredrequires_humanwith concrete wording the same way.ClassifyStagethen sawVerdictBlocks, which means 070.security_finding.go) already counts an in-scope finding on a sensitive path as the reason to ask a person. The hive's own PRs did not.The fix
reportRequiresRiskEscalation(r, opts)returns true for a hive-authored report that asks a person and has an in-scope finding whosefilematches the sensitive paths (sentinel.DefaultSensitivePathsplussecurity.sensitive_paths). The path matcher is the one the contributor rule already uses, factored out assensitivePathFinding.requires_human,decision_requested, the reviewer's question verbatim,decision_findingfromsecurityFindingAcross), and a barerequires_humanis not routed to the fixer. The bare case now also records the finding indecision_finding.Aggregate.Normalizeandprstage.NormalizeReviewVerdictleave arequires_humanwith a recordeddecision_findingalone. Before the fix, a hive-authored aggregate never had one on that path, so existing records read exactly as before.workflows: write(app.go:360) and on many hives the fixer can land it.escalatehives, which already hold every question and get no new finding text.The 085 comment. It is the existing
RouteHumantext: "the reviewer swarm returnedrequires_human", "the review found: sensitive path .github/workflows/pr-validate.yml: β¦", "reviewer question: apply thepr-validate.yml+BASELINEhunks β¦". 085 has no stalled dwell, so thestage/stalledflapping stops.Related, and what this does not change
fixer-exhausted:N. This PR is the earlier, specific half:Tests
pkg/review/self_authored_sensitive_path_test.go:.github/workflows/pr-validate.yml, beside a lowchanges_requestedfinding, givesrequires_humanwith the question kept, adecision_findingnaming the file, and no fix cycle.Normalizekeeps it.requires_humanon the workflow file. It is held with the finding andNormalizekeeps it. The same aggregate without the recorded finding still normalizes tochanges_requested, so the guard is the finding.changes_requestedon a workflow file;changes_requestedon a workflow file;security.sensitive_pathsis honoured. Underescalatethe behaviour is unchanged and no finding text is added.cmd/hive/self_authored_workflow_ask_test.go:AggregateReports, then the realcontributorLaneVerdictFromArtifact, thenstageengine.ClassifyStageon the self lane'sreview-verdict-requires-humanreason, gives 085 withcontributor-lane:decision-requested, and the ask and finding reach the verdict for the comment. A 085 record is neverStalledafter 40h.prstage.NormalizeReviewVerdictkeepsrequires_humanwhen a finding is recorded, and still rewrites without one.Results:
go test ./pkg/review/... ./pkg/stageengine/... ./pkg/stagelabels/... ./pkg/github/... ./pkg/dashboard/... ./cmd/hive/...passes;go vetis clean.Normalizeguard, the stage-normalizer guard and the baredecision_finding; ignored tightening andescalate; let any verdict count; let out-of-scope findings count; and ignoredsecurity.sensitive_paths.Docs and changelog
src/docs/review-swarm.md: a paragraph under the risk-class table.changelog.d/fixed-self-authored-sensitive-path-ask.md.Related: #15744, #15748, #13020, #13068, #15640, #12894.
π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1