Skip to content

πŸ› Activity Monitor: Ready for human merge offers Approve & merge / let hive merge; every needs-human state has its action - #15087

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
fix/ready-for-human-merge-actions
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
fix/ready-for-human-merge-actions

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15078

Observed

hivecommons/hotshot#316 β†’ nested PR hotshot#317 sat in the Merge gate as Ready for human merge Β· untrusted author πŸ‘€ (stage/090-ready-for-human-merge). The issue row's β‹― menu offered only Hold / Re-evaluate now / Mark needs-human… / Open on GitHub / Copy link β€” "this claims it needs human merge but there is no option to take that action".

Why #317 is "untrusted author" (verified from hive's hive config + live tracker payload)

The PR author is @Karibhou (a human, author/clanker, registry tier newcomer), not the hive App. The row's reason is contributor-lane:author-association β†’ human_merge_reason: untrusted-author: Karibhou has no OWNER/MEMBER/COLLABORATOR association on hotshot and no trusted/merger tier (auto_merge.contributor_lane.require_tiers default [trusted, merger]), and is not under dashboard.authorized_users, so neither the contributor lane nor the trusted-authors lane vouches for the PR. Fix: πŸ‘₯ Contributors tier select, GitHub collaborator, or Authorized users with merger role (βš™ Security). The pill tooltip now says exactly this.

Changes

Backend (Go)

  • decision_needed for a PR at 090 leads with Approve & merge as maintainer (decide:merge-now, consequence merges #N into main now via hive's identity, attributed to you) and Approve β€” let hive merge (decide:queue-merge, records your approval; the merge sweep merges on its next pass once CI is green and the head has soaked), then Give direction / Close as superseded / Close as won't fix / Hold. New Consequence field on options.
  • POST /api/repos/{o}/{r}/items/{n}/decision accepts merge-now and queue-merge (PRs only; verified owner or merger role; refuses merged/closed PRs and your own PR). merge-now comments then merges via MergePRVia(..., PRAuditPathDashboard); queue-merge uses QueuePRAutoMergeWithNote. Audited as repo_item_decision_merge / repo_item_decision_queue_merge; ledger last_operator_action.action merge-now / queue-merge; result merged / queued-for-merge.
  • Audit of every stageTrackerNeedsHuman state: needs-human label β†’ Resolve β€” lift needs-human; hive:unauthorized β†’ Re-evaluate now; human-authored PR at 071/072 β†’ close options; any other flagged stage β†’ parked fallback (Re-evaluate / Hold / Mark needs-human). Hold set by operator keeps Release hold leading with the state's own options disabled with Release the hold first. 085 / 045 / 015 / reporter-trust hold unchanged (built on πŸ› Activity Monitor: PR-scoped row actions on nested PRs; Let hive decide per PR, never silently oneΒ #15056, ✨ Activity monitor: decision badge shows what you chose and what hive did nextΒ #14992, πŸ› fix(stage): a contributor PR with no linked issue is not waiting on the hiveΒ #15020's work).
  • Table test TestStageTrackerNeedsHumanStatesCarryAnAction: every stage/modifier the tracker flags needs-human yields non-empty options with an enabled action or a plain-words reason_if_disabled. Plus TestStageTrackerDecisionForHumanMerge, handler tests for merge-now / queue-merge / guards, operator-action mapping cases.
  • "Untrusted author" tooltip per reason code (stageTrackerUntrustedAuthorWhy): why + config key + where in βš™/πŸ‘₯.

SPA (dashboardSetInterval only, [hidden], style ratchet respected)

  • β‹― menu (stageTrackerRowActions) leads with the server's decide:* options above a separator, consequence as hint; works for issue rows with one nested PR (targets the PR) and PR sub-rows via runRowAction(action, row).
  • Needs-human popover shows consequence lines; merge actions greyed with a role reason for non-mergers.
  • Confirm dialogs (danger for merge-now, naming the base branch) with Don't ask again; acting captions Merging… / Queuing for merge…; toast words; decision badge labels.
  • Renderer test TestStageTrackerRowActionsLeadWithDecisionOptions (node fixture via stdin).

Docs: dashboard-sections.md (row actions per state table + untrusted-author wording), operator-reference.md (merge-now / queue-merge table), changelog.d/fixed-ready-for-human-merge-actions.md.

What hotshot#317's issue row β‹― menu now shows

