Skip to content

🐛 Let hive decide: say when a decision never took effect, in plain words, and never block the PR with hive's own decision - #15063

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
fix/stuck-decision-plain-words
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
fix/stuck-decision-plain-words

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15062. Evidence: #14822 (the hive's own /hive decision supersede now: adopt… read as contributor-lane:changes-requested every cycle; the owner's repeat click answered "No change — hive already recorded this decision (rule contributor-offline)").

What changes

1. Stuck-decision detection (pkg/dashboard/delegated_decision_effect.go). The dedup path of decide-delegated now checks whether the recorded decision's expected effect has shown. Inside decisions.delegate.effect_timeout (new, default 30m) the no-op names the decision in plain words and the deadline. Past it, result.action: "no-effect": Hive decided at , but it hasn't taken effect: — the why derived from the lane reason and PR state (self-decision-read-as-changes, changes_requested, sentinel, conflicting, ci-red, dco, hold, author-online for adopt, adoption-disabled, …) — plus result.options (Merge as maintainer (on GitHub), Re-run decision, Close as superseded, Send back for a new commit) rendered as toast buttons. Re-run posts "force": true and skips the dedup. One stalled follow-up comment is posted on the item (<!-- hive:decision-stalled … -->, never a second decision).

2. Plain-words glossary (pkg/delegatedecision/decision_glossary.go, mirrored as STAGE_TRACKER_DECISION_GLOSSARY; TestStageTrackerDecisionGlossaryMirrorsGo fails on drift; TestGlossaryCoversEveryRule scans policy.go/llm.go for rule slugs). Used by the toast head (adopted (the author's hive hasn't been connected since the nudge)), RowActionResult, the popover's decisionPlainReason, and the PR comment. Slugs are never shown bare.

3. PR comment (decision_comment.go). Every delegated decision comment now carries Hive decided / Why / What happens next (expected within 30 min) / If it doesn't happen above the attribution line; the /hive decision first line and the machine marker are unchanged so delegatedPriorDecision and the sweep still match.

4. Self-blocking guard (pkg/github). eligibleUnparkCommand and reconcileAnsweredPRDecision skip a comment carrying the delegated-decision marker, whichever login posted it. #14822 fixes the approve <rationale> parse; this covers every other decision text the delegate can post. Regression: TestSweepIssueUnparkCommandsIgnoresHiveSelfDecision.

Additive throughout: RowActionResult gains why/options (omitempty), the request gains force, DelegateDecisionConfig gains effect_timeout; CommentBody keeps its signature. Does not touch #14992's or #15003's surfaces.

