Skip to content

πŸ› fix: decidePR answers capability-gap, not adopt-supersede, for heads the App cannot adopt - #15208

Closed
hivecommons-hive[bot] wants to merge 5 commits into
v5from
scanner/fix-15203
Closed

hivecommons-hive[bot] wants to merge 5 commits into
v5from
scanner/fix-15203

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

A head that edits .github/workflows/ cannot be adopted because the App lacks the workflows permission, so adopt-supersede is doomed before it is recorded. decidePR now returns the existing capability-gap recommend-only rule when the PR changes a path under .github/workflows/ or the row is parked on adoption-stalled:contributor-lane:workflow-path. Input.ChangedFiles is filled in gatherDelegatedPRContext from the complete PR file list (failing closed if incomplete).

Closes #15203
Part of #15188 (child (b); (c) is #15204 and (a)+(d) is #15205, sequenced after #15134)

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@clubanderson

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 29, 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2026
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

This PR conflicts with v5 itself. Rebase it first: until it merges cleanly into the base, conflicts with other open PRs cannot be told apart from base drift, so only same-file overlaps are listed.

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

PR Title Relation Files
#15253 πŸ› decision toast: issue decisions no longer read as 'approved for merge' same files src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
#15134 πŸ› Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
#15223 ✨ Soak countdown on every soak pill, with the live timer on hover same files src/pkg/dashboard/static/index.html
#15241 πŸ› tracker: keep a closed linked issue as the row head instead of promoting the PR same files src/pkg/dashboard/static/index.html
#15256 πŸ› clanker PRs with a human changes-requested review show Returned to contributor, not Sentinel alert same files src/pkg/dashboard/static/index.html
#15251 πŸ› tracker: show Merging in the merge gate for at least the toast lifetime before βœ“ same files src/pkg/dashboard/static/index.html
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/pkg/dashboard/api_repo_item_decision_test.go
src/pkg/dashboard/static/index.html
#15219 πŸ› fix: preserve human and owner PRs during delegated decisions same files src/pkg/dashboard/api_repo_item_decision_test.go
src/pkg/dashboard/delegated_pr_context.go
src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
src/pkg/delegatedecision/policy.go
#15122 πŸ› Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/pkg/dashboard/static/index.html
#15186 πŸ› Activity Monitor: one coherent post-decision state for Let hive decide rows; 060 reviewed in CI / Review same files src/pkg/dashboard/api_repo_item_decision_test.go
src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
#15249 ✨ dashboard: merged ledger rolls like an odometer and the rising glyph eases slower same files src/pkg/dashboard/static/index.html
#15240 πŸ› Never adopt a person's PR: owner/human-authored PRs return to their author instead of the contributor-offline lane same files src/pkg/dashboard/delegated_pr_context.go
src/pkg/dashboard/static/index.html
src/pkg/delegatedecision/decision_glossary.go
src/pkg/delegatedecision/policy.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: pushed test repairs (decision mock now serves pulls/N/files; capability-gap cases expect keeps_park=true). CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: cd2f07065

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@kubestellar-prow kubestellar-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 29, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks correct to me. Read decidePR in full at 54fbcbf: the only branch that emits ActionAdoptSupersede is contributor-offline (src/pkg/delegatedecision/policy.go:475-485), and the new capability-gap fence is placed immediately before it with the identical predicate plus WorkflowPath(), so no other path can still queue an adoption for a workflow-editing head. The three new table cases in policy_test.go cover the file-path match, the park-reason match, and the non-workflow control.

Two low-severity notes, neither blocking:

  1. Files are now listed twice per delegated PR decision. gatherDelegatedPRContext fetches the full paginated list via github.ListPRChangedFiles (src/pkg/dashboard/delegated_pr_context.go:95-103), and the caller then calls api.PullRequests.ListFiles again, single page, to compute LowRiskPaths (src/pkg/dashboard/api_repo_item_decide_delegated.go:610-618). The second call could iterate in.ChangedFiles instead. Worth noting that the first call is a hard failure for every PR decision (the body says fail-closed is intended, and ListPRChangedFiles also returns ErrIncompletePRFileList when changed_files exceeds the listed count, src/pkg/github/human_merge_paths.go:63-65), whereas the old single-page call was soft.

  2. workflowPathParkSlug duplicates an existing constant. "adoption-stalled:contributor-lane:workflow-path" (policy.go:326) is already composed as adoptionWorkflowRefusedReason at src/pkg/github/automerge/automerge_contributor_adopt.go:135. The lane's raw reason without the prefix (contributor-lane:workflow-path, stagelabels/human.go:149) would not match the strings.Contains check, but since ChangedFiles is now always populated, the path check catches that case anyway.

