Skip to content

πŸ› Activity Monitor: state why a human is needed on the row itself - #16624

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
fix/needs-human-reason
Nov 4, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
fix/needs-human-reason

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #16623

Problem

Activity Monitor rows parked on a person did not say why. hivecommons/docs#612 (issue at 045, capability blocker, covered by human PR #620) showed a bare muted needs human pill and Let hive decide β–Έ; rationguard#480 (PR at 085) read only "Needs human decision", and its issue #431 wore blocked purely because of that pending decision. The payload carried the reason in every case.

Changes

Row states the reason (JS, static-src/js)

  • tracker-human-attention.js: stageTrackerNeedsHumanAsk(item) synthesizes an ask from decision_needed / blocker for flagged rows the server leaves out of human_attention (085 PRs); the note line now reads #N β€” Needs human: <blocker.short> β€” <first sentence of the ask> Β· requested by <asked_by> Β· lead: <enabled option> β–Έ Β· @author is pushing it in #PR. A synthesized ask keeps the full decision_needed.question. Existing exact-line expectations are unchanged.
  • tracker-words-core.js: STAGE_TRACKER_NEEDS_HUMAN_SHORT map (workflow path β†’ "edits CI workflows", capability:workflows-permission β†’ "App lacks workflows permission", …), stageTrackerNeedsHumanShort/Word.
  • tracker-row.js: 045/085 active word becomes Needs human Β· <short>; a done issue decision column under a covering PR carries blockerNote.
  • tracker-row-strip.js: renders the blocker note (Blocked Β· App lacks workflows permission πŸ‘€, class ham-blocker-note); needs human pill becomes a <button class="ham-needs-human-pill"> with the full reason as title, click β†’ stageTrackerNeedsHumanReveal; blocked pill reads decision on #480 when the only cause is a linked PR parked at 085 (stageTrackerBlockedForDecisionPR).
  • tracker-motion.js: stageTrackerNeedsHumanReveal(rowKey) untucks and scrolls the row's note line.
  • tracker.css: .ham-seg.done.ham-blocker-note, .ham-needs-human-pill (tokens only, no raw font-size).

Lead action (tracker-actions.js)

  • stageTrackerDecideOptions honours the server's decide:delegate enabled:false / reason_if_disabled.
  • stageTrackerLeadAction: when delegate is server-disabled, the first enabled non-destructive blocker option leads (Grant the App workflows: write β–Έ β†’ opens its URL, else Re-check permissions β–Έ); stageTrackerLeadCompanion renders Let hive decide muted (ham-act-secondary, aria-disabled, reason tooltip).

Go

  • stage_tracker_caption.go: humanizeStageReason keeps blocked: <short> as-is (was "owed β€” blocked: App lacks…").

Tests

  • stage_tracker_needs_human_reason_test.go: docs#612 + rationguard#480/fix: handle repos with org prefix in dynamic repo listΒ #431 fixtures β€” blocker note with person glyph, pill button with reason, Needs human Β· edits CI workflows chevron word, decision on #480, lead = open:app-settings, delegate muted with reason, caption spacing, page wiring.
  • stage_tracker_human_attention.test.js: note line for fix: use advisory policy and preamble for non-quality agents at L3Β #612 (blocker + ask + asker + lead + @bob is pushing it in #620), synthesized 085 ask with the full question; closed/draft/held rows and evidence-less parked stages synthesize nothing.
  • Prelude lifts for the new words/consts.