Approve & merge as maintainer Β· Approve β€” let hive merge Β· ─ Β· Decide PR #317… (Let hive decide / Approve / Close as superseded by… / Won't fix… / Give direction β€” disabled: human author) Β· Hold Β· Re-evaluate now Β· Mark needs-human… Β· Open on GitHub Β· Copy link

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

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

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
#15122 πŸ› Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/docs/operator-reference.md
src/pkg/dashboard/static/index.html
#15118 πŸ› fix: open the needs-human popover on issue rows with a parked PR same files src/pkg/dashboard/stage_tracker_decision_popover_test.go
src/pkg/dashboard/static/index.html
#15085 ✨ Activity Monitor: Adopt now and Reroute to another clanker for PRs waiting on a contributor's clanker CONFLICT src/pkg/dashboard/api_repo_item_decision.go
src/pkg/dashboard/operator_actions.go
src/pkg/dashboard/operator_actions_test.go
src/pkg/dashboard/stage_tracker_decision.go
src/pkg/dashboard/stage_tracker_row_actions_test.go
src/pkg/dashboard/static/index.html
#15104 πŸ› Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested CONFLICT changelog.d/fixed-ready-for-human-merge-actions.md
src/docs/dashboard-sections.md
src/docs/operator-reference.md
src/pkg/dashboard/api_repo_item_decision.go
src/pkg/dashboard/stage_tracker_decision.go
src/pkg/dashboard/stage_tracker_decision_test.go
src/pkg/dashboard/stage_tracker_row_actions_test.go
src/pkg/dashboard/static/index.html
#15074 πŸ› Activity Monitor: server-derived stage actor icons, one row per PR, Merged-today counter above the gate same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15070 ✨ Activity Monitor: presence indicator (clanker online / offline / none) on the waiting-on pill same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#15069 πŸ› fix: record pending operator action before starting delegated job same files src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/api_repo_item_decide_delegated_test.go
src/pkg/dashboard/operator_actions.go
src/pkg/dashboard/operator_actions_test.go

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

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves 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 28, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the branch conflicts with the base and needs a rebase

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

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

Style / conventions review (read at head 38b57b5)

1. The merge-now note posted to the PR asserts an "untrusted author" cause for every 090 reason β€” src/pkg/dashboard/api_repo_item_decision.go:467 hardcodes "…parked this pull request for a human because its author is not a trusted merger on this repository", and the SPA confirm at src/pkg/dashboard/static/index.html:17583 says the same. But decisionForHumanMerge (stage_tracker_decision.go) is reached for any PR at 090, and pkg/stageengine/prstage/reasons.go:84-110 lists ten other HumanMergeReason* codes (workflow-files, tests-removed, branch-protection, manual-merge-policy, …). For those PRs the permanent GitHub comment would state a false reason β€” the opposite of the plain-words goal in #15078. Keep the comment reason-neutral (or thread human_merge_reason_text through):

	body := fmt.Sprintf("Merged as maintainer by @%s from the Hive dashboard: the merge gate had parked this pull request at Ready for human merge, so the hive would not merge it unattended.", strings.TrimSpace(user))

and in index.html:17583 drop the clause because its author is not a trusted merger on this repo (or substitute items[0].human_merge_reason_text).

2. repoItemMergeDecisionAllowed (api_repo_item_decision.go:392-398) re-implements requireMergerOrOwnerRole (api_agent_control.go:494), which is the package's existing bar with 8 callers β€” including the very queue-automerge handler the new comment cites (api.go:1346). Reuse it so the two bars cannot drift:

