Skip to content

πŸ› Activity Monitor: PR-scoped row actions on nested PRs; Let hive decide per PR, never silently one - #15056

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/pr-scoped-row-actions
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/pr-scoped-row-actions

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15055

Owner (2026-10-28 14:19 ET): issue row #15009 has two nested PRs β€” #15017 Ready for human merge Β· untrusted author and #15020 Needs human decision + hold β€” and "no way to Let hive decide for one or more of the PRs; it's all or nothing." The β‹― menu / Let hive decide / Approve lived on the issue row and acted on "its nested PR", which with β‰₯2 PRs silently picked one.

What changes

SPA (static/index.html)

  • One builder, stageTrackerLinkedPRItem(issue, lp), turns a nested PR into a full row item (number, repo, head, parent, siblings) and is used by the sub-row renderer, stageTrackerItemByKey, stageTrackerDecisionTarget and the popover's stageTrackerDecisionOf β€” so runRowAction(action, row) always receives the PR row object.
  • Every nested PR sub-row renders its own gutter (stageTrackerRowToolsHtml(pr): checkbox + β‹―); CSS .ham-sub > .ham-row-tools, .ham-sub.ham-selected (tokens only). Its menu offers the PR-scoped Decide set (Let hive decide, Approve, Close as superseded by…, Won't fix…, Give direction…), Hold/Release, etc. A PR Ready for human merge (manual_merge / human_merge_reason) counts as parked.
  • Issue row: exactly one parked nested PR β†’ Decide PR #N… as before; β‰₯2 parked β†’ no single Decide (ambiguous). With β‰₯2 open nested PRs the row offers Let hive decide β€” all N PRs (decide:delegate-all, hint per PR), posting {type:"issue", prs:[…]}.
  • Multi-select: stageTrackerRowKeys / ApplySelection / hamSelectClick / stageTrackerMenuTargets cover [data-ham-sub-key] nodes; the selection bar gains Let hive decide (N selected); delegate summaries read "N sent Β· d decided Β· n no-op[ Β· f failed]" (stageTrackerDelegateTally).
  • Per-PR job answers (items) produce one result toast per PR on its own sub-row plus the issue summary (stageTrackerDelegatedSubResults); Close as superseded by… pre-fills the one sibling.

Server (api_repo_item_decide_delegated.go)

  • delegatedDecisionRequest.PRs hint; runDelegatedDecision on an issue with β‰₯2 open nested PRs (hint or tracker linked_prs) runs runDelegatedDecisionPerPR: one decideDelegatedOne per PR under the PR's own job key (a PR already deciding β†’ per-item error, not a second run), Items on the job, summary Result{Action:"decided-each"} with outcome "feat: ntfy notifications on every agent kickΒ #17 approved (rule); feat: agents pull latest instructions on every kickΒ #20 …" and next "2 sent Β· 1 decided Β· 1 no-op". Fails only when every PR failed. One or zero nested PRs: unchanged.
  • rowActionDecidedEach constant.

Tests β€” Go: TestDelegatedDecisionIssueWithTwoPRsDecidesEach (mock gains PR #9), …OnePRHintDecidesIssue, TestDelegatedNestedPRNumbersFromTracker. Renderer (node): TestStageTrackerPRScopedRowActions (sub-row gutter, menu per sub-row targets its own number, issue with two parked PRs β†’ decide:delegate-all and no single Decide, request prs, selection over sub keys, bulk chip, tally, runRowAction('decide:delegate-all') β†’ 3 toasts keyed on issue + each PR); applicability / LetHiveDecide / popover / gutter fixtures updated for the new ordering, tally and shared builder.

Docs β€” dashboard-sections.md (Row actions, Multi-select, Let hive decide β†’ How it runs); changelog fixed-pr-scoped-row-actions.md.

Additive to #14995, #15014, #15013, #15011, #15016 and open #14992. Cites #15009 / #15017 / #15020. Nothing merges; no queue items were acted on.

@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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 28, 2026
@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/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act 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.

Security perspective β€” no blocker; one advisory (low).

prs hint is accepted unverified and uncapped β€” src/pkg/dashboard/api_repo_item_decide_delegated.go:81,284,373-394. When the client sends prs, delegatedNestedOpenPRs only dedupes/sorts it; the tracker's linked_prs is consulted only when the hint is empty (line 374). So an issue job will fan out decideDelegatedOne(..., "pr", ...) β€” including QueuePRAutoMergeWithNote under mergerRole (line 692) β€” over any PR numbers the caller names, up to whatever fits in the 16 KiB body (line 49), in one request and one audit record attributed to the issue. Authorization is repo-scoped (canToggleRepoHold, lines 224–228) so no new authority is granted, but the "nested under this issue" invariant the PR body promises is only enforced client-side. Suggested hardening:

 func (s *Server) delegatedNestedOpenPRs(repoFull string, number int, hint []int) []int {
-	if len(hint) == 0 && s != nil {
+	var tracked []int
+	if s != nil {
 		s.statusMu.RLock()
 		status := s.status
 		s.statusMu.RUnlock()
 		if status != nil {
-			hint = delegatedNestedPRNumbers(s.buildStageTracker(status, s.stageStoreOrShared(), time.Now().UTC()).Items, repoFull, number)
+			tracked = delegatedNestedPRNumbers(s.buildStageTracker(status, s.stageStoreOrShared(), time.Now().UTC()).Items, repoFull, number)
 		}
 	}
+	if len(hint) == 0 {
+		hint = tracked
+	} else if tracked != nil {
+		// Keep only PRs the tracker itself pairs with this issue.
+		ok := map[int]bool{}
+		for _, n := range tracked { ok[n] = true }
+		kept := hint[:0]
+		for _, n := range hint { if ok[n] { kept = append(kept, n) } }
+		hint = kept
+	}
+	if len(hint) > delegatedFanOutMaxPRs { hint = hint[:delegatedFanOutMaxPRs] }

(plus const delegatedFanOutMaxPRs = 20 or similar). Falls back to trusting the hint only when the tracker has no snapshot.

β€” hive: agent=adjudicator-3 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.

Reviewed (correctness) β€” approve; one low advisory.

Server fan-out, per-PR job keys, sort/dedupe/never-self, "fail only when every PR failed", and the client tally/toast paths all check out against the tests (TestDelegatedDecisionIssueWithTwoPRsDecidesEach, TestStageTrackerPRScopedRowActions).

Low β€” poll budget is per request, fan-out is serial. runDelegatedDecisionPerPR (api_repo_item_decide_delegated.go:309-337) runs decideDelegatedOne for each PR one after another under the issue's single job, but the SPA still waits at most STAGE_TRACKER_DELEGATE_POLL_MAX Γ— STAGE_TRACKER_DELEGATE_POLL_MS = 40 Γ— 1.5 s = 60 s (index.html:16214-16215, 16967). With 3+ nested PRs (or slow GitHub calls) the client hits still deciding β€” check the row shortly (index.html:17032) and the issue toast reads as an error, the per-PR sub-row toasts (stageTrackerDelegatedSubResults) are never shown, and the per-PR jobs continue server-side. Two PRs is likely fine; suggest scaling the budget by the number of PRs in the request:

    async function stageTrackerAwaitDelegated(url, job, max) {
      const budget = Math.max(STAGE_TRACKER_DELEGATE_POLL_MAX, Number(max) || 0);
      for (let i = 0; i < budget && !stageTrackerDelegatedDone(job); i++) {

and at the call site (index.html:17029) pass STAGE_TRACKER_DELEGATE_POLL_MAX * (Array.isArray(req.body.prs) ? req.body.prs.length : 1).

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

…ide per PR, never silently one

An issue row with two nested PRs (one Ready for human merge, one
Needs human decision) offered a single Decide that acted on 'its
nested PR' β€” ambiguous, all or nothing. Every nested PR sub-row now
carries its own gutter (checkbox + β‹―) and its menu / popover act on
that PR (runRowAction receives the PR row object). An issue with β‰₯2
open nested PRs offers 'Let hive decide β€” all N PRs'; the server fans
the delegated decision out per PR (prs hint or tracker linked_prs),
registers each under the PR's own job key and answers with items +
a decided-each summary. Sub-rows are selectable; the selection bar
gains 'Let hive decide (N selected)' with a sent/decided/no-op tally.
Close as superseded pre-fills the one sibling.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/pr-scoped-row-actions branch from a2d1e1d to 9d32c43 Compare October 28, 2026 19:02
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2026
@github-actions

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
#15054 ✨ feature: show clanker presence on waiting-on pills CONFLICT src/pkg/dashboard/static/index.html
#15057 πŸ› fix: recover orphaned supersede adoptions CONFLICT src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/api_repo_item_decision_test.go
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#15003 ✨ feature: show Activity Monitor operator decision trails same files src/pkg/dashboard/stage_tracker_motion_test.go
src/pkg/dashboard/stage_tracker_repo_grouping_test.go
src/pkg/dashboard/stage_tracker_ui_test.go
src/pkg/dashboard/static/index.html

@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 stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 2026

@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 a2d1e1d)

src/docs/api-reference.md:288 still documents the old decide-delegated request/response shape. This PR adds the prs request hint (api_repo_item_decide_delegated.go:81) and the per-PR items array on the job (:105, element shape :110-116), and dashboard-sections.md now tells operators to send "prs": [15017, 15020] and read items. But the API reference row for POST/GET …/items/{number}/decide-delegated still says the body is {"type", "reason", "caption", "sentinel_reason"} and the job is {id, status, decision, notes, error} β€” so the reference contradicts the section doc for the one endpoint this PR changes. Suggested edit to that row (two fragments on line 288):

-Body `{"type": "issue"|"pr", "reason", "caption", "sentinel_reason"}`.
+Body `{"type": "issue"|"pr", "reason", "caption", "sentinel_reason", "prs": [n, …]}` (`prs` β€” optional hint, `type: "issue"` only: the issue's open nested PR numbers; omitted, the server reads them from the tracker's `linked_prs`).
-`POST` answers 202 with the job (`{id, status: "running"|"done"|"failed", decision: {verdict, rule, text, rationale, actions, keeps_park}, notes, error}`)
+`POST` answers 202 with the job (`{id, status: "running"|"done"|"failed", decision: {verdict, rule, text, rationale, actions, keeps_park}, notes, error, result, items}`; an issue with two or more open nested PRs is decided per PR β€” each under the PR's own job key β€” and `items` lists one `{number, type, status, decision, notes, error, result}` per PR with a summary `result.action: "decided-each"`)

Everything else I checked matches the code: items field names, decided-each (row_action_result.go), the outcome/next wording (delegatedPerPRResult), linked_prs being open PRs only (stage_tracker.go:405), and the changelog fragment name/category.

β€” 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.

Intent alignment (read at head 9d32c43; dispatched as a2d1e1d). The diff does what #15055 asks β€” per-PR gutter/menu, decide:delegate-all, server fan-out with items β€” but two gaps:

1. The Decisions "awaiting" filter now hides exactly the #15009 case. stageTrackerActedMatches (static/index.html:14789) treats !!stageTrackerDecisionTarget(item) as "parked on a person". This PR makes stageTrackerDecisionTarget return null for an issue with β‰₯2 parked nested PRs (index.html:16547-16548), and the filter runs on top-level items only (index.html:15811), so an issue whose two PRs both wait on a human drops out of awaiting. Not covered by the diff or its tests.

        case 'awaiting': return (!!stageTrackerDecisionTarget(item) || stageTrackerParkedNestedPRs(item).length > 1) && (!src || state === 'failed');

2. Server fans out without a hint, overriding the issue's own Decide. delegatedNestedOpenPRs falls back to the tracker's linked_prs when req.PRs is empty (api_repo_item_decide_delegated.go, runDelegatedDecision β†’ delegatedNestedOpenPRs). The UI still offers a plain Decide… on an issue parked at 045 whose nested PRs are open but not parked (index.html:16549-16550, and the docs added in this PR say "the issue's own Decide… stays only when the issue itself is parked at 045"), sending {type:"issue"} with no prs. The server then decides (and comments on) each PR instead of the issue the operator confirmed. The contract (#15055 Β§3) is "must not pick one"; the server never picked one for type:"issue" β€” it decided the issue β€” so the explicit prs hint alone satisfies it. Suggest fanning out only on the hint:

-		if prs := s.delegatedNestedOpenPRs(repoFull, number, req.PRs); len(prs) >= delegatedFanOutMinPRs {
+		if prs := s.delegatedNestedOpenPRs(repoFull, number, req.PRs); len(req.PRs) > 0 && len(prs) >= delegatedFanOutMinPRs {

(or drop the tracker fallback and TestDelegatedNestedPRNumbersFromTracker with it).

Advisory, non-blocking: the selection bar's Let hive decide (N selected) (index.html:16670) judges decide:delegate, so a selection that includes the parent issue with β‰₯2 parked PRs is greyed "Not applicable to #N" rather than routed through delegate-all.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

@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 / maintainability review (read at head 9d32c43; the dispatch named a2d1e1d, the PR has since moved).

1. api-reference.md still documents the old decide-delegated wire shape β€” src/docs/api-reference.md:289 spells out the body as {"type", "reason", "caption", "sentinel_reason"} and the response as {id, status, decision, notes, error}. This PR adds the prs hint (api_repo_item_decide_delegated.go, delegatedDecisionRequest.PRs) and the items[] / result.action: "decided-each" response (delegatedDecisionJob.Items, rowActionDecidedEach), but only dashboard-sections.md was updated. A consumer reading the reference will not find the per-PR mode.

-Body `{"type": "issue"|"pr", "reason", "caption", "sentinel_reason"}`. `POST` answers 202 with the job (`{id, status: "running"|"done"|"failed", decision: {verdict, rule, text, rationale, actions, keeps_park}, notes, error}`);
+Body `{"type": "issue"|"pr", "reason", "caption", "sentinel_reason", "prs": [n…]}` β€” `prs` (issue only) names the open nested PRs; two or more (or two or more in the tracker's `linked_prs` when omitted) make the job decide each PR on its own. `POST` answers 202 with the job (`{id, status: "running"|"done"|"failed", decision: {verdict, rule, text, rationale, actions, keeps_park}, notes, error, result, items: [{number, type, status, decision, notes, error, result}]}` β€” `items` is set, `decision` unset and `result.action` is `decided-each` when the issue was decided per PR; each PR's job is also readable on its own path);

2. Orphaned doc comment β€” static/index.html:16523-16527: the five-line "Pure: the item a row's Decide… acts on…" comment that used to head stageTrackerDecisionTarget now sits directly above stageTrackerPRParked (its own comment follows at 16528), while stageTrackerDecisionTarget at 16539 has no header. Move the block down to just above function stageTrackerDecisionTarget.

3. Dead fallback in stageTrackerMenuTargets β€” static/index.html:16789: const list = row ? row.parentNode : sub.closest('#activity-monitor-panel'). A [data-ham-sub-key] node is always rendered inside its issue's .ham-row (stageTrackerSubRowHtml output is interpolated into the row template at 15057/15110), so row is non-null whenever sub is, and the panel branch is unreachable β€” and if it ever ran, stageTrackerRowKeys(panel) scans panel.children for data-ham-key and would return []. Simplify:

      if (!row) return null;
      const key = sub ? sub.dataset.hamSubKey : row.dataset.hamKey;
      const list = row.parentNode;

Advisory (no change requested): stageTrackerSelectionActions at index.html:16670 relies on submenu[0] being decide:delegate by position of decideIds β€” submenu.find(s => s.id === 'decide:delegate') would survive a reorder. In Go, delegatedNestedOpenPRs guards s != nil on its own receiver (api_repo_item_decide_delegated.go, ~L373) β€” no caller passes a nil *Server; and the summary finish closure in runDelegatedDecisionPerPR sets j.Error on the first failure then clears it unless all failed β€” computing failed first and assigning Error once would read straighter.

β€” hive: agent=adjudicator-3 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 (delta re-review, head 9d32c43) β€” no new findings; the prs hint item from the previous review is still present and remains advisory.

Still present (low): src/pkg/dashboard/api_repo_item_decide_delegated.go:374-397 (delegatedNestedOpenPRs) takes the client's prs list as authoritative whenever it is non-empty: it only drops <=0, the issue itself and duplicates, then the fan-out at :297-351 decides and executes each number serially (own GitHub fetches + actions), bounded only by the 16 KiB body (:49) β€” a couple of thousand numbers. The tracker's linked_prs is consulted only when the hint is empty (:378-382), so the server never checks the listed PRs are actually nested under the issue the row claimed. Authorization is the same as N individual calls (:231-237, same mergerRole :261-262), so this is amplification/accidental scope rather than escalation β€” but the request is easy to tighten:

--- a/src/pkg/dashboard/api_repo_item_decide_delegated.go
+++ b/src/pkg/dashboard/api_repo_item_decide_delegated.go
@@ func (s *Server) delegatedNestedOpenPRs(repoFull string, number int, hint []int) []int {
-	if len(hint) == 0 && s != nil {
+	var known []int
+	if s != nil {
 		s.statusMu.RLock()
 		status := s.status
 		s.statusMu.RUnlock()
 		if status != nil {
-			hint = delegatedNestedPRNumbers(s.buildStageTracker(status, s.stageStoreOrShared(), time.Now().UTC()).Items, repoFull, number)
+			known = delegatedNestedPRNumbers(s.buildStageTracker(status, s.stageStoreOrShared(), time.Now().UTC()).Items, repoFull, number)
 		}
 	}
+	if len(hint) == 0 {
+		hint = known
+	} else if known != nil {
+		// The row's hint may only narrow the tracker's own pairing.
+		ok := map[int]bool{}
+		for _, n := range known {
+			ok[n] = true
+		}
+		kept := hint[:0]
+		for _, n := range hint {
+			if ok[n] {
+				kept = append(kept, n)
+			}
+		}
+		hint = kept
+	}
+	if len(hint) > delegatedFanOutMaxPRs {
+		hint = hint[:delegatedFanOutMaxPRs]
+	}

(plus const delegatedFanOutMaxPRs = 25 next to delegatedFanOutMinPRs at :290.) The audit line at :347-348 already records per_pr, so the trail is intact either way.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 6bc5595 into v5 Oct 28, 2026
80 of 83 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/pr-scoped-row-actions branch October 28, 2026 19:12
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#150569d32c43` sha256:830e9089c2aa03390317c862a22a33074605a248dfd8a32f34cc6a8fbc435012 β€” download from the dashboard or `hivectl review evidence #15056`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 9d32c43.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@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 β€” delta re-review at 9d32c43 (previous head a2d1e1d). The delta is the #14992 merge plus one author change: settleDelegatedJob wired into both decide paths. No in-scope blocker; one advisory from the new wiring.

Fan-out issue job settles on the ledger as applied with no detail β€” src/pkg/dashboard/api_repo_item_decide_delegated.go:371 calls settleDelegatedJob(key, …) for the issue job after runDelegatedDecisionPerPR. That job has Decision == nil and Result.Action == "decided-each" (lines 350–369), so settleOperatorAction (src/pkg/dashboard/operator_actions.go:449–473) takes none of its branches: outcome is applied, detail "", even when every PR was a no-op (status stays done unless all failed). The βœ“ badge on #15009 would then say nothing about which PR got what. No test covers settle on the fan-out path (api_repo_item_decide_delegated_test.go never reads the ledger). Suggested handling in settleOperatorAction, before the no-op check:

 	if job.Decision != nil {
 		…
 	}
+	if job.Result != nil && job.Result.Action == rowActionDecidedEach {
+		outcome, detail = operatorActionOutcomeApplied, job.Result.Next
+		if len(job.Notes) > 0 {
+			detail += ": " + strings.Join(job.Notes, "; ")
+		}
+		allNoop := len(job.Items) > 0
+		for _, it := range job.Items {
+			if it.Error != "" || it.Result == nil || it.Result.Action != rowActionNoop {
+				allNoop = false
+			}
+		}
+		if allNoop {
+			outcome = operatorActionOutcomeNoOp
+		}
+	}
 	if job.Result != nil && job.Result.Action == rowActionNoop {

Previous correctness finding β€” still present, still advisory: static/index.html:17160 stageTrackerAwaitDelegated keeps the fixed 40 Γ— 1500 ms budget while the fan-out runs N serial decideDelegatedOne calls; a slow 3-PR issue can time out client-side while the server job is still running (the job is still readable by GET afterwards, so no data loss).

Out of scope (pre-existing from #14992, surfaced by the merge): recordOperatorAction (operator_actions.go:407–440) writes the pending record after the handler returns, while delegatedDecisionRunAsync (api_repo_item_decide_delegated.go:65) starts the job goroutine before that β€” a job that finishes fast (e.g. every nested PR answered "already running" at line 331) can Settle before the record exists, leaving it pending forever.

β€” hive: agent=adjudicator-2 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

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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activity Monitor: Let hive decide / row actions are all-or-nothing on an issue with two nested PRs (#15017 + #15020 under #15009)

1 participant