Ran node --test src/pkg/dashboard/*.test.js (304 pass), cd src && go test ./pkg/dashboard/ -run 'StageTracker|Ratchet|SharedAsset' (ok), make dashboard-gen-check (ok).

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 4, 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 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 Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 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
#16625 πŸ› Keep a not-yet-run current-phase CI/Review chevron visibly filled same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#16621 πŸ› Activity Monitor: base-branch pill sits beside the repo chip same files src/pkg/dashboard/stage_tracker_human_attention.test.js
src/pkg/dashboard/stage_tracker_ui_prelude_test.go
src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#16622 πŸ› fix(dashboard): keep stale review verdicts known and name the failing perspective same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static-src/js/tracker-row-strip.js
src/pkg/dashboard/static/index.html
#16619 πŸ› fix(dashboard): preserve settled review verdicts and explain findings same files src/pkg/dashboard/static-src/js/tracker-row-strip.js
src/pkg/dashboard/static/index.html

@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 review (read head 58fffb1d; advisory β€” nothing here blocks the contract in #16623).

  1. needs human pill <button> skips the badge-button reset the repo already has β€” static-src/css/tracker.css:362 only sets cursor/font, while the sibling badge-as-button button.ham-decision-trigger (tracker.css:777) also zeroes margin/padding/border/background. No global button reset exists in base.css/design-system.css, so the new pill at tracker-row-strip.js:673 will carry the UA ButtonFace background and margins next to the <span> pills. Also the new block is indented at col 0 and wedged between .ham-seg.done.ham-fix-pushed and its ::before rule (tracker.css:357-365).

    -.ham-seg.done.ham-blocker-note { color: var(--amber); opacity: 1; }
    -/* The "needs human" pill is a button: click scrolls to the Needs human line. */
    -.ham-needs-human-pill { cursor: pointer; font: inherit; }
    -.ham-needs-human-pill:hover, .ham-needs-human-pill:focus-visible { text-decoration: underline; }
    +    .ham-seg.done.ham-blocker-note { color: var(--amber); opacity: 1; }
    +    /* The "needs human" pill is a button: click scrolls to the Needs human line. Same UA reset as ham-decision-trigger. */
    +    button.ham-needs-human-pill { cursor: pointer; margin: 0; background: transparent; font: inherit; color: inherit; line-height: inherit; text-align: inherit; }
    +    .ham-needs-human-pill:hover, .ham-needs-human-pill:focus-visible { text-decoration: underline; }

    (padding/border/radius come from .ham-badge at tracker.css:251.)

  2. Dead clause in asked_by β€” static-src/js/tracker-human-attention.js:41: actor.login && actor.kind === 'hive' && 'the hive' can only yield 'the hive', which is already the trailing fallback.

          return { kind: item.kind, number: Number(item.number) || 0, reason, question, asked_by: String(d.asked_by || '').trim() || 'the hive', synthetic: true };
    
  3. // Pure: on a non-pure helper β€” tracker-human-attention.js:55-62 labels stageTrackerNeedsHumanLeadLabel "Pure", but it reads window._hiveRole/_hiveUser via stageTrackerActionCtx (tracker-actions.js:193-199), the _stageTrackerRows global, and mutates ctx.rows. The file uses Pure: elsewhere for side-effect-free helpers; drop the prefix (and consider passing nowMs as the sibling at :174-175 does).

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

@hivecommons-hive

hivecommons-hive Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Read at 58fffb1 against merge-base c239bcb: tracker-human-attention.js, tracker-row-strip.js, tracker-actions.js, tracker-row.js, stage_tracker_caption.go and the new tests. The synthesis (stageTrackerNeedsHumanAsk), the server-disabled delegate handling, the decision on #N pill and the humanizeStageReason fix all read correctly to me, and every interpolated string goes through esc(). No defects found in the code itself. The one thing worth the author's attention before the rebase:

The rebase is semantic, not just textual. v5 picked up #16600 (ff4b0be) after this branch forked, and it set the canonical chevron rule β€” tracker-row-strip.js:298 "Only an active track carries words; an inactive one is its icon", and the inactive-fix branch at :478 was rewritten to icon-only for that reason. This PR adds words to a done segment: tracker-row-strip.js:287,374 renders sg.blockerNote as .ham-seg-t text on the issue's done decision column (tracker-row.js:104), styled amber at tracker.css:360, and stage_tracker_needs_human_reason_test.go:87-89 pins exactly that (Blocked Β· App lacks workflows permission visible on a done <li>). That is the same conflict hunk git reports, but resolving it textually would land the first done-with-words chevron one commit after v5 ruled them out.

Two consistent ways through, both the author's call: keep the done column icon + person glyph and move Blocked Β· <short> into its tooltip/aria-label (the note line this PR adds already states the reason in words), or amend the #16600 rule with an explicit "blocker-carrying done column" exception and say so at :298. The test at :87-89 follows whichever is chosen.

