Repository navigation
π fix: decidePR answers capability-gap, not adopt-supersede, for heads the App cannot adopt - #15208
π fix: decidePR answers capability-gap, not adopt-supersede, for heads the App cannot adopt#15208hivecommons-hive[bot] wants to merge 5 commits into
Conversation
|
[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
|
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
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: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
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:
-
Files are now listed twice per delegated PR decision.
gatherDelegatedPRContextfetches the full paginated list viagithub.ListPRChangedFiles(src/pkg/dashboard/delegated_pr_context.go:95-103), and the caller then callsapi.PullRequests.ListFilesagain, single page, to computeLowRiskPaths(src/pkg/dashboard/api_repo_item_decide_delegated.go:610-618). The second call could iteratein.ChangedFilesinstead. Worth noting that the first call is a hard failure for every PR decision (the body says fail-closed is intended, andListPRChangedFilesalso returnsErrIncompletePRFileListwhenchanged_filesexceeds the listed count,src/pkg/github/human_merge_paths.go:63-65), whereas the old single-page call was soft. -
workflowPathParkSlugduplicates an existing constant."adoption-stalled:contributor-lane:workflow-path"(policy.go:326) is already composed asadoptionWorkflowRefusedReasonatsrc/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 thestrings.Containscheck, but sinceChangedFilesis 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
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>
23308d2 to
10684c2
Compare
|
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: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
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 aboveadopt-now(v5policy.go:463) and gated onin.AdoptionGraceElapsed || (!in.ContributorOnline && (β¦)), so a.github/workflows/head whose grace already elapsed also lands oncapability-gapinstead of a doomedadopt-supersede.policy_test.gocovers 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 matchesadoption-stalled:contributor-lane:workflow-pathinin.Reasons, whichgatherDelegatedInputalready 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:ChangedFilescomes from the paginatedgithub.ListPRChangedFiles(src/pkg/github/human_merge_paths.go:38) and the gather fails closed on error β safer than the existing one-pageListFilesatapi_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
β¦ark to hold Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
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: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
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 ( How to release it:
Clear the cause and the hive re-evaluates on its next pass; the stage moves to |
A head that edits
.github/workflows/cannot be adopted because the App lacks theworkflowspermission, so adopt-supersede is doomed before it is recorded. decidePR now returns the existingcapability-gaprecommend-only rule when the PR changes a path under.github/workflows/or the row is parked onadoption-stalled:contributor-lane:workflow-path.Input.ChangedFilesis filled ingatherDelegatedPRContextfrom 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