Skip to content

πŸ› stage tracker: 'Let hive decide' shows it is working and answers faster - #15793

Closed
clubanderson wants to merge 5 commits into
v5from
fix/let-hive-decide-busy-state
Closed

clubanderson wants to merge 5 commits into
v5from
fix/let-hive-decide-busy-state

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Closes #15773

Owner report: "when i click 'let hive decide' button - it takes a few seconds to open the dialog with what hive would do. can we have something - that is consistent with the rest of the activity tracker, that shows the button is working?" β€” and the follow-ups about #15503 inheriting PR #15759's chip, and "when i see 'pr in progress' on the chevron - i have no idea when it needs a human at that stage".

A. The button shows it is working

On click the lead chip is disabled, aria-busy="true", and reads Asking the hive… behind the tracker's existing working glyph (toast-spinner cue-acting-spin, the one the stage chips use). The preview dialog opens immediately as a skeleton β€” title "What the hive would do", subject, three shimmering placeholder lines, Cancel live, the primary disabled β€” and fills when the plan lands. A fetch error renders inline with Retry; the button restores. A second click while a plan is in flight is a no-op (aria-busy guard). Reduced motion: no spin, no shimmer. Tokens/components only; the webstatic style ratchets pass.

the Let hive decide chip busy with "Asking the hive…" and the skeleton preview dialog

B. The plan answers faster

  • POST …/decide-delegated/plan is served from a short-TTL single-flight cache keyed by (repo, number, head); a decision on the item invalidates it.
  • The SPA prefetches the plan when the row's decision options are revealed (hover / menu / popover), so by the time the operator clicks, the click is usually a cache hit.
  • The handler's independent GitHub reads (PR context, supersession lookup, head checks, file list, author permission) now run in parallel; the ladder's local half runs after the context lands.
  • Every response carries Server-Timing: decide_plan;dur=<ms>;desc=gather|cache and a debug log line with the duration.

Timings

Before (spoke 127.0.0.1:18099, cold every click):

item before
issue #15734 0.43–0.63 s
PR #15759 2.1–2.4 s
PR #15737 5.1 s
PR #15733 5.8–5.9 s

After (local build against api.github.com, which is the slower path):

item cold gather, sequential (pre-parallel) cold gather, parallel cached / prefetched
PR #15759 3.5 s 2.7 s 0 ms (desc=cache)
PR #15737 4.7 s 3.3 s 0 ms
PR #15733 5.3 s 3.1 s 0 ms

With prefetch-on-reveal the operator's click is served from cache in the normal case; when it is cold, the skeleton dialog is up at once and the cold path is ~40 % shorter.

C. Covered issues no longer carry the PR's button

An issue covered by a PR parked at 085 no longer inherits the PR's actionable "Let hive decide" chip. It shows a passive, muted decision pending on #N chip that scrolls to the PR row; its caption reads Covered by PR #N β€” waiting for a decision on the PR instead of "PR in progress πŸ‘€". Only the PR row carries the actionable button (decision_pending_on on the item; Go propagation + SPA render).

D. Every πŸ‘€ marker names its reason

New shared helper (stage_tracker_human_reason.go) produces human_reason (≀ 40 chars) for every human-actor item from the existing decision_needed / advisory / sentinel / merge-gate fields, e.g. "PR in progress Β· #15759 needs a decision", "Needs decision Β· security finding", "Needs decision Β· sentinel alert", "Ready for human merge Β· workflow files", "Advisory Β· read & close". The chevron label shows the word, a middot, and the reason; the full question is in the tooltip. A test asserts that every human-actor item has a non-empty human_reason. Existing 045/085 lead chips are kept.

Tests

  • Node: stage_tracker_decide_busy.test.js (busy state, double-click guard, error β†’ retry, skeleton, reduced motion), stage_tracker_covered_decision.test.js (passive chip, caption, PR keeps lead).
  • Go: api_repo_item_decide_delegated_plan_test.go (cache hit/miss/invalidate/single-flight, Server-Timing; no time.Sleep), stage_tracker_human_reason_test.go (propagation, covered-issue pending-on, every human marker has a reason).
  • go test ./pkg/dashboard/... and go vet green locally; check-api-reference-citations.sh --fix run.

Docs

src/docs/dashboard-sections.md ("Let hive decide"), src/docs/dashboard-sections/activity-monitor.md, changelog.d/fixed-let-hive-decide-busy-state.md.

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

@github-actions

github-actions Bot commented Oct 30, 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
#15748 πŸ› [reviewer] park PRs at 085 Needs decision when the fixer exhausted its attempts same files src/pkg/dashboard/stage_tracker_build.go
#15757 ✨ Auto-merge hive-authored superseding PRs without operator decision same files src/pkg/dashboard/api_repo_item_decide_delegated.go
#15804 ✨ Show the upgrade animation for every roll (announce + SIGTERM fallback) CONFLICT src/docs/api-reference/auth.md
src/docs/api-reference/dashboard-misc.md
src/docs/api-reference/health-status-events.md
src/docs/api-reference/snapshots-and-style.md
#15783 πŸ› stage tracker: Let hive decide shows it is working, covered issues drop the PR's chip, πŸ‘€ says why CONFLICT src/pkg/dashboard/static-src/js/tracker-actions.js
src/pkg/dashboard/static/index.html
#15771 🌱 refactor: split tracker row source CONFLICT src/pkg/dashboard/static-src/js/tracker-row.js
#15787 πŸ› Run the reconcile pass when wakes outpace the eval interval; age unblocked rows from the lift same files src/pkg/dashboard/stage_tracker_build.go
#15774 ✨ dashboard: onboarding and GitHub App errors point to the Getting Started guide same files src/docs/api-reference/auth.md
src/docs/api-reference/dashboard-misc.md
src/docs/api-reference/health-status-events.md
src/docs/api-reference/snapshots-and-style.md
src/pkg/dashboard/server.go
src/pkg/dashboard/static/index.html

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

