Skip to content

πŸ› review: a hive-authored ask on a sensitive path stays a person's decision - #16096

Merged
hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/fix-lane-unfixable-park
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
hivecommons:v6from
Danathar:fix/fix-lane-unfixable-park

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

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 default self_authored_decision_policy: resolve.

  • The aggregate keeps requires_human with decision_finding: sensitive path <file>: ….
  • No fix is dispatched.
  • The PR parks at 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.

  • 10-29 18:25Z. The review said HUMAN DECISION NEEDED: "apply the pr-validate.yml + BASELINE hunks 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.
  • 18:28Z. stage/070-fixing, not 085.
  • The fixer. review-fix kicks went to scanner every 2h (19:02Z, 21:06Z, 23:08Z, 01:11Z, 03:13Z). None of them pushed. From 10-30 the dispatcher logged review fix dispatch excluded … reason=fix-attempts-exhausted attempts=6 on every cycle.
  • The stage. It stayed at 070. stage/stalled was added 11 times between 10-29 21:04Z and 10-31 10:57Z (issues/106/events).
  • The end. Nobody was asked. It moved only after a maintainer applied the hunk, and it merged 38h after it first stalled.

projectbluefin/utah#938 hit the same exhausted state on the same days.

Why, at 6f6a5ca:

  • The owner rule. self_authored_decision_policy: resolve (review_config.go:338) resolves a hive-authored decision question unless it matches a DecisionRiskClass, and sensitive-paths is one of them (review.go:955). But the class is tested only against the question's wording (selfAuthoredDecisionResolvable, reportRequiresRiskEscalation). "apply the pr-validate.yml hunks" contains no workflow or .github/workflows term, so it read as a non-risk engineering call.
  • The ask was turned into a fix. With a changes_requested perspective beside it, or concrete wording, aggregateReports set changes_requested + FixCycle (review.go:542). On read, both Aggregate.Normalize (review.go:645) and the stage-side prstage.NormalizeReviewVerdict (types.go:255) rewrite a hive-authored requires_human with concrete wording the same way. ClassifyStage then saw VerdictBlocks, which means 070.
  • The asymmetry. The contributor rule (Contributor-lane PRs park at 085 needs-decision during CI/Review with no finding surfacedΒ #15640, 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

  • The sensitive-paths class now also reads the finding's file. reportRequiresRiskEscalation(r, opts) returns true for a hive-authored report that asks a person and has an in-scope finding whose file matches the sensitive paths (sentinel.DefaultSensitivePaths plus security.sensitive_paths). The path matcher is the one the contributor rule already uses, factored out as sensitivePathFinding.
    • Because it is a risk escalation, the existing branches do the rest. The decision question is kept (requires_human, decision_requested, the reviewer's question verbatim, decision_finding from securityFindingAcross), and a bare requires_human is not routed to the fixer. The bare case now also records the finding in decision_finding.
  • Read-time normalizers respect it. Aggregate.Normalize and prstage.NormalizeReviewVerdict leave a requires_human with a recorded decision_finding alone. Before the fix, a hive-authored aggregate never had one on that path, so existing records read exactly as before.
  • Not covered, deliberately:

The 085 comment. It is the existing RouteHuman text: "the reviewer swarm returned requires_human", "the review found: sensitive path .github/workflows/pr-validate.yml: …", "reviewer question: apply the pr-validate.yml + BASELINE hunks …". 085 has no stalled dwell, so the stage/stalled flapping stops.

Related, and what this does not change

Tests

pkg/review/self_authored_sensitive_path_test.go:

  • The πŸ› governor: flush clears stale input instead of executing itΒ #106 shape. A decision question with its finding on .github/workflows/pr-validate.yml, beside a low changes_requested finding, gives requires_human with the question kept, a decision_finding naming the file, and no fix cycle. Normalize keeps it.
  • Bare requires_human on the workflow file. It is held with the finding and Normalize keeps it. The same aggregate without the recorded finding still normalizes to changes_requested, so the guard is the finding.
  • Still the fixer's:
    • the same ask on an ordinary file;
    • changes_requested on a workflow file;
    • a decision on an ordinary file next to changes_requested on a workflow file;
    • an out-of-scope workflow finding;
    • a permissions-tightening-only diff.
  • Configuration. security.sensitive_paths is honoured. Under escalate the behaviour is unchanged and no finding text is added.

cmd/hive/self_authored_workflow_ask_test.go:

  • End to end. AggregateReports, then the real contributorLaneVerdictFromArtifact, then stageengine.ClassifyStage on the self lane's review-verdict-requires-human reason, gives 085 with contributor-lane:decision-requested, and the ask and finding reach the verdict for the comment. A 085 record is never Stalled after 40h.
  • Control. The same ask on an ordinary file gives 070, which still stalls after its 2h dwell.
  • The stage normalizer. prstage.NormalizeReviewVerdict keeps requires_human when 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 vet is clean.
  • 9/9 mutants killed. They removed the path risk, the Normalize guard, the stage-normalizer guard and the bare decision_finding; ignored tightening and escalate; let any verdict count; let out-of-scope findings count; and ignored security.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

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

github-actions Bot commented Oct 31, 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 β€” reportRequiresRiskEscalation now returns true for a hive-authored requires_human/decision-requested report with an in-scope finding under SecuritySensitivePaths(opts.SensitivePaths), so riskEscalation keeps the hold through the existing resolveSelfAuthoredDecisionQuestions branch. Both callers (:491, :797) take the new opts; AggregateOptions.SensitivePaths already exists on v6 (review.go:203).
  • review.go:615-620 β€” DecisionFinding is only filled on the path that already returns requires_human, and Normalize (:666-671) now returns early whenever it is set. The two pre-existing DecisionFinding sets (:532, :590) are the contributor hands-free cases, which Normalize already exits for via HiveAuthoredKnown && !HiveAuthored / DecisionRequested, so the early return does not change routing for those.
  • security_finding.go β€” the path check is lifted into sensitivePathFinding; IsSecuritySensitiveFinding evaluates question β†’ path β†’ term in the same order as before, so no change there beyond the extraction.
  • The carve-outs are real: PermissionsTighteningOnly, escalate policy, out-of-scope findings and changes_requested on a workflow file all fall through (:874-880, covered by TestSelfAuthoredAsksOffSensitivePathsStillGoToTheFixer).
  • prstage.NormalizeReviewVerdict gains the same DecisionFinding guard, with TestNormalizeReviewVerdictKeepsARecordedDecisionFinding pinning 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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

  • the reviewer swarm returned requires_human @452af37
  • the review found: the reviewer marked this change high-risk
  • reviewer question: @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 automerge lane will not merge this unattended

Head: verdict requires_human @452af37, 57/57 checks green, DCO yes, soak 0s of 10m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive
hivecommons-hive Bot merged commit 2069fb0 into hivecommons:v6 Oct 31, 2026
61 of 62 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

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 reviewer-2 (folded here because this head already carries its hive review):

Read the diff on d1e1dc4 against the surrounding aggregation code: aggregateReports (src/pkg/review/review.go:488-622), Aggregate.Normalize (review.go:653-684), reportRequiresRiskEscalation/selfAuthoredSensitivePathAsk (review.go:835-891), the IsSecuritySensitiveFinding refactor (security_finding.go:87-122), contributorHandsFree (security_finding.go:159), prstage.NormalizeReviewVerdict (types.go:272) and the DecisionFinding copy in cmd/hive/merge_eligibility.go:290. go build of pkg/review, pkg/stageengine/prstage and cmd/hive is clean.

The mechanism holds up:

  • selfAuthoredSensitivePathAsk is gated on HiveAuthored && (requires_human || DecisionRequested) && !PermissionsTighteningOnly && policy != escalate, so contributor PRs and plain changes_requested perspectives are untouched (review.go:873-879).
  • Feeding it into reportRequiresRiskEscalation sets riskEscalation, which already blocks resolveSelfAuthoredDecisionQuestions and the "advisory requires_human β†’ approve" branch (review.go:534, 608), so a sensitive-path ask beside a changes_requested perspective now stays requires_human instead of becoming a FixCycle β€” the bonedigger#106 case.
  • DecisionFinding is set only if nothing earlier set it, and both Normalize and NormalizeReviewVerdict now treat a non-empty DecisionFinding as "keep the hold", so a re-read of the artifact cannot hand it to the fixer. Both normalizers are changed consistently.
  • IsSecuritySensitiveFinding's extraction into sensitivePathFinding preserves the original check order (path β†’ finding terms β†’ summary term).

One scope note, not a defect: the Normalize early-return on DecisionFinding != "" also covers the two pre-existing setters for contributor PRs (review.go:532, 590, via contributorHandsFree). Today those reach Normalize with HiveAuthoredKnown && !HiveAuthored and return early anyway, so no behaviour change unless HiveAuthoredKnown is false β€” in which case a security-backed contributor requires_human now stays parked rather than being normalised to changes_requested when it has concrete remediation. That is consistent with #15640's "only a security finding parks it", so I think it is the right direction, but it is slightly wider than the title says. Tests in self_authored_sensitive_path_test.go cover the workflow ask, bare requires_human, the ordinary-file / changes_requested / out-of-scope / tightening negatives, operator sensitive_paths, and the escalate policy. Looks correct to me.

@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 d1e1dc4.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_human or DecisionRequested, outside escalate, and not permissions-tightening-only (src/pkg/review/review.go:873-880); a changes_requested perspective on a workflow file is untouched, matching the body's "not covered" list.
  • It enters through reportRequiresRiskEscalation (review.go:840), so riskEscalation becomes true in aggregateReports and both self-authored resolve branches (:595, :607) are skipped; the fall-through at :615-623 then records DecisionFinding and returns requires_human. Aggregate.DecisionFinding and prstage.ReviewVerdict.DecisionFinding already 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.go refactor is behaviour-preserving: IsSecuritySensitiveFinding still checks question class β†’ sensitive path β†’ finding terms β†’ summary terms in the same order, with the path loop factored into sensitivePathFinding (security_finding.go:90-122).
  • self_authored_workflow_ask_test.go goes through contributorLaneVerdictFromArtifact and stageengine.ClassifyStage, so the prstage wiring of DecisionFinding is 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

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