index.html is generated; make dashboard-gen after the rebase resolves that third conflict. Nothing else in the diff collides with v5.

Review findings from adjudicator (folded here because this head already carries its hive review):

Correctness review @ 58fffb1 (true merge-base is c239bcb / #16609; #16600 landed on the default branch in parallel).

The behaviour in the body is all implemented and the dashboard JS suite is green on this head (304/304, incl. the 14 in stage_tracker_human_attention.test.js). One blocker:

1. Branch does not merge onto the current default branch, and the new 010 "blocker note" contradicts the #16599 icon-only chevron rule that landed in #16600

git merge-tree d50707e2 58fffb1d conflicts in src/pkg/dashboard/static-src/js/tracker-row-strip.js, static-src/css/tracker.css and static/index.html. The conflict is semantic, not just textual: #16600 made every inactive chevron icon-only ("Inactive = icon only (#16599): … its caption rides the tooltip", tracker-row-strip.js fix-pushed branch on the default branch), while this PR's new branch at tracker-row-strip.js:374-381 renders a text caption on a done 010 segment:

} else if (blockerNote) {
  …
  inner = `<span class="ham-chevron-info config-info" …>${stageTrackerIcon(sg.number, 'ham-ico')}<span class="ham-chevron-copy"><span class="ham-seg-t">${esc(blockerNote)}</span></span>${stageTrackerIcon('human', …)}…`;

So after a rebase, the rule #16600 introduced (and its tests, e.g. stage_tracker_remediation_chevron.test.js "#16599: a settled verdict is the glyph alone") and #16623 expected-1 ("decision column keeps Blocked Β· App lacks workflows permission πŸ‘€") pull in opposite directions for the same chevron.

Requested change: rebase onto the current default branch and resolve the three conflicts, then rebuild static/index.html. For the 010 blocker note I'd follow the #16600 treatment β€” stage glyph + person glyph, word in the tooltip/aria-label β€” so the one-line band stays icon-only when inactive:

-          inner = `<span class="ham-chevron-info config-info" tabindex="0" title="" aria-label="${esc(noteTip)}" aria-describedby="${esc(tipID)}">${stageTrackerIcon(sg.number, 'ham-ico')}<span class="ham-chevron-copy"><span class="ham-seg-t">${esc(blockerNote)}</span></span>${stageTrackerIcon('human', 'ham-ico ham-actor-ico', 'Next move: human')}<span id="${esc(tipID)}" class="config-tooltip ham-chevron-tip" role="tooltip">${esc(noteTip)}</span></span>`;
+          // Inactive = icon only (hivecommons/hive#16599): the blocker word
+          // rides the tooltip; the person glyph marks who it waits on.
+          inner = `<span class="ham-chevron-info config-info" tabindex="0" title="" aria-label="${esc(noteTip)}" aria-describedby="${esc(tipID)}">${stageTrackerIcon(sg.number, 'ham-ico')}${stageTrackerIcon('human', 'ham-ico ham-actor-ico', 'Next move: human')}<span id="${esc(tipID)}" class="config-tooltip ham-chevron-tip" role="tooltip">${esc(noteTip)}</span></span>`;

(and drop the .ham-blocker-note .ham-seg-t rule in tracker.css accordingly). If the visible word is what you want despite #16599, say so in the PR body / tracker-row-strip.js comment as an explicit exemption so the next reader of #16600 doesn't "fix" it back. The tracker-row.js:100-104 blockerNote computation and the ham-blocker-note class are fine either way.

Verified OK (no action): window[action] dispatch for the new stageTrackerNeedsHumanReveal button (tooltips-dialogs.js:219), stageTrackerActionCtx is a fresh object and ensureRepoHoldPermission is cached (repos.js:608), linked_prs entries carry stage/modifiers/decision_needed/author_kind (stage_tracker.go:704-751), blocked: early return in stage_tracker_caption.go:343 runs before the ":"β†’": " replacer at :452, and the "decision on #PR" relabel is per #16623 expected-5.

hive/awaiting-ci: rebased onto v5 (conflicts in tracker.css / tracker-row-strip.js / generated index.html resolved keeping #16599's icon-only pushed-fix chevron alongside this PR's blocker-note branch; index.html regenerated from static-src). 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

Evidence bundle `#166241a25e2b` sha256:f7b00e2fa6b814b9bef11b51317417be839d9c1c731047ec155b1034ff152787 β€” download from the dashboard or `hivectl review evidence #16624`.

A row flagged needs-human renders its reason in the hive-note line
(blocker short + first sentence of the ask + asker + lead option +
who is pushing a covering PR), keeps the Blocked Β· <short> πŸ‘€ word in
the issue's decision column when a PR strip drives the row, turns the
needs-human pill into a reveal button with the full reason as hover,
captions the 085 chevron 'Needs human Β· <short reason>' from a small
map of known reasons, reads 'decision on #PR' on an issue blocked only
by its PR's pending decision, leads with the first enabled blocker
option when the server disables decide:delegate (rendered muted with
reason_if_disabled), and drops the double space in the
'owed β€” blocked:  …' caption.

Fixes #16623

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive
hivecommons-hive Bot force-pushed the fix/needs-human-reason branch from 58fffb1 to 1a25e2b Compare November 4, 2026 17:10
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is back in your court (stage/071-needs-author). Its commits are signed off as the hive App rather than as you, so a squash merge would misattribute them and the sign-off attribution check stays red. No hive agent can rewrite a contributor's commits β€” the fix is yours:

  • 1 commit is signed off as the hive App instead of you, so a squash merge would misattribute it β€” set git config user.email to your own address, then run git commit --amend --reset-author -s && git push --force-with-lease

Once the new head lands, CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive
hivecommons-hive Bot merged commit 352163f into v5 Nov 4, 2026
83 of 87 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/needs-human-reason branch November 4, 2026 17:17
@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 1a25e2b.

@github-actions

github-actions Bot commented Nov 4, 2026

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.

Read the JS at 1a25e2b against the rest of static-src/js and ran the dashboard test standalone. Looks correct to me.

What I verified:

  • The new needs human pill at tracker-row-strip.js:784 dispatches data-action="stageTrackerNeedsHumanReveal" through the generic resolver (tooltips-dialogs.js:219, HIVE_GEN_HANDLERS[action] || window[action]), the same path the existing note toggle at tracker-motion.js:353 uses; stageTrackerNeedsHumanReveal is declared at the same scope as stageTrackerNoteToggle (tracker-motion.js:289 / :298), so it resolves identically.
  • stageTrackerNeedsHumanLeadLabel (tracker-human-attention.js:58-66) sets ctx.rows on the object stageTrackerActionCtx returns; that function builds a fresh literal per call (tracker-actions.js:193-200), so nothing shared is mutated. It calls into stageTrackerLeadActionOnRow (tracker-actions.js:564), which does not call back into the human-attention helpers, so no recursion.
  • stageTrackerNeedsHumanAsk only synthesizes when the server put a reason on the row (question / blocker.detail / decision_needed.blocker / blocker.short / human actor why); a bare 045/085 stage returns null (tracker-human-attention.js:38-40), matching the comment's intent.
  • humanizeStageReason's blocked: early return (stage_tracker_caption.go:343-345) sits before the generic replacer, which is where the : double space came from.
  • node --test src/pkg/dashboard/stage_tracker_human_attention.test.js at this head: 14/14 pass, including the two new scenarios (covered issue on a capability blocker; 085 PR without human_attention).

One info-level nit, no action required: in stageTrackerNeedsHumanAsk (tracker-human-attention.js:41) the asked_by expression d.asked_by || actor.login && actor.kind === 'hive' && 'the hive' || '' is followed by || 'the hive', so the middle clause can never change the result β€” every synthetic ask without asked_by reads "asked by the hive" regardless of stage_actor. That is the right default; the clause is just dead.

CI note: Sign-off survives the squash and native-queue-policy show CANCELLED and mobile-shots has no conclusion at this head β€” looks like a re-run was interrupted rather than a failure in the diff. Not a finding.

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

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: a row parked on a human never states WHY a human is needed

1 participant