Skip to content

πŸ› fix(delegate): adopted-fixer only when the hive can push the adopted branch - #16820

Merged
hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adopted-fixer-pushability
Nov 5, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
hivecommons:v6from
Danathar:fix/adopted-fixer-pushability

Conversation

@Danathar

@Danathar Danathar commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Executive summary

The delegated adopted-fixer decision ("hive's fixer: … then it merges") fired on adopted PRs whose branch the hive cannot push. The dashboard then showed them as "the hive is fixing it" for days while nothing could land:

This PR checks push-ability before adopted-fixer. If the hive cannot push and the author is connected, the fix list goes back to the author. Otherwise the park stays with the person who asked (adopted-push-refused), and no /hive decision is posted for the fixer. An answer already recorded on such a head now reads as your turn, with the reason, instead of "the hive is fixing it".

What

Adopted PR Author relay Before After
Same-repo branch, or fork with maintainer edits and no workflow diff any adopted-fixer adopted-fixer (unchanged)
Fork-rehome-refused on the head (utah#919) offline adopted-fixer, then a contradiction adopted-push-refused: recommend-only, park kept
Fork changing .github/workflows/ (testsuite#1037) offline adopted-fixer adopted-push-refused
Fork without maintainer edits offline adopted-fixer adopted-push-refused
Any of the three above connected adopted-fixer return-to-contributor with the fix list
Answer recorded on an adopted head the hive cannot push β€” Not yours: "the hive is fixing it" Yours β€” DECIDE (adopted_push_refused), names why

The hive "cannot push" an adopted branch when any of these holds:

  • fork-rehome-refused is recorded on the head;
  • the fork does not allow maintainer edits;
  • the fork's diff changes .github/workflows/;
  • the adoption escalated on this head for workflow-path or fork-rehome-refused;
  • the blocker ledger holds a capability blocker for the item (the fixer's <!-- hive:blocker kind=capability:… --> report).

An adoption escalated for a check failure still counts as pushable.

Why

  • decideAdoptedByHive (delegatedecision/policy.go) routed every adopted PR's finding to the hive's fixer and never asked whether the fixer could push. The stage store already records fork-rehome-refused per head, and the PR payload carries maintainer_can_modify and the head repo.
  • reviewHoldOwnership treats a person's answer on the head as "the hive is fixing it" until the head moves. On a branch the hive cannot push, the head never moves.
  • On utah#919 the adopted-fixer /hive decision was then read by the un-park sweep as a direction for the author's hive (changes requested). That produced the "returned to the contributor" reply four seconds later, with no nudge, label or push.

How

  • delegatedecision:
    • Input.AdoptedPushRefused names why the branch can't be pushed.
    • decideAdoptedByHive calls decideAdoptedPushRefused when it is set: return-to-contributor if the author is connected or picked the rework up, else recommend-only adopted-push-refused.
    • A glossary entry is added.
  • dashboard/adopted_push.go:
    • adoptedPushFacts.refusal() is the one rule.
    • recordedAdoptedPush reads the stage store (fork-rehome-refused, escalation reason) and the blocker ledger.
    • adoptedPushRefusalFor(org) is the ownership check. It applies only to a PR the hive took on at its head; on any other fork PR the author's agent is the one fixing.
  • Gather: for an adopted PR, the head repo and maintainer_can_modify come from the PR GET, and the workflow-file diff from the file listing already read.
  • Plan text: "Have hive's fixer …" is shown only for adopted-fixer.
  • Ownership: an answered review hold on such a PR is your turn (adopted_push_refused, verb DECIDE). The reason code has advisor wording.

Files

File Change
src/pkg/delegatedecision/policy.go, decision_glossary.go AdoptedPushRefused, decideAdoptedPushRefused, rule
src/pkg/dashboard/adopted_push.go (new) Push-ability rule, recorded facts, ownership check
src/pkg/dashboard/api_repo_item_decide_delegated.go, …_plan.go Gather the facts; plan wording only for adopted-fixer
src/pkg/dashboard/ownership.go, ownership_review_holds.go Answered hold on an unpushable adopted branch is your turn
src/pkg/hiveadvisor/human_gate.go Wording for adopted_push_refused
src/pkg/dashboard/static-src/js/tracker-filter-fetch.js, static/index.html Glossary mirror entry; regenerated
src/docs/dashboard.md, …/glossary-and-operations.md, changelog Documented

Tests

Test Covers
TestDecideAdoptedPushability push-ability Γ— author relay β†’ adopted-fixer / return-to-contributor / adopted-push-refused
TestAdoptedPushRefusal fork Γ— maintainer edits Γ— workflow diff Γ— rehome Γ— escalation Γ— capability blocker
TestRecordedAdoptedPush, TestAdoptedPushRefusalForOwnership store and ledger reads; a new head re-arms; short repo names; never-adopted forks untouched
TestDelegatedAdoptedForkRehomeRefusedStaysWithPerson (e2e) same-repo, fork, fork-rehome-refused, fork without edits; no /hive decision when refused
TestAnsweredReviewOnUnpushableAdoptedBranchStaysYourTurn answered hold: waiting on the hive vs your turn with the reason
Mutants 15/15 caught
go test delegatedecision, hiveadvisor, writeback, stagelabels, dashboard (+webstatic); node --test 332; make dashboard-gen-check pass
check-docs-citations.py src/docs 2006 verified

Notes

  • Overlap: the sibling PRs for band classification and stage-label state touch ownership and band code in other places. This one changes only the answered-review-hold branch of reviewHoldOwnership and adds one reason code. The reason-code count in TestOwnershipFixedSets11565 goes from 31 to 32, so whichever merges second may need that count bumped.
  • Live testsuite#1037: as listed, it carries no workflow-file signal for ownership, which has no file list. On the dashboard it turns your-turn through the capability blocker recorded from the fixer's 11-03 report (<!-- hive:blocker kind=capability:workflows-permission -->). The delegate sees the workflow diff directly.
  • Interaction with πŸ› fix(workflows): verify "the App cannot push workflows" before parking on itΒ #16811: that PR stops recording a workflows capability blocker when the App installation grants workflows: write and a capable lane serves the repo. That is right for same-repo branches, but a fork push of workflow changes is refused regardless. If πŸ› fix(workflows): verify "the App cannot push workflows" before parking on itΒ #16811 merges as is, testsuite#1037's dashboard row would lose that signal, though the delegate's fork-plus-workflow-diff check still holds.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…d branch

projectbluefin/utah#919 (fork-rehome-refused on its head) and
projectbluefin/testsuite#1037 (a fork changing .github/workflows/e2e.yml;
the fixer's pushes were refused three times) were decided "hive's fixer: …
then it merges" and read "the hive is fixing it" for days.

- delegatedecision: Input.AdoptedPushRefused; a connected author gets the
  fix list back (return-to-contributor), otherwise recommend-only
  adopted-push-refused keeps the park with the person who asked.
- dashboard: adoptedPushFacts (fork without maintainer edits, fork with a
  workflow-file diff, fork-rehome-refused or workflow-path escalation on the
  head, capability blocker); gathered for the delegate; ownership keeps an
  answered review on such an adopted head your turn (adopted_push_refused).
- glossary (Go + SPA mirror), advisor wording, docs, changelog.

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 Nov 5, 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 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.

PR Title Relation Files
#16824 πŸ› fix(dashboard): hold_reason names only what holds a PR; drafts land in the Draft band same files src/pkg/dashboard/static/index.html
#16807 πŸ› fix: route workflow blockers to capable lanes same files src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/api_repo_item_decide_delegated_plan.go
src/pkg/dashboard/static/index.html
#16688 🌱 Forward-merge v5 into v6 (2 commits) same files src/pkg/dashboard/static/index.html

@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 against v6 and the callers it leans on; this looks correct to me.

What I verified

  • adopted_push.go:69-83 reads Record.ForkRehomeRefused(head) / AdoptionEscalated(head) / AdoptionLive(head) β€” all exist at pkg/stagelabels/store.go:1433,1503,1525 and are head-bound, so a refusal recorded on an older head does not leak onto a new push. f.Adopted gates the whole check (adopted_push.go:100-103), so non-adopted PRs are untouched.
  • Ordering in gatherDelegatedInput: gatherDelegatedRecordedPark (api_repo_item_decide_delegated.go:687) sets in.AdoptedByHive before the new block at :739-743 reads it, and in.WorkflowPath is populated at :696/:728 before push.WorkflowPath = in.WorkflowPath. Good.
  • delegatedPlanWording now requires d.Rule == RuleAdoptedFixer (api_repo_item_decide_delegated_plan.go:335), so the new return-to-contributor decision from decideAdoptedPushRefused (policy.go:857-875) falls through to the normal contributor wording instead of being labelled as the hive's own fixer's. That is the right fix for the utah#919 contradiction.
  • refusal() fork rule (adopted_push.go:54) is the same predicate as the existing ReachableAction at pkg/github/client.go:3825, so the dashboard and the repair queue agree on what "cannot push" means.
  • go build ./pkg/dashboard/ ./pkg/delegatedecision/ ./pkg/hiveadvisor/ is clean at c88a2ff; CI is green apart from tide pending.

One open question, not a defect β€” on the ownership (listing) path adoptedPushRefusalFor reads pr.MaintainerCanModify from the review-queue listing (adopted_push.go:98). If a listed, adopted fork PR arrives before enrich has filled that field from PullRequests.Get (client.go:2817), the row would read adopted_push_refused ("the fork does not allow edits by maintainers") for one pass. ReachableAction already has the same dependency, so this is not new, but worth knowing if a row flickers.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 6bb64a4 into hivecommons:v6 Nov 5, 2026
74 of 77 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#16820c88a2ff` sha256:1cd23167e9aa609537c252ba64be9a93ff5e8ec05a3d50090319cead2d270c8e β€” download from the dashboard or `hivectl review evidence #16820`.

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