Tests

  • Go: pkg/delegatedecision (glossary coverage, aliases, JSON mirror, comment plain words, stalled body), pkg/config (effect_timeout parsing), pkg/github (self-decision guard, incl. reconcile path and a real decision still honoured), pkg/dashboard (TestDelegatedDecisionStuckReportsNoEffect reproduces the 🐛 fix: preserve owner intent through PR decision paths #14822 timeline incl. one-time follow-up and forced re-run; TestDelegatedStuckWhyReadsTheLane; TestDelegatedDecisionRepeatIsNoop updated for the in-window wording; glossary mirror).
  • JS (node, stage_tracker_row_actions_test.go): no-effect toast text/type, options rendered as buttons, disabled option inert, Re-run acts on the toast target with force: true, stageTrackerPlainWords incl. lane-prefixed and unknown slugs.
  • Inline JS lint (check-inline-js.js) clean; gofmt/go vet clean on touched packages.

Docs

dashboard-sections.md (Let hive decide: plain words, stuck decisions, setting), labels-and-control-signals.md (new Decision glossary section, generated table), operator-reference.md (effect_timeout), changelog.d/fixed-stuck-decision-plain-words.md.

@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 danathar 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. 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.

@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
#15069 🐛 fix: record pending operator action before starting delegated job CONFLICT src/pkg/dashboard/api_repo_item_decide_delegated_test.go
#14822 🐛 fix: preserve owner intent through PR decision paths CONFLICT src/pkg/github/pr_unpark_decision_test.go
#15057 🐛 fix: recover orphaned supersede adoptions CONFLICT src/pkg/dashboard/api_repo_item_decide_delegated.go
#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/static/index.html
#15076 🐛 fix: clarify Activity Monitor actors and shared PR rows same files src/docs/dashboard-sections.md
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
#15067 🐛 fix: enable bulk delegation for multi-PR parent selections same files src/pkg/dashboard/stage_tracker_row_actions_test.go
src/pkg/dashboard/static/index.html
#15072 🐛 Adoption: re-adopt when the hive's superseding copy is closed unmerged same files src/docs/dashboard-sections.md
src/docs/labels-and-control-signals.md
src/pkg/dashboard/api_repo_item_decide_delegated.go
src/pkg/dashboard/api_repo_item_decision_test.go
src/pkg/dashboard/stage_tracker_decision.go
src/pkg/dashboard/static/index.html
#15054 ✨ feature: show clanker presence on waiting-on pills same files src/docs/dashboard-sections.md
src/docs/labels-and-control-signals.md
src/pkg/dashboard/static/index.html
#15065 📖 docs: note the serialized-lane fork gate on base_sync same files src/docs/operator-reference.md
#15070 ✨ Activity Monitor: presence indicator (clanker online / offline / none) on the waiting-on pill same files src/docs/dashboard-sections.md
src/docs/labels-and-control-signals.md
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 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 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.

A delegated decision whose expected effect (park lifted, merge, close,
fresh hive PR, new commit) has not shown within
decisions.delegate.effect_timeout (default 30m) is reported as no-effect:
"Hive decided <plain action> at <T>, but it hasn't taken effect: <plain
why>" with Merge as maintainer / Re-run decision (force) / Close as
superseded / Send back for a new commit as toast buttons, plus one
plain-words follow-up comment on the item (stalled marker, never a
second decision). Inside the window the no-op names the decision and
the deadline instead of a bare rule slug.

One glossary (pkg/delegatedecision/decision_glossary.go, mirrored as
STAGE_TRACKER_DECISION_GLOSSARY with a drift test) renders every rule,
verdict and reason in plain words across toast, popover, PR comment and
tooltip. The delegate's comment carries Hive decided / Why / What happens
next / If it doesn't happen above the attribution and machine marker.

A /hive decision comment the hive itself posted (delegated marker) is no
longer read as a maintainer's change request, whichever login posted it
— the self-blocking seen on #14822 (contributor-lane:changes-requested
every cycle on the PR that carried the parser fix).

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/stuck-decision-plain-words branch from f6ddf71 to 31f333c Compare October 28, 2026 19:33

@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 (security) — no blocking findings. One advisory:

Forced re-run is not visible in the audit trail (low). req.Force bypasses the dedup at src/pkg/dashboard/api_repo_item_decide_delegated.go:266 and falls through to executeDelegatedDecision (:292), which posts comments / closes / queues auto-merge again — but the audit record at :313-320 is the same as a first-time decision; nothing says the operator forced it past a recorded prior. Suggest adding the flag so a repeat write can be distinguished later:

	detail := auditDetail("repo", repoFull, "number", strconv.Itoa(number), "type", itemType,
		"verdict", string(d.Verdict), "rule", d.Rule, "actions", strings.Join(kinds, ","),
		"keeps_park", strconv.FormatBool(d.KeepsPark), "policy", delegatedecision.PolicyName, "decision", d.Text,
		"force", strconv.FormatBool(req.Force))

Checked and fine: endpoint still requires a user session (:199-201) and force adds no new auth surface; isHiveSelfDecisionComment (pr_unpark_decision.go:139) is fail-closed — a forged marker only makes a comment ignored; toast why/options are rendered via textContent only (static/index.html); the stalled follow-up body is built from fixed glossary slugs, not request text.

— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@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 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 (style/maintainability) — read at f6ddf71 and re-checked against current head 31f333c.

  1. Already fixed on current head — noting for the record. At f6ddf71, src/pkg/dashboard/api_repo_item_decide_delegated.go:328 kept (*Server).delegatedPriorDecision as a thin wrapper around the new delegatedPriorDecisionState, but nothing called it any more; src/.golangci.yml has unused enabled, and the golangci-lint check on f6ddf71 failed with exactly that (api_repo_item_decide_delegated.go:337:18: func (*Server).delegatedPriorDecision is unused). The wrapper is gone at 31f333c, so no action needed.

  2. Low / advisory — two definitions of the same default. src/pkg/config/decisions.go:42 defines DefaultDelegateDecisionEffectTimeout = 30 * time.Minute and src/pkg/delegatedecision/decision_comment.go:19 defines DefaultEffectTimeout = 30 * time.Minute; delegated_decision_effect.go:85-87 falls back to the latter while the parsed config falls back to the former. If one is ever changed the toast's "expected within …" and the stuck threshold can drift apart silently. pkg/dashboard already imports pkg/config, so the dashboard fallback can read the config constant and the second constant can be dropped:

	if s == nil || s.deps == nil || s.deps.Config == nil {
		return config.DefaultDelegateDecisionEffectTimeout
	}

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

Correctness review (head f6ddf71) — one low-severity regression, non-blocking.

decisionPlainReason now mislabels required-check-*:dco lane reasons — src/pkg/dashboard/stage_tracker_decision.go:264-266 consults delegatedecision.Explain(base) before humanizeStageReason. Explain (src/pkg/delegatedecision/decision_glossary.go:233-238) falls back to the token after the last :, so a lane reason such as required-check-pending:dco or required-check-failing:DCO resolves to the dco reason entry ("a commit is missing its sign-off") instead of the existing "check dco still running" / "check DCO failing" text from src/pkg/dashboard/stage_tracker.go:1103-1108. For a pending DCO check the popover now states a sign-off is missing, which is false. Same suffix path would catch any required check named hold, conflict, red, etc.

Suggested fix — keep the glossary fallback to whole-token / lane-prefixed reasons the glossary actually models:

	lower := strings.ToLower(strings.TrimSpace(base))
	if !strings.HasPrefix(lower, "required-check-") && !strings.HasPrefix(lower, "optional-check-") && !strings.HasPrefix(lower, "base-branch-red:") && !strings.HasPrefix(lower, "fork-guard:") {
		if e, ok := delegatedecision.Explain(base); ok && e.Kind == delegatedecision.GlossaryReason {
			return e.Plain
		}
	}

(or add an exact-match lookup in delegatedecision and use that here). A table case in the decisionPlainReason tests for required-check-pending:dco would pin it.

Verified OK: the isHiveSelfDecisionComment skip (pr_unpark_decision.go:138-140, issue_unpark_command.go:902) does not regress issue un-parking — executeDelegatedDecision applies RecordOperatorIssueDecision directly at post time (api_repo_item_decide_delegated.go:471-481), so the sweep never needed to parse the hive's own comment; stalled marker <!-- hive:decision-stalled is disjoint from <!-- hive:delegated-decision and is filtered before the rule-tag check (delegated_decision_effect.go:73-77).

— hive: agent=adjudicator 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/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.

Read the self-blocking fix against the v5 tree; it is sound, and it does not lose the decision's effect.

  • src/pkg/github/pr_unpark_decision.go:139 / issue_unpark_command.go:902 / pr_unpark_decision.go:239 skip any comment carrying the delegated marker (delegatedecision.IsDelegatedComment, policy.go:214 — a substring match on MarkerPrefix). The worry would be that the sweep was the thing that executed the hive's /hive decision comment; it is not: the adopt-supersede verdict carries its own ActionAdoptSupersede (policy.go:443) which executeDelegatedDecision runs directly (api_repo_item_decide_delegated.go:754), approvals go through ActionApproveReview, and issue/hive-PR direction is recorded via RecordOperator*Decision in the same function. The comment was only ever the audit record, so ignoring it in the sweep removes the false change-request without removing anything that acted.
  • No import cycle: pkg/github now imports pkg/delegatedecision, which (including the new decision_comment.go / decision_glossary.go) imports only stdlib and pkg/jsonextract.
  • TestSweepIssueUnparkCommandsIgnoresHiveSelfDecision covers both the sweep and the reconcile-after-restart path and checks a real maintainer /hive decision on the same thread is still honoured — that is the regression test the issue needed.

Scope note: I read the unpark/sweep change, the executeDelegatedDecision path, delegated_decision_effect.go's prior-state reader and the config plumbing; I did not read the glossary tables or the index.html toast rendering line by line. The conflicts-with-open-pr label is worth a look before merge, but I have no finding against the code.

— hive: agent=reviewer 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 #15062 — the four fix items are all present (stuck-decision dedup path in src/pkg/dashboard/delegated_decision_effect.go, glossary + JS mirror, four-line comment in decision_comment.go, self-decision guard at pr_unpark_decision.go:239 / issue_unpark_command.go:902). One gap in item 1's "plain why":

supersede falls back to the wrong "why" for the live PR's remaining blocker — delegated_decision_effect.go:139-146. delegatedStuckWhy only matches lane-reason substrings (changes-requested/sentinel/conflict/dco/hold/behind/CI) and then, for VerdictAdoptSupersede, reaches default: GlossaryNotMergedYet — whose text is "The hive approved it but the merge gate has not merged it" (decision_glossary.go:176-177). But a supersede is executed by the adoption engine via the LabelAdoptSupersede label (api_repo_item_decide_delegated.go:754-769), and the engine silently holds it when the author maintains the repo (automerge/automerge_contributor_adopt.go:594-604, recorded as AdoptBlockedAuthorMaintainer). That is exactly #14822's author. Once the self-decision guard clears the changes-requested lane, the no-effect toast/comment on #14822 will say "the merge gate hasn't merged it" for a decision that never asked for a merge. The dashboard already knows this state (stage_tracker_adoption.go:121-127 sets BlockedBy/AuthorMaintainer). The GlossaryAuthorOnline branch at :107 is unreachable on this path (policy.go:438 only fires contributor-offline when !ContributorOnline), so it does not cover it either.

Suggested fix: add an adoption-blocked slug and a supersede-specific fallback, e.g.

 // decision_glossary.go
+	GlossaryAuthorMaintainer = "author-maintainer"
+	GlossaryNotAdoptedYet    = "not-adopted-yet"
 ...
+	{Slug: GlossaryAuthorMaintainer, Kind: GlossaryReason, Plain: "the author maintains this repository, so the hive won't take the PR over",
+		Detail: "Stage adoption is held for maintainers' own PRs (governor.labels.stage.adoption.maintainer_policy). Merge it by hand, or set maintainer_policy to allow adoption."},
+	{Slug: GlossaryNotAdoptedYet, Kind: GlossaryReason, Plain: "the hive hasn't opened the replacement PR yet",
+		Detail: "The supersede was queued for the adoption engine but no hive-authored PR has appeared; the adoption row on the Activity Monitor says what holds it."},
 // delegated_decision_effect.go, delegatedStuckWhy
 	if d.Verdict == delegatedecision.VerdictAdoptSupersede {
 		if in.ContributorOnline { return delegatedecision.GlossaryAuthorOnline }
 		if !s.stageAdoptionEnabled() { return delegatedecision.GlossaryAdoptionOff }
+		if a := s.stageTrackerAdoptionFor(in.Repo, in.Number); a != nil && a.AuthorMaintainer {
+			return delegatedecision.GlossaryAuthorMaintainer
+		}
 	}
 ...
 	switch {
+	case d.Verdict == delegatedecision.VerdictAdoptSupersede:
+		return delegatedecision.GlossaryNotAdoptedYet
 	case d.Verdict == delegatedecision.VerdictCloseDuplicate, ...

(and mirror the two slugs in static/index.html's glossary so the sync test passes). Read at head f6ddf71.

— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 28, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 060-reviewed → 050-review-pending: review-gate:awaiting-review-approval

@hivecommons-hive
hivecommons-hive Bot merged commit b26b481 into v5 Oct 28, 2026
86 of 90 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/stuck-decision-plain-words branch October 28, 2026 19:55
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#1506331f333c` sha256:41f809ce8608fa7c2b31c925249a99b72025de9c415f65a46a880801a32aaa13 — download from the dashboard or `hivectl review evidence #15063`.

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

@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

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.

Let hive decide: a recorded decision that never takes effect is reported as "no change", with bare rule slugs and no way forward

1 participant