@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 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

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 071-needs-author: conflicting

…ster

The clicked button goes disabled + aria-busy and reads 'Asking the hive…'
behind the tracker's working glyph, the row wears the in-flight caption,
and the preview opens at once as a skeleton (Cancel live, primary
disabled) that fills when the plan lands; a fetch failure shows inline
with Retry; a second click while the preview is open is ignored.

Server side the plan is cached for a short TTL keyed by (repo, number,
type, head, request words, merger role) and single-flighted; the SPA
prefetches it as the row's decision options come into view (lead chip
hover/focus, row menu, decision popover) so the click answers from the
cache. Server-Timing carries the gather duration and source; a debug log
line says the same. A decision on the item drops its plans.

Refs #15773

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…ker names its reason

Owner, on #15503 (a secondary issue under #15502, covered by PR #15759
parked at 085): why does the issue show 'Let hive decide' at all? And:
'when i see pr in progress on the chevron - i have no idea when it needs
a human at that stage'.

An issue riding a PR parked at 085 no longer inherits the PR's
actionable chip: the payload stamps decision_pending_on, drops the
issue's decision_needed and captions it 'Covered by PR #N β€” waiting for
a decision on the PR'; the SPA draws a passive, muted 'decision pending
on #N' chip that scrolls to the PR's row (Show-row affordance, now also
answering sub-row keys). A secondary issue whose covering PR is drawn
under the primary never offers that PR's decision even without the flag.

One Go helper words human_reason (≀40 chars) for every item whose next
mover is a person β€” from decision_needed, sentinel, advisory, merge-gate
and stage β€” and stageTrackerResolveHumanReasons stamps it on rows and
nested PRs; the chevron word carries it after a middot ('PR in progress
Β· #15759 needs a decision', 'Ready for human merge Β· workflow files')
with the full question in the tooltip. A matrix test asserts no human
marker ships without a reason.

Refs #15773

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
… chip and human_reason

Refs #15773

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
The plan endpoint read the PR context, the supersession lookup, the
head's checks, the file list and the author's permission one after the
other. They are independent, so they now fly together; the ladder's
local half (RepoPaused, AuthorTooling, ReworkPickedUp) runs after the
context lands. Cold plans drop from ~5.3 s to ~3.1 s on the slowest
items measured; cached ones stay at 0 ms.

Refs #15773

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/let-hive-decide-busy-state branch from 6bf21ae to 4fbd67a Compare October 30, 2026 15:16
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 30, 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

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 071-needs-author: conflicting

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 050-review-pending: required-check-pending:golangci-lint

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

Decision needed: @clubanderson should decide whether #15793 supersedes #15783 (both close #15773 and rewrite the same tracker-actions.js / tracker-row.js / index.html regions) so one of the two can be closed before either merges.

Conclusion: the server-side work here reads correct to me; the open question is that this PR and #15783 both resolve #15773 and conflict on the same client files, so only one can land as-is.

Overlap verified (read both diffs):

  • Both PRs cite #15773 and edit src/pkg/dashboard/static-src/js/tracker-actions.js, static-src/js/tracker-row.js, static-src/css/tracker.css, static/index.html, and docs/dashboard-sections/activity-monitor.md.
  • #15783 (hive-bot, client-only) implements parts A, C, D in JS: busy button, passive "decision pending on #N" chip, stageTrackerHumanReason in tracker-row.js.
  • #15793 implements A, C, D too, but moves the human-reason computation server-side (stage_tracker_human_reason.go, human_reason / decision_pending_on on the payload) and adds part B (plan cache, prefetch, parallel gather). The two are not identical content, so this is a conflict, not a redundant duplicate β€” merging one will leave the other unmergeable. Both already carry conflicts-with-open-pr.
  • Suggested survivor: this one, being the superset, if the server-side plan cache is wanted; otherwise #15783 is the smaller change. I have not closed anything.

Correctness read of the Go changes (what I checked):

  • api_repo_item_decide_delegated.go parallel gather: the goroutines read in.Conflicting / in.HiveAuthored, both set before wg.Add, while gatherDelegatedPRContext (delegated_pr_context.go:78-133) writes only HumanAuthor, OwnerAuthor, ContributorOnline, Competing, TrainDuplicate* β€” disjoint fields, no race. gatherDelegatedLadderLocal runs after wg.Wait(), so delegatedAuthorTooling(in.Labels, in.OwnerAuthor) and in.PersonAuthored() still see the context's values (same order of dependence as the old gatherDelegatedLadderInput).
  • delegated_plan_cache.go: key includes mergerRole, head, reason, caption, sentinel_reason; the SPA prefetch body is the click body plus prefetch: true (tracker-actions.js), and prefetch is not in the key, so the click is a hit. Failed gathers are dropped in finish; invalidate is called in handleRepoItemDecideDelegated before the job is created; TTL 0 disables. planDelegatedDecision takes no user identity, so sharing a cached plan across viewers with the same merger role is safe.
  • Minor, not a defect: when gatherDelegatedPRContext errors, the other four GitHub reads now still complete (cancel only fires via defer) β€” a little wasted traffic on the error path only.

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

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

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

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission β†’ 071-needs-author: reviewer-verdict:requires_human

@hivecommons-hive

Copy link
Copy Markdown
Contributor

superseded by #15783 (with credit to the original author)

Rationale: the contributor's PR is neither mergeable nor current, so the hive's supersedes it with credit.

Closed by the hive as the owner's delegate (rule prefer-contributor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. hive/superseded Closed by Hive: a different merged PR already landed this change 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

1 participant