Repository navigation
π stage tracker: 'Let hive decide' shows it is working and answers faster - #15793
clubanderson wants to merge 5 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
c7452da to
6bf21ae
Compare
|
@clubanderson this PR is held at 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. |
|
@clubanderson this PR is held at 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. |
|
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>
6bf21ae to
4fbd67a
Compare
|
@clubanderson this PR is held at 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. |
|
stage 080-awaiting-merge-admission β 071-needs-author: conflicting |
|
stage 080-awaiting-merge-admission β 050-review-pending: required-check-pending:golangci-lint |
There was a problem hiding this comment.
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, anddocs/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,
stageTrackerHumanReasonintracker-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_onon 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 carryconflicts-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.goparallel gather: the goroutines readin.Conflicting/in.HiveAuthored, both set beforewg.Add, whilegatherDelegatedPRContext(delegated_pr_context.go:78-133) writes onlyHumanAuthor,OwnerAuthor,ContributorOnline,Competing,TrainDuplicate*β disjoint fields, no race.gatherDelegatedLadderLocalruns afterwg.Wait(), sodelegatedAuthorTooling(in.Labels, in.OwnerAuthor)andin.PersonAuthored()still see the context's values (same order of dependence as the oldgatherDelegatedLadderInput).delegated_plan_cache.go: key includesmergerRole,head,reason,caption,sentinel_reason; the SPA prefetch body is the click body plusprefetch: true(tracker-actions.js), andprefetchis not in the key, so the click is a hit. Failed gathers are dropped infinish;invalidateis called inhandleRepoItemDecideDelegatedbefore the job is created; TTL 0 disables.planDelegatedDecisiontakes no user identity, so sharing a cached plan across viewers with the same merger role is safe.- Minor, not a defect: when
gatherDelegatedPRContexterrors, the other four GitHub reads now still complete (cancel only fires viadefer) β a little wasted traffic on the error path only.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@clubanderson this PR is held at 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. |
|
stage 080-awaiting-merge-admission β 071-needs-author: reviewer-verdict:requires_human |
|
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 |
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.B. The plan answers faster
POST β¦/decide-delegated/planis served from a short-TTL single-flight cache keyed by (repo, number, head); a decision on the item invalidates it.Server-Timing: decide_plan;dur=<ms>;desc=gather|cacheand a debug log line with the duration.Timings
Before (spoke
127.0.0.1:18099, cold every click):After (local build against api.github.com, which is the slower path):
desc=cache)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_onon the item; Go propagation + SPA render).D. Every π€ marker names its reason
New shared helper (
stage_tracker_human_reason.go) produceshuman_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-emptyhuman_reason. Existing 045/085 lead chips are kept.Tests
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).api_repo_item_decide_delegated_plan_test.go(cache hit/miss/invalidate/single-flight, Server-Timing; notime.Sleep),stage_tracker_human_reason_test.go(propagation, covered-issue pending-on, every human marker has a reason).go test ./pkg/dashboard/...andgo vetgreen locally;check-api-reference-citations.sh --fixrun.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.