Not a duplicate of #15134 (checked both diffs): that PR adds an issue-level blocker package and a GlossaryBlocker reason; the only shared file is decision_glossary.go and the hunks are in different regions (line 92 here vs. lines 68/168/235 there), so they merge cleanly in either order.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot removed the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label Oct 29, 2026
hivecommons-hive Bot and others added 3 commits October 28, 2026 22:05
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
…s the park

The delegated-decision fake GitHub had no files route, so the fail-closed
file read 404'd every dashboard decision test. The two new policy cases
expected KeepsPark=false, but a recommend-only verdict keeps the park by
design.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
TestStageTrackerDecisionGlossaryMirrorsGo requires STAGE_TRACKER_DECISION_GLOSSARY
to match pkg/delegatedecision.GlossaryJSON byte-for-byte; the Go detail gained
the workflow-path clause without its JS twin.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Rebased onto v5 after #15038 landed (adopt-now rule); the capability-gap guard now sits ahead of adopt-now so a workflow-path head is never adopted even after grace elapses, with a test for that case. hive/awaiting-ci: CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 10684c267

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 29, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 29, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Conclusion: the policy change reads correct to me against current v5; the one thing a maintainer needs to know is that it collides with #15206's version of the same rule.

What I verified

  • src/pkg/delegatedecision/policy.go (this diff): the new rule is placed above adopt-now (v5 policy.go:463) and gated on in.AdoptionGraceElapsed || (!in.ContributorOnline && (…)), so a .github/workflows/ head whose grace already elapsed also lands on capability-gap instead of a doomed adopt-supersede. policy_test.go covers that branch explicitly ("grace-elapsed workflow-path PR gets capability-gap, not adopt-now") plus the park-slug path and the non-workflow control case.
  • Input.WorkflowPath() also matches adoption-stalled:contributor-lane:workflow-path in in.Reasons, which gatherDelegatedInput already populates from the park reason and reviewer comment (api_repo_item_decide_delegated.go:564-567), so rows parked by the fence without a file list still route correctly.
  • delegated_pr_context.go: ChangedFiles comes from the paginated github.ListPRChangedFiles (src/pkg/github/human_merge_paths.go:38) and the gather fails closed on error β€” safer than the existing one-page ListFiles at api_repo_item_decide_delegated.go:610.

Overlap with #15206 (same issue, #15188). #15206 adds a field Input.WorkflowPath bool and its own capability-gap rule below adopt-now; this PR adds a method Input.WorkflowPath(). Go rejects a struct with a field and method of the same name, so whichever merges second breaks the build. This version is the more complete of the two for the policy rule (grace-elapsed branch, full file list). I have left a note on #15206 suggesting it rebase onto this and drop its policy hunk, keeping its ledger/journal work that this PR does not cover. Not a defect in this PR; flagging so the merge order is deliberate.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
…ark to hold

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: fixed the grace-elapsed workflow-path test case (it omitted keepsPark: true that every other capability-gap case asserts). CI pending β€” sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 4aeb389

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 29, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 29, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Needs a decision, not a merge:

Head: verdict requires_human @4aeb389, 39/60 checks green, 21 pending, DCO yes, soak 0s of 30m0s.

What to do: approve this head (4aeb389) to merge as-is, or leave a changes requested review (or reply /hive decision <what to change>) and the hive will push the fix.

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.

@clubanderson

Copy link
Copy Markdown
Member

Superseded by #15206 (merged, closed #15188) which folded in this PR's !ContributorOnline gate. Closing as redundant.

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files. stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] decidePR: workflow-path PRs get the capability-gap rule, not a doomed adopt-supersede

1 participant