-		if !repoItemMergeDecisionAllowed(r) {
-			jsonError(w, "merger or owner access required to merge or queue a pull request", http.StatusForbidden)
+		if !requireMergerOrOwnerRole(w, r) {
 			return
 		}

and delete repoItemMergeDecisionAllowed (adjust the handler test's expected 403 message if it asserts on it).

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

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

Security perspective (read at head 38b57b5; merge-base b26b481).

1. merge-now / queue-merge skip the "repository is managed by this hive" bar that the sibling queue-automerge endpoint enforces β€” src/pkg/dashboard/api_repo_item_decision.go:371-383 dispatches to handlePullRequestMergeDecision (:396) after only canToggleRepoHold (api_repo_hold.go:74-84, which short-circuits to allow for any verified owner) and the role check (:390-396). handleQueuePRAutoMerge (src/pkg/dashboard/api.go:1369-1372) additionally refuses with prQueueRepoAllowed(repo). Since the route takes {owner}/{repo} from the URL, a verified owner/merger can make the hive App merge (MergePRVia, :449) or approve+label any PR in any repo the App is installed on, not just project.repos. The other decisions in this handler already have that gap, but they comment/close β€” merge-now lands a commit on a base branch under the App's identity, so the new action should carry the same bar:

	case repoItemDecisionMergeNow, repoItemDecisionQueueMerge:
		if itemType != "pr" {
			jsonError(w, decision+" applies to pull requests", http.StatusBadRequest)
			return
		}
		if !repoItemMergeDecisionAllowed(r) {
			jsonError(w, "merger or owner access required to merge or queue a pull request", http.StatusForbidden)
			return
		}
		if !s.prQueueRepoAllowed(repoFull) {
			jsonError(w, "repository is not managed by this hive", http.StatusForbidden)
			return
		}
		s.handlePullRequestMergeDecision(ctx, w, repoFull, number, user, decision, comment)

2. merge-now enforces hold / sentinel only in the UI, not in the handler. stage_tracker_decision.go:254-256 disables the merge options with Release the hold first when held, and :503/:537 tells the operator the hive won't merge while the sentinel label is on β€” but handlePullRequestMergeDecision (api_repo_item_decision.go:396-468) checks only state/merged/self-author and then calls MergePRVia with no label read. queue-merge is covered because QueuePRAutoMergeWithNote refuses the sentinel label (src/pkg/github/client.go:2964-2969) and the sweep honours holds; merge-now has no equivalent, so a direct POST …/decision {"decision":"merge-now"} merges a held or sentinel-flagged PR from an untrusted author in one call. Suggest reading the labels before the merge branch:

 	base := state.BaseRef
 	if base == "" {
 		base = "the base branch"
 	}
+	if decision == repoItemDecisionMergeNow {
+		labels, err := gh.IssueLabels(ctx, repoFull, number)
+		if err != nil {
+			jsonError(w, "reading the pull request labels: "+err.Error(), http.StatusBadGateway)
+			return
+		}
+		if gh.IsHeldLabels(labels) {
+			jsonError(w, "pull request is on hold; release the hold first", http.StatusConflict)
+			return
+		}
+		if sl := s.stageTrackerSentinelLabel(); sl != "" && slices.ContainsFunc(labels, func(l string) bool { return strings.EqualFold(l, sl) }) {
+			jsonError(w, "the security check has an open alert on this pull request; remove `"+sl+"` first", http.StatusConflict)
+			return
+		}
+	}

(use whatever accessor the stage tracker already uses to pass sentinelLabel into stageTrackerDecisionNeeded, stage_tracker_decision.go:141.)

Escaping of the new consequence/hint strings in static/index.html goes through esc() throughout; no injection there. Audit records and expectSHA pinning (:449) look right.

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

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

docs-currency β€” read at head 38b57b5. Two operator-facing text gaps; the rest of the docs match the code (options per state in stage_tracker_decision.go, tooltip text in stage_tracker.go, toast/badge words in index.html).

  1. Merge note on the PR states the wrong reason for non-trust 090 parks. src/pkg/dashboard/api_repo_item_decision.go:467 hardcodes "…because its author is not a trusted merger on this repository", and the SPA confirm at src/pkg/dashboard/static/index.html:17583 says the same. But decisionForHumanMerge (stage_tracker_decision.go:216-220) and your own docs row (dashboard-sections.md:717) cover 090 for workflow files, manual-merge path and branch protection too β€” on those PRs the public comment left on the contributor's repo will assert a falsehood about the author. Make the sentence reason-neutral (the row's reason/human_merge_reason text is already in the payload if you want to name it):
	body := fmt.Sprintf("Merged as maintainer by @%s from the Hive dashboard: the merge gate had parked this pull request for a human to merge.", strings.TrimSpace(user))

and in index.html:17583 drop "because its author is not a trusted merger on this repo" in favour of "The merge gate parked it for a human; this is you taking that call."

  1. Audit key doc does not match what is recorded. src/docs/dashboard-sections.md:717 says "the audit log records repo_item_decision_merge, source: dashboard". The dashboard record at api_repo_item_decision.go:458 carries repo/number/type/head/author/base/sha β€” no source. dashboard is the path of the separate pr_merged record written by RecordPRMergedAudit (src/pkg/github/client.go:4487, via MergePRVia). operator-reference.md:472 already has it right ("audit path dashboard"); align the sections doc:
| PR at 090 *Ready for human merge* (untrusted author, workflow files, manual-merge path, branch protection…) | **Approve & merge as maintainer** (merges #N into *base* now via hive's identity, attributed to you β€” a comment on the PR names you; the audit log records `repo_item_decision_merge` and the App's `pr_merged` with `path: dashboard`) Β· **Approve β€” let hive merge** (records your approval as the owner decision β€” an APPROVE review and the automerge label; the hive's merge sweep merges it on its next pass once CI is green and the head has soaked) Β· Give direction (hive-authored PRs only) Β· Close as superseded Β· Close as won't fix Β· Hold. Both merge actions need the merger or owner role and confirm first (with *Don't ask again*); the toast reads *merged* / *queued for merge*; the badge records `merge-now` / `queue-merge`. |

Minor, same files: dashboard-sections.md:713 dates the quote 2026-10-29 while #15078 says 2026-10-28; operator-reference.md:473 "an APPROVED review in your name" β€” the review is the App's, with Approved by @you in its body (client.go:2974-2993); "attributed to you" is the accurate phrase.

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

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

Correctness (read at 38b57b5)

1. The 090 decision is reason-agnostic, but the two lead options only hold for untrusted-author β€” src/pkg/dashboard/stage_tracker_decision.go:208-258 (decisionForHumanMerge) enables Approve & merge as maintainer and Approve β€” let hive merge for every HumanMergeReason code (stage_tracker.go:1261-1271: workflow-files, tests-removed, manual-merge-policy, branch-protection, merge-method, auto-merge-off, unauthorized, reviewer-deferred), with the same consequence text.

  • queue-merge: the sweep's queued lane re-applies the carried fence and humanMergePathGate (src/pkg/github/automerge/automerge_sweep.go:2545-2552, "a merger queuing the PR is not the same as a person merging it"), so for workflow-files / tests-removed / manual-merge-policy the promise "the hive's merge sweep merges #N on its next pass once CI is green" is false β€” the PR stays parked and the operator's approval goes nowhere, with no feedback in the row.
  • merge-now on workflow-files / unauthorized: the App lacks the permission (that is why the row is at 090), so MergePRVia (pullrequest.go:404) fails and the handler answers 502 (api_repo_item_decision.go:453-456). The option should be disabled with the reason, not offered and failed.
  • merge-now on tests-removed / manual-merge-policy: MergePRVia only runs CheckIrreversible (pullrequest.go:415), so the dashboard now merges through the hive's identity exactly the PRs those policies say the hive never merges. That is a deliberate operator call, but the comment it posts (api_repo_item_decision.go:470) hard-codes "because its author is not a trusted merger", which is wrong for these reasons.

Suggested fix β€” gate by the reason code the function already derives:

 func decisionForHumanMerge(it StageTrackerItem, held bool) *StageTrackerDecision {
 	base, approver := stagelabels.HumanApprovedReason(it.Reason)
 	base = strings.TrimSpace(base)
-	_, word, _ := stageTrackerHumanMergeReason(it.Reason)
+	code, word, _ := stageTrackerHumanMergeReason(it.Reason)
@@
-	mergeNow := decisionOption(decisionActionMergeNow, "Approve & merge as maintainer", !held, "Release the hold first")
+	mergeWhy, queueWhy := "", ""
+	switch code {
+	case stageengineprstage.HumanMergeReasonWorkflowFiles, stageengineprstage.HumanMergeReasonUnauthorized:
+		mergeWhy = "The hive's GitHub App is not permitted to merge this; click Merge on GitHub"
+		queueWhy = mergeWhy
+	case stageengineprstage.HumanMergeReasonTestsRemoved, stageengineprstage.HumanMergeReasonManualMergePolicy,
+		stageengineprstage.HumanMergeReasonAutoMergeOff, stageengineprstage.HumanMergeReasonMergeMethod,
+		stageengineprstage.HumanMergeReasonBranchProtection:
+		queueWhy = "The merge sweep applies the same rule that parked this PR, so queuing it changes nothing; merge now or on GitHub"
+	}
+	if held {
+		mergeWhy, queueWhy = "Release the hold first", "Release the hold first"
+	}
+	mergeNow := decisionOption(decisionActionMergeNow, "Approve & merge as maintainer", mergeWhy == "", mergeWhy)
 	mergeNow.Consequence = "merges " + ref + " into " + into + " now via hive's identity, attributed to you"
-	queue := decisionOption(decisionActionQueueMerge, "Approve β€” let hive merge", !held, "Release the hold first")
+	queue := decisionOption(decisionActionQueueMerge, "Approve β€” let hive merge", queueWhy == "", queueWhy)

and pass word/reason into renderRepoItemDecisionMergeComment instead of the fixed "not a trusted merger" sentence. Add the non-untrusted-author codes to TestStageTrackerNeedsHumanStatesCarryAnAction (today every 090 fixture uses ContributorLaneReasonAuthorAssociation, stage_tracker_decision_test.go:340-342, so the table never exercises the other reasons).

Advisory: tide reports the branch conflicts with v5; needs a rebase before it can land.

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

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

Intent alignment vs #15078 β€” the 090 path (merge-now / queue-merge) is wired end to end, but two of the newly-added "every needs-human state carries an action" states render a lead action that does nothing when clicked.

Lead decide:* options are dropped at dispatch for rows that are not "parked" (071/072 human PR, needs-human outside 045/085/090).
stageTrackerLeadActions builds the menu from decision_needed.options via stageTrackerDecisionOf (static/index.html:16762-16775), but both click paths β€” menu (index.html:16953 β†’ stageTrackerDoAction) and popover (index.html:17147 β†’ stageTrackerDecisionRun β†’ runRowAction) β€” land in runRowAction's decide: branch (index.html:17815-17820), which maps each row through stageTrackerDecisionTarget and drops nulls. stageTrackerDecisionTarget only recognises 045/085, the needs-decision pill, superseded, manual_merge or human_merge_reason (index.html:16673-16693); your own test pins stageTrackerDecisionTarget({stage: 70, modifiers: []}) === null (stage_tracker_row_actions_test.go:239). So:

  • the waiting fixture (human PR at 072, stage_tracker_row_actions_test.go:1050-1057) renders Close as superseded / Close as won't fix at the top, but clicking either returns { toasts: [], pending: [] } silently β€” no request, no toast;
  • the new Resolve β€” lift needs-human (decide:approve, stage_tracker_decision.go:646-653) on a needs-human row at any stage other than 045/085/090 does the same.
    The server side would accept both (RecordOperatorIssueDecision treats needs-human as parked, issue_unpark_command.go:749-759; handlePullRequestDecision passes LiftNeedsHuman: true, api_repo_item_decision.go:506-509), so this is purely the SPA target resolution. TestStageTrackerRowActionsLeadWithDecisionOptions only checks rendering; no runRowAction case covers these states.

Fix: fall back to the asking item when the row itself (or its one asking nested PR) carries the option:

      } else if (id.indexOf('decide:') === 0) {
        // A row decides its parked PR when it has one (the issue's stage is
        // only mirrored from it); dedupe when the PR row is selected too.
        // A row that is not parked but whose decision_needed names the
        // action (071/072 human PR, needs-human at any stage) decides itself
        // (hivecommons/hive#15078).
        const seen = {};
        items = items.map(it => {
          const t = stageTrackerDecisionTarget(it);
          if (t) return t;
          const dec = typeof stageTrackerDecisionOf === 'function' ? stageTrackerDecisionOf(it) : null;
          const opts = dec && dec.item && dec.item.decision_needed && Array.isArray(dec.item.decision_needed.options) ? dec.item.decision_needed.options : [];
          return opts.some(o => o && o.action === id) ? dec.item : null;
        }).filter(t => t && !seen[stageTrackerItemKey(t)] && (seen[stageTrackerItemKey(t)] = true));
        if (!items.length) return { toasts: [], pending: [] };
      }

and add a runRowAction('decide:close-wontfix', waiting) / runRowAction('decide:approve', <needs-human at 060>) case asserting a request is issued, so the renderer test and the dispatch agree.

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

clubanderson added a commit that referenced this pull request Oct 28, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 28, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 28, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
clubanderson added a commit that referenced this pull request Oct 29, 2026
…se-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
hivecommons-hive Bot pushed a commit that referenced this pull request Oct 29, 2026
…ed conflicting PRs; dismiss self-inflicted changes_requested (#15104)

* πŸ› Activity Monitor: Rebase, then merge as maintainer; autonomous rebase-resolve with loop guard; approve on a dirty PR queues the rebase; dismiss self-inflicted changes_requested

Squashed and rebased onto v5 after #15087 and #15074 landed.

Fixes #15103

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* test: fix fixtures after the v5 rebase (mock fields, failingEntry rebase fields, import ratchet, window shim)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* test: lift pkg/rebasemerge coverage above its floor; drop an ineffectual assignment

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* test: compare the shared singletons through named values (staticcheck SA4000)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* security: rebase-then-merge fails closed on a head the hive did not produce; document the new API shapes

The approval is bound to the head the operator read. A contributor PR whose
head moves after the click now counts as rebased only when GitHub reports
the hive (App bot or pane identity) as the commit's author or committer;
any other head settles the follow-through as failed (foreign-head) with
nothing merged, a note on the PR, and 'Approve the new head & merge' as the
way out. api-reference.md gains the 202 rebase-queued answer, the rebase
response field, and the rebase_merge / rebase row fields.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* merge train: hand a dirty member to the fixer's rebase-resolve episode; the exhausted row's rebase-then-merge option goes live

v5 landed the conflict-aware merge train (#15157) with a RebaseResolver hook
reserved for this PR and a duplicate rebaseMergeFollowThroughLabel. The hook
now opens the shared rebase episode (requested_by: merge-train); the
mergeNowWired flag and its disabled reason go, since the option it guarded
is wired here.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* test: approve toast wording follows #15213

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* rebase onto v5: drop duplicate nonEmptyString, lift STAGE_TRACKER_ICONS for the history badge in the rebase-then-merge row test

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* writeback ratchet: baseline the two operator-solicited comments of the rebase-then-merge follow-through

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* automerge: superseded question precedes the label block (#15278) while a needs-rebase label on a merely-behind head stays stale

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
hivecommons-hive Bot pushed a commit that referenced this pull request Oct 29, 2026
… un-park/re-park loop, name the missing App permission (#15134)

* Model capability gaps as first-class blockers so delegated decisions stop re-parking loops

An issue the scanner parks because the GitHub App cannot push
.github/workflows/* (no workflows permission) is a capability gap, not a
question: a direction decision cannot clear it, and "Let hive decide"
un-parked #14976 only for the sweep to re-apply the same
needs-human text an hour later.

- pkg/blocker: structured blocker kinds, the <!-- hive:blocker kind=… -->
  marker, prose inference, and a persisted ledger with a delegated-unpark
  loop guard and a cleared-at staleness guard.
- Record blockers where comments are read: issue_comment webhook, task-list
  sweep (adds the marker to the remainder comment), gh-wrapper (adds the
  marker to a needs-human comment that names a missing capability).
- Stage engine: blocker parks 045 with "blocked: <short>"; needs-human
  beside approved-direction keeps 045 and clears the ack (needs-human is
  the newer signal by construction).
- Dashboard: decision_needed.blocker/options populated with real handlers
  (App settings link, Re-check permissions, close as partially addressed,
  wait; patch hand-off disabled with its reason), delegated decision
  short-circuits to no-effect with the glossary 'blocker' reason, the row
  pill reads "Blocked Β· App lacks workflows permission", βš™ β†’ Security and
  /api/status.capabilities name missing permissions and blocked counts.
- Tests: Go (blocker, ledger, webhook, sweep marker, stage facts/derive,
  dashboard handlers, glossary) and node fixtures (pill, options, popover,
  capability text); gh-wrapper bash tests.
- Docs: labels-and-control-signals (blocker marker + kinds + reconcile
  rule), dashboard-sections, operator-reference (App permissions table),
  api-reference; changelog fragment.

Fixes #15099

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* Blocker options carry a plain-words consequence for the popover

Follows #15087's option consequences so a blocked row's ways out say
what each one does.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* docs: stable anchor for the Blockers section

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* fix: close-partial response carries the result by pointer

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* fix: pkg/github blocker import alias, ledger loop-guard timing, test call sites, import ratchet

- pkg/github already has a test helper named blocker; import pkg/blocker
  as itemblocker there.
- Ledger.Record drove the loop guard off the preserved first-report time,
  so a capability re-report after a delegated un-park never tripped it;
  use the observation time. Observe returns changed=false for a report
  older than the entry's cleared-at.
- stageTrackerDecisionNeededWith test calls pass the clock.
- Allow pkg/dashboard β†’ pkg/blocker in the import ratchet (the blocker
  ledger is the seam the tracker, delegate and status read).

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* fix: keep the import allowlist sorted

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* Fix recheck/held tests, document blocker routes in openapi.json, drop duplicate JS const

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* test: cover blocker kind words, ReasonSentence caps and ledger edge cases; resync api-reference citations after rebase

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* fix: mark the close-partial blocker writes as operator-solicited for the write-back ratchet

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* docs: resync api-reference citations after rebase onto v5

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves conflicts-with-open-pr Open PR has a merge conflict with another open PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activity Monitor: 'Ready for human merge' row offers no way to merge; needs-human states without a matching action

1 participant