Skip to content

🐛 fix: skeleton preview, plan cache and human reasons for Let hive decide - #15991

Merged
hivecommons-hive[bot] merged 5 commits into
v5from
scanner/fix-15773
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 5 commits into
v5from
scanner/fix-15773

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #15773

Why

Let hive decide still felt broken after #15871. That PR shipped the client-side half: a busy button and row wash while the plan loads, the passive "decision pending on #N" chip on covered issue rows, and the human-why tooltip fallback. Three gaps were left:

  • The preview only appeared after the plan finished, which takes several seconds because it gathers the PR live from GitHub. Until then the operator had no dialog and no way to cancel. If the plan failed, the result was a toast on top of nothing.
  • Every click paid for a full GitHub round trip, and nothing showed where the time went.
  • A covered issue repeated its PR's question but had no way to get to the PR. A 👤 chevron said that a person was needed but not why.

What this PR completes

  • A, skeleton preview: the dialog opens straight away as a skeleton (title, subject, "Asking the hive…", placeholder lines). Cancel works immediately; Let hive do that stays disabled until the plan arrives and fills the dialog. Errors appear inline with Retry. A second click while the preview is open does nothing. The skeleton doesn't animate under prefers-reduced-motion. It uses the existing hiveWireDialog pattern, with no browser alert, confirm or prompt.
  • B, latency: the server keeps each plan for 45 s, with a cap of 256 entries. The cache key is (repo, number, type, head, request) plus the merge role. The SPA prefetches the plan when a row's decision options are revealed (decision popover, ⋯ menu, hover or focus on the lead button), so the click reuses that answer. A new head or a recorded decision drops the cached plan. The plan response sends Server-Timing: decide_plan;desc="hit|miss";dur=…, and the server logs one debug line with the duration. The app-wide timing wrapper now adds its own Server-Timing metric instead of overwriting the handler's.
  • C, covered issues: the caption reads "Covered by PR #N — waiting for a decision on the PR". The passive chip now scrolls to the PR's row, or to the issue row that draws it, when clicked. Only the PR row has the button.
  • D, human_reason: every item whose next move is a person's carries one short shared reason (≤40 chars). It is rendered after the chevron word, for example "PR in progress · 🌱 deploy: dedicated metrics Secret for the monitoring component and CI render of kustomize overlays #15759 needs a decision". When the word already explains the reason, as in "Ready for human merge · workflow files", nothing is added. The full question stays in the tooltip. A Go test walks every stage × author kind × modifier and fails if a 👤 marker ships without a reason. A JS test pins the rendering.

Tests were added for each change: plan cache hit/miss, TTL, cap and forget; Server-Timing passthrough; human_reason coverage; the covered caption; skeleton, error and Retry markup; prefetch reuse; the no-double-fire guard; and chip scroll targets. The docs (activity-monitor.md) and a changelog fragment are updated.

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@clubanderson

…cide

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 31, 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 hanthor 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 31, 2026
@github-actions

github-actions Bot commented Oct 31, 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
#15849 ✨ Show online ClankeR IDs on the Contributors count pill same files src/pkg/dashboard/static/index.html
#15984 ✨ feature: add opt-in Matrix Rain and Cascade display same files src/pkg/dashboard/static/index.html
#15977 ✨ feat: serve Matrix lines via authorized /api/matrix/lines and content-free code-lines SSE nudge same files src/pkg/dashboard/server.go
#15890 🐛 dashboard: point operator-reference help marks at the section sub-pages same files src/pkg/dashboard/static/index.html

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR 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 31, 2026
TestStageTrackerCuesWiring scans the tracker-cues CSS for raw colours by
substring ("#1" etc.), so the two comments this branch added that cite
hive#15773 and "· #15759" tripped it in the shuffled dashboard run.
Reword the comments and regenerate index.html.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The red test (dashboard 4/4) / dashboard shuffle 1/3 / coverage checks are a deterministic defect in this PR's new test, not a flake — and the production code it exercises is behaving correctly.

src/pkg/dashboard/stage_tracker_decide_plan_cache_test.go:173-176 — the 090 assertion feeds the output code in as the input reason.

merge := StageTrackerItem{…, Stage: trackerNumberReadyForHuman, Reason: "workflow-files"}
merge.HumanMergeReason, _, _ = stageTrackerHumanMergeReason(merge.Reason)
if a := stageTrackerStageActor(merge, nil, now); a.HumanReason != "workflow files" {

stageTrackerHumanMergeReason (stage_tracker_caption.go:511-520) passes the stage reason to prstage.HumanMergeReason (src/pkg/stageengine/prstage/reasons.go:140-147), which maps contributor-lane:workflow-path → "workflow-files". The literal "workflow-files" is that function's output code, not a stage reason, so it falls through to HumanMergeReasonPolicy ("policy"); stageTrackerStageActor then has no word for it (stage_tracker_actor.go:254) and returns stageTrackerHumanAsk → "needs a person to merge" (:275). CI reports exactly that: 090 human_reason = "needs a person to merge" (code "policy").

Fix: Reason: "contributor-lane:workflow-path" on line 173 (the same input the existing stage_tracker_test.go:269 uses for the workflow files word). The "workflow-files" entry in the loop at :153 is harmless — check only demands a non-empty reason there — but it is testing the fall-through, not the workflow case, so swapping it for the real reason would make the loop mean what the comment says.

Everything else I read looks correct:

  • api_repo_item_decide_delegated_plan.go:112-135, 160-220 — plan cache key is (repo#number, type, head, mergerRole, reason, caption, sentinelReason, prs…); planDelegatedDecision (:227) reads nothing else from the request or caller, so a hit served to another operator with the same role is the same plan. TTL check on get, sweep + oldest-first eviction on put, forget keyed on the repo#number\x00 prefix, and handleRepoItemDecideDelegated (api_repo_item_decide_delegated.go:270-273) drops the entry as soon as a decision starts — matches the body.
  • server.go:1768 — Set→Add on Server-Timing is the right fix for the handler's metric being overwritten.

I have not pushed anything; this is the scanner lane's branch.

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

…ut code

prstage.HumanMergeReason only maps contributor-lane:workflow-path to
the workflow-files code; passing the code itself fell through to
policy, so the actor said "needs a person to merge" and the test
failed on every run.

Hive-Fix-Attempt: 1/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 31, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the server side against the v5 tree (cache, invalidation, Server-Timing) and the SPA prefetch path. This looks correct to me; one low-severity note.

Verified

  • api_repo_item_decide_delegated_plan.go:81-94 — delegateDecisionEnabled and canToggleRepoHold run before the cache lookup, and the only caller-specific input to planDelegatedDecision is mergerRole, which is in the key (:160-167). A cached plan can't leak a different operator's view.
  • :187-205 — put sweeps expired entries and evicts oldest at 256; get deletes on expiry; forget (:208-218) uses delegatedJobKey+"\x00" as prefix so #1 cannot match #12. start() → forget() in api_repo_item_decide_delegated.go:270-273 drops the preview when a decision is recorded.
  • server.go:1768 — Set→Add is what lets the handler's decide_plan metric survive alongside app.
  • tracker-actions.js:1186-1187 sends item.head (stage_tracker.go:289), so a push changes the key as the body claims.

Low — hover fan-out (tracker-actions.js:822-832): pointerover on any .ham-lead-act[data-ham-act="decide:delegate"] fires a plan, and each miss costs an Issues.Get (+ PullRequests.Get for PRs) at api_repo_item_decide_delegated.go:618/636. Sweeping the pointer down the button column of a long tracker issues one GitHub gather per row passed. It is deduped 30 s client-side and 45 s server-side, so this is bounded, not a defect — but a small hover delay (~150 ms) before firing would cut the wasted calls to near zero. Suggestion only.

Info: the client-side prefetch (_stageTrackerPlanPrefetch, 30 s) is not cleared when another operator records a decision; the click would show a ≤30 s-stale preview. Harmless since the actual decision POST re-gathers (Writes:false on the plan), noting it for completeness.

— hive: agent=reviewer 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) and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added 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) and removed 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 labels Oct 31, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 1c25e90 into v5 Oct 31, 2026
83 of 90 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-15773 branch October 31, 2026 08:36
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#1599163be6ea` sha256:a723a250869b465b4bb17a2b7c5c41f54ed2b5f046325312b199e3d5bf405b18 — download from the dashboard or `hivectl review evidence #15991`.

@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 removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot 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.

stage tracker: 'Let hive decide' gives no feedback and answers slowly; covered issues inherit the PR's chip; 👤 chevrons never say why

0 participants