From 79c546e0eb2103dd4658c9cf6ae1797b8c3e9d46 Mon Sep 17 00:00:00 2001 From: thatguywob Date: Wed, 4 Nov 2026 16:24:52 +0000 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=90=9B=20fix:=20preserve=20settled=20?= =?UTF-8?q?current-head=20activity=20verdicts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep review and CI verdicts known as observations age, and expose current-head perspective findings in review captions and tooltips. Hive-Run: hivecommons/hive#16617 Hive-Plan: activity-monitor-review-verdict Hive-Spec: hivecommons/hive#16617#fix Signed-off-by: thatguywob Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> --- changelog.d/fixed-16617-review-activity.md | 1 + src/pkg/dashboard/stage_tracker_activity.go | 62 +++++++++++- .../dashboard/stage_tracker_activity.test.js | 98 ++++++++++++++++++- .../dashboard/stage_tracker_activity_test.go | 57 +++++++++++ .../static-src/js/tracker-row-strip.js | 28 ++++-- src/pkg/dashboard/static/index.html | 28 ++++-- 6 files changed, 257 insertions(+), 17 deletions(-) create mode 100644 changelog.d/fixed-16617-review-activity.md diff --git a/changelog.d/fixed-16617-review-activity.md b/changelog.d/fixed-16617-review-activity.md new file mode 100644 index 0000000000..a2edad58bc --- /dev/null +++ b/changelog.d/fixed-16617-review-activity.md @@ -0,0 +1 @@ +- The Activity Monitor preserves settled review and CI verdicts on the current head as observations age, and review tooltips list each perspective’s verdict and finding with the observation age ([#16617](https://github.com/hivecommons/hive/issues/16617)). diff --git a/src/pkg/dashboard/stage_tracker_activity.go b/src/pkg/dashboard/stage_tracker_activity.go index e85ee45610..c9ef5e49cd 100644 --- a/src/pkg/dashboard/stage_tracker_activity.go +++ b/src/pkg/dashboard/stage_tracker_activity.go @@ -43,8 +43,18 @@ type StageTrackerActivity struct { // the swarm's expected set for this PR (configured perspectives plus any // extra one dispatched or reported for the head), Done the ones with a // verdict for the current head. - PerspectivesDone int `json:"perspectives_done,omitempty"` - PerspectivesTotal int `json:"perspectives_total,omitempty"` + PerspectivesDone int `json:"perspectives_done,omitempty"` + PerspectivesTotal int `json:"perspectives_total,omitempty"` + Perspectives []StageTrackerPerspective `json:"perspectives,omitempty"` +} + +// StageTrackerPerspective describes the latest bundle verdict for one perspective +// on the current head, preserving dissent across reviewers. Summary is the +// first finding, when one was reported. +type StageTrackerPerspective struct { + Name string `json:"name"` + Verdict string `json:"verdict"` + Summary string `json:"summary"` } const trackerActivityFreshWindow = 2 * time.Minute @@ -439,6 +449,37 @@ func trackerLatestBundleVerdicts(bundle *evidence.Bundle) []evidence.Verdict { return out } +func trackerReviewPerspectives(bundle *evidence.Bundle) []StageTrackerPerspective { + latest := map[string]evidence.Verdict{} + for _, verdict := range trackerLatestBundleVerdicts(bundle) { + if verdict.Perspective == "" { + continue + } + previous, ok := latest[verdict.Perspective] + // Each backend/model has its own current verdict. An approval by + // another reviewer must not hide dissent that still blocks the head. + if !ok || (previous.Verdict == "approve" && verdict.Verdict != "approve") || + ((previous.Verdict == "approve") == (verdict.Verdict == "approve") && verdict.RecordedAt.After(previous.RecordedAt)) { + latest[verdict.Perspective] = verdict + } + } + names := make([]string, 0, len(latest)) + for name := range latest { + names = append(names, name) + } + slices.Sort(names) + out := make([]StageTrackerPerspective, 0, len(names)) + for _, name := range names { + v := latest[name] + p := StageTrackerPerspective{Name: name, Verdict: v.Verdict} + if len(v.Findings) > 0 { + p.Summary = v.Findings[0].Summary + } + out = append(out, p) + } + return out +} + func trackerBundleApproves(bundle *evidence.Bundle, agg *review.Aggregate) bool { latest := trackerLatestBundleVerdicts(bundle) if len(latest) == 0 || len(agg.Perspectives) == 0 { @@ -515,6 +556,7 @@ func stageTrackerReviewActivity(pr github.PullRequest, bundle *evidence.Bundle, qualify := stageTrackerRepoQualifier(status) if bundle != nil && trackerHeadMatches(pr.Repo, pr.Number, pr.HeadSHA, bundle.Repo, bundle.Number, bundle.HeadSHA) { out.Source, out.ObservedAt = "verified-review-bundle", timePtr(bundle.UpdatedAt) + out.Perspectives = trackerReviewPerspectives(bundle) for _, verdict := range trackerLatestBundleVerdicts(bundle) { if !verdict.RecordedAt.IsZero() && (out.Since == nil || verdict.RecordedAt.After(*out.Since)) { at := verdict.RecordedAt @@ -639,6 +681,22 @@ func stageTrackerReviewActivity(pr github.PullRequest, bundle *evidence.Bundle, break } } + if out.State == "changes_requested" || out.State == "human_decision" { + for _, perspective := range out.Perspectives { + if perspective.Verdict == "changes_requested" || perspective.Verdict == "reject" || perspective.Verdict == "requires_human" { + mark := "✗" + if perspective.Verdict == "requires_human" { + mark = "requires human" + } + out.Caption += " · " + perspective.Name + " " + mark + if perspective.Summary != "" { + out.Caption += ": " + perspective.Summary + } + break + } + } + } + return out } diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 41ca00b281..3c3cd15420 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -561,7 +561,7 @@ test('old-head or stale observations cannot fabricate running/completion, but do } else { assert.match(cells.ci, /active ham-current[^]*CI \?\/\? · running { + for (const [kind, state, caption] of [ + ['review', 'approved', 'Review approved'], + ['review', 'changes_requested', 'Review findings · correctness ✗: handle the stale verdict'], + ['review', 'human_decision', 'Review findings · needs owner sign-off'], + ['ci', 'passing', 'CI green'], + ['ci', 'failing', 'CI failing · build red'], + ]) { + for (const observed of [new Date(now - 15 * 60000).toISOString(), undefined, 'invalid', new Date(now + 60000).toISOString()]) { + const a = { ...activity(state, caption), observed_at: observed }; + const item = { kind: 'pr', head: 'head', [kind + '_activity']: a }; + const html = track(item, kind, {}, false, now); + assert.match(html, /data-display-state="known"/); + assert.ok(html.includes(caption), state + ': caption preserved'); + assert.doesNotMatch(html, /activity unknown|last observed|data-motion/); + if (observed === undefined || observed === 'invalid') assert.match(html, /observation time unknown/); + else if (Date.parse(observed) > now) assert.match(html, /observation time in future/); + else assert.match(html, /observed 15m ago/); + item.head = 'new-head'; + const pushed = track(item, kind, {}, false, now); + assert.match(pushed, /data-display-state="unknown"/); + assert.doesNotMatch(pushed, /data-verdict=|correctness|build red/); + } + } +}); + +test('motion needs a fresh observation even when the backend active flag is cached', () => { + for (const [kind, state] of [['review', 'reviewing'], ['review', 'adjudicating'], ['review', 'assigned'], ['ci', 'running'], ['ci', 'queued']]) { + for (const observed of [new Date(now - 15 * 60000).toISOString(), undefined, new Date(now + 60000).toISOString()]) { + const item = { kind: 'pr', head: 'head', [kind + '_activity']: { ...activity(state, 'Work observed', true), observed_at: observed } }; + const html = track(item, kind, {}, false, now); + assert.match(html, /data-display-state="unknown"/); + assert.match(html, /activity unknown/); + assert.doesNotMatch(html, /data-motion/); + } + } +}); + +test('review tooltip lists escaped perspective verdicts before current-head provenance', () => { + const summary = ' & check the current head'; + const caption = 'Review findings · correctness ✗: ' + summary; + const item = { kind: 'pr', head: 'head', review_activity: { + ...activity('changes_requested', caption), source: 'verified-review-bundle', + observed_at: new Date(now - 15 * 60000).toISOString(), blocker: summary, + perspectives: [ + { name: 'correctness', verdict: 'changes_requested', summary }, + { name: 'security', verdict: 'approve', summary: '' }, + { name: 'quality', verdict: 'reject', summary: 'explain the edge case' }, + ], + } }; + const html = track(item, 'review', {}, false, now); + const tip = html.match(/role="tooltip">([^]*?)<\/span>/)[1]; + assert.ok(tip.includes(esc(caption) + '
correctness ✗: ' + esc(summary))); + assert.match(tip, /
security ✓
quality ✗: explain the edge case
head head · verified-review-bundle · observed 15m ago/); + assert.doesNotMatch(html, / { + const a = { ...activity('human_decision', 'Review findings · needs owner sign-off'), + observed_at: new Date(now - 15 * 60000).toISOString(), + perspectives: [{ name: 'correctness', verdict: 'requires_human', summary: 'Choose whether to keep the API break' }] }; + const item = { kind: 'pr', head: 'head', review_activity: a }; + for (const state of ['human_decision', 'changes_requested']) { + a.state = state; + const html = track(item, 'review', {}, false, now); + assert.match(html, /correctness requires human: Choose whether to keep the API break
correctness requires human: Choose whether to keep the API break
head/); + assert.doesNotMatch(html, /activity unknown|last observed/); + } + for (const state of ['reviewing', 'unknown']) { + a.state = state; + a.caption = 'Review activity unknown'; + const html = track(item, 'review', {}, false, now); + assert.match(html, /data-display-state="unknown"/); + assert.doesNotMatch(html, /correctness|API break|requires human/); + } +}); + +test('a settled failing CI verdict preserves fresh motion from other running checks', () => { + const item = { kind: 'pr', head: 'head', ci_activity: { + ...activity('failing', 'CI failing · build red · other checks still running', true), + checks_failed: 1, checks_total: 2, checks_failing: ['build'], + } }; + const fresh = track(item, 'ci', {}, false, now); + assert.match(fresh, /data-activity-state="failing"/); + assert.match(fresh, /data-display-state="known"/); + assert.match(fresh, /data-motion="active"/); + const stale = track(item, 'ci', {}, false, now + 15 * 60000); + assert.match(stale, /data-activity-state="failing"/); + assert.match(stale, /data-display-state="known"/); + assert.match(stale, /observed 15m ago/); + assert.doesNotMatch(stale, /data-motion|activity unknown|last observed/); +}); diff --git a/src/pkg/dashboard/stage_tracker_activity_test.go b/src/pkg/dashboard/stage_tracker_activity_test.go index 6c58028cc8..8b113db02e 100644 --- a/src/pkg/dashboard/stage_tracker_activity_test.go +++ b/src/pkg/dashboard/stage_tracker_activity_test.go @@ -1,7 +1,9 @@ package dashboard import ( + "encoding/json" "os/exec" + "reflect" "strings" "testing" "time" @@ -485,3 +487,58 @@ func TestStageTrackerActivityReviewPerspectiveCounts(t *testing.T) { t.Fatalf("old-head evidence leaked into counts: %d/%d", got.PerspectivesDone, got.PerspectivesTotal) } } + +func TestStageTrackerReviewPerspectiveDetails(t *testing.T) { + now := time.Date(2026, 11, 4, 3, 0, 0, 0, time.UTC) + observed := now.Add(-15 * time.Minute) + pr := github.PullRequest{Repo: "org/repo", Number: 7, HeadSHA: "head"} + bundle := &evidence.Bundle{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, UpdatedAt: observed, + Verdicts: []evidence.Verdict{ + {Perspective: "security", Verdict: "approve", RecordedAt: observed}, + {Perspective: "correctness", Backend: "old", Verdict: "approve", RecordedAt: observed.Add(-time.Minute)}, + {Perspective: "correctness", Backend: "new", Verdict: "changes_requested", RecordedAt: observed, + Findings: []evidence.Finding{{Summary: "do not discard the settled verdict"}}}, + {Perspective: "quality", Verdict: "changes_requested", RecordedAt: observed.Add(-time.Minute), + Findings: []evidence.Finding{{Summary: "superseded finding"}}}, + {Perspective: "quality", Verdict: "approve", RecordedAt: observed}, + {Verdict: "reject", RecordedAt: observed}, + }} + want := []StageTrackerPerspective{ + {Name: "correctness", Verdict: "changes_requested", Summary: "do not discard the settled verdict"}, + {Name: "quality", Verdict: "approve"}, + {Name: "security", Verdict: "approve"}, + } + for _, verdict := range []review.Verdict{"changes_requested", "requires_human"} { + agg := &review.Aggregate{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Verdict: verdict} + got := stageTrackerReviewActivity(pr, bundle, agg, review.DispatchState{}, nil, now) + if !reflect.DeepEqual(got.Perspectives, want) || !strings.Contains(got.Caption, "correctness ✗: do not discard the settled verdict") || got.Active { + t.Fatalf("settled review lost its current-head perspective details: %+v", got) + } + data, err := json.Marshal(got) + if err != nil || !strings.Contains(string(data), `"perspectives":[{"name":"correctness","verdict":"changes_requested","summary":"do not discard the settled verdict"}`) { + t.Fatalf("perspective wire fields missing: %s, %v", data, err) + } + } + bundle.Verdicts[2].Verdict = "requires_human" + agg := &review.Aggregate{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Verdict: "requires_human"} + got := stageTrackerReviewActivity(pr, bundle, agg, review.DispatchState{}, nil, now) + if got.State != "human_decision" || !strings.Contains(got.Caption, "correctness requires human: do not discard the settled verdict") || got.Perspectives[0].Verdict != "requires_human" { + t.Fatalf("human perspective was not explained: %+v", got) + } + bundle.Verdicts[2].Verdict = "changes_requested" + // Approval from another backend must not replace still-current dissent. + bundle.Verdicts = append(bundle.Verdicts, evidence.Verdict{Perspective: "correctness", Backend: "z", Verdict: "approve", RecordedAt: observed.Add(time.Minute)}) + if got := trackerReviewPerspectives(bundle); !reflect.DeepEqual(got, want) { + t.Fatalf("newer approval from another backend hid a finding: %+v", got) + } + for _, other := range []github.PullRequest{ + {Repo: pr.Repo, Number: pr.Number, HeadSHA: "new-head"}, + {Repo: "other/repo", Number: pr.Number, HeadSHA: pr.HeadSHA}, + {Repo: pr.Repo, Number: 8, HeadSHA: pr.HeadSHA}, + } { + got := stageTrackerReviewActivity(other, bundle, nil, review.DispatchState{}, nil, now) + if got.State != "unknown" || len(got.Perspectives) != 0 || strings.Contains(got.Caption, "correctness") { + t.Fatalf("unrelated review details leaked: %+v", got) + } + } +} diff --git a/src/pkg/dashboard/static-src/js/tracker-row-strip.js b/src/pkg/dashboard/static-src/js/tracker-row-strip.js index a57190b1bb..23c3179023 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -234,7 +234,7 @@ // a finding, pending and decided are words in their colour on the muted // field — only a running track is filled (hivecommons/hive#16540); not // started = the empty chevron with the glyph alone. Freshness gates only - // the pulse. + // the pulse and certainty of motion; settled current-head verdicts persist. function stageTrackerActivityTrackHtml(item, kind, sg, blank, nowMs, opts) { if (blank) return ``; const name = kind === 'ci' ? 'CI' : 'Review'; @@ -247,8 +247,19 @@ const stale = Number.isFinite(observed) && (clock - observed > activityFreshMS || observed > clock); const current = sg.state === 'active'; const state = matches ? a.state || 'unknown' : 'unknown'; - const known = matches && state !== 'unknown' && Number.isFinite(observed) && !stale; - const active = known && a.active; + const moving = ['running', 'queued', 'reviewing', 'adjudicating', 'assigned'].includes(state); + const fresh = Number.isFinite(observed) && !stale; + const known = matches && state !== 'unknown' && (!moving || fresh); + const active = known && fresh && a.active; + const perspectives = known && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; + const perspectiveMark = verdict => verdict === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(verdict) ? '✗' : verdict === 'requires_human' ? 'requires human' : verdict || '?'; + const perspectiveLine = p => String(p.name || 'Perspective') + ' ' + perspectiveMark(p.verdict) + (p.summary ? ': ' + p.summary : ''); + // A repair projection can rewrite the generic caption; keep its first + // finding visible without changing the backend's settled verdict. + if (['changes_requested', 'human_decision'].includes(state)) { + const firstFinding = perspectives.find(p => ['changes_requested', 'reject', 'requires_human'].includes(p.verdict)); + if (firstFinding && !caption.includes(perspectiveLine(firstFinding))) caption += ' · ' + perspectiveLine(firstFinding); + } if (matches && !known && state !== 'unknown') caption = name + ' activity unknown · last observed ' + state + ' · ' + caption; const ownsPR = item.kind === 'pr' || item.via_pr; const text = typeof stageTrackerTrackWord === 'function' ? stageTrackerTrackWord(item, kind, current) : (matches ? a.caption || name + ' ' + state : ''); @@ -272,9 +283,11 @@ const humanAction = approvalPending > 0 ? STAGE_TRACKER_WORKFLOW_APPROVAL_TIP : kind === 'review' && state === 'human_decision' ? 'Needs a person\'s decision' : ''; const personIco = stalled && humanAction ? stageTrackerIcon('human', 'ham-ico ham-actor-ico', humanAction) : ''; const source = matches ? a.source || 'unavailable' : 'unavailable'; - const freshness = !Number.isFinite(observed) ? 'observation time unknown' : (stale ? 'stale · ' : 'observed · ') + new Date(observed).toISOString(); + const age = Math.max(0, Math.floor((clock - observed) / 60000)); + const ago = age < 1 ? 'just now' : age < 60 ? age + 'm ago' : age < 1440 ? Math.floor(age / 60) + 'h ago' : Math.floor(age / 1440) + 'd ago'; + const freshness = !Number.isFinite(observed) ? 'observation time unknown' : observed > clock ? 'observation time in future · ' + new Date(observed).toISOString() : 'observed ' + ago + (stale && moving ? ' · stale' : '') + ' · ' + new Date(observed).toISOString(); const since = matches && a.since && Number.isFinite(Date.parse(a.since)) ? ' · since ' + new Date(a.since).toISOString() : ''; - let blocker = matches && a.blocker ? ' · ' + a.blocker : ''; + let blocker = matches && a.blocker && !caption.includes(a.blocker) ? ' · ' + a.blocker : ''; // A sign-off ask: the tooltip carries the question itself (who should // decide what, and why — "workflow change from a fork") when the // review evidence did not already quote it. @@ -283,7 +296,8 @@ // The backend's plain-language sentence behind the caption rides in // the tooltip only; the chevron clamps the caption. const detail = matches && a.detail ? ' · ' + a.detail : ''; - let tip = caption + blocker + detail + ' · head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since; + const perspectiveLines = perspectives.map(perspectiveLine); + let tip = [caption + blocker + detail, ...perspectiveLines, 'head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since].join('\n'); const code = item.code_activity; const codeNote = code && code.head === item.head && Number(item.display_column) === 50 && ((kind === 'review' && code.state === 'waiting_fixer') || (kind === 'ci' && code.state === 'waiting_ci')) ? code.caption : ''; @@ -317,7 +331,7 @@ (lead ? ' · hive is waiting on ' + lead.waitingOn + (lead.newHead && sha7 ? ' for new head ' + sha7 : '') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); const copy = `${evidenceLink}${personIco}`; - return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; + return `
  • ${copy}${esc(fullTip).replaceAll('\n', '
    ')}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index e9518324d7..cc06bf97db 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -18032,7 +18032,7 @@

    Where to get help

    // a finding, pending and decided are words in their colour on the muted // field — only a running track is filled (hivecommons/hive#16540); not // started = the empty chevron with the glyph alone. Freshness gates only - // the pulse. + // the pulse and certainty of motion; settled current-head verdicts persist. function stageTrackerActivityTrackHtml(item, kind, sg, blank, nowMs, opts) { if (blank) return ``; const name = kind === 'ci' ? 'CI' : 'Review'; @@ -18045,8 +18045,19 @@

    Where to get help

    const stale = Number.isFinite(observed) && (clock - observed > activityFreshMS || observed > clock); const current = sg.state === 'active'; const state = matches ? a.state || 'unknown' : 'unknown'; - const known = matches && state !== 'unknown' && Number.isFinite(observed) && !stale; - const active = known && a.active; + const moving = ['running', 'queued', 'reviewing', 'adjudicating', 'assigned'].includes(state); + const fresh = Number.isFinite(observed) && !stale; + const known = matches && state !== 'unknown' && (!moving || fresh); + const active = known && fresh && a.active; + const perspectives = known && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; + const perspectiveMark = verdict => verdict === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(verdict) ? '✗' : verdict === 'requires_human' ? 'requires human' : verdict || '?'; + const perspectiveLine = p => String(p.name || 'Perspective') + ' ' + perspectiveMark(p.verdict) + (p.summary ? ': ' + p.summary : ''); + // A repair projection can rewrite the generic caption; keep its first + // finding visible without changing the backend's settled verdict. + if (['changes_requested', 'human_decision'].includes(state)) { + const firstFinding = perspectives.find(p => ['changes_requested', 'reject', 'requires_human'].includes(p.verdict)); + if (firstFinding && !caption.includes(perspectiveLine(firstFinding))) caption += ' · ' + perspectiveLine(firstFinding); + } if (matches && !known && state !== 'unknown') caption = name + ' activity unknown · last observed ' + state + ' · ' + caption; const ownsPR = item.kind === 'pr' || item.via_pr; const text = typeof stageTrackerTrackWord === 'function' ? stageTrackerTrackWord(item, kind, current) : (matches ? a.caption || name + ' ' + state : ''); @@ -18070,9 +18081,11 @@

    Where to get help

    const humanAction = approvalPending > 0 ? STAGE_TRACKER_WORKFLOW_APPROVAL_TIP : kind === 'review' && state === 'human_decision' ? 'Needs a person\'s decision' : ''; const personIco = stalled && humanAction ? stageTrackerIcon('human', 'ham-ico ham-actor-ico', humanAction) : ''; const source = matches ? a.source || 'unavailable' : 'unavailable'; - const freshness = !Number.isFinite(observed) ? 'observation time unknown' : (stale ? 'stale · ' : 'observed · ') + new Date(observed).toISOString(); + const age = Math.max(0, Math.floor((clock - observed) / 60000)); + const ago = age < 1 ? 'just now' : age < 60 ? age + 'm ago' : age < 1440 ? Math.floor(age / 60) + 'h ago' : Math.floor(age / 1440) + 'd ago'; + const freshness = !Number.isFinite(observed) ? 'observation time unknown' : observed > clock ? 'observation time in future · ' + new Date(observed).toISOString() : 'observed ' + ago + (stale && moving ? ' · stale' : '') + ' · ' + new Date(observed).toISOString(); const since = matches && a.since && Number.isFinite(Date.parse(a.since)) ? ' · since ' + new Date(a.since).toISOString() : ''; - let blocker = matches && a.blocker ? ' · ' + a.blocker : ''; + let blocker = matches && a.blocker && !caption.includes(a.blocker) ? ' · ' + a.blocker : ''; // A sign-off ask: the tooltip carries the question itself (who should // decide what, and why — "workflow change from a fork") when the // review evidence did not already quote it. @@ -18081,7 +18094,8 @@

    Where to get help

    // The backend's plain-language sentence behind the caption rides in // the tooltip only; the chevron clamps the caption. const detail = matches && a.detail ? ' · ' + a.detail : ''; - let tip = caption + blocker + detail + ' · head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since; + const perspectiveLines = perspectives.map(perspectiveLine); + let tip = [caption + blocker + detail, ...perspectiveLines, 'head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since].join('\n'); const code = item.code_activity; const codeNote = code && code.head === item.head && Number(item.display_column) === 50 && ((kind === 'review' && code.state === 'waiting_fixer') || (kind === 'ci' && code.state === 'waiting_ci')) ? code.caption : ''; @@ -18115,7 +18129,7 @@

    Where to get help

    (lead ? ' · hive is waiting on ' + lead.waitingOn + (lead.newHead && sha7 ? ' for new head ' + sha7 : '') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); const copy = `${evidenceLink}${personIco}`; - return `
  • ${copy}${esc(fullTip)}${decided ? `${decided}` : ''}
  • `; + return `
  • ${copy}${esc(fullTip).replaceAll('\n', '
    ')}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an From 1fd63c41995badd68acde4e5d02630872c5352e7 Mon Sep 17 00:00:00 2001 From: thatguywob Date: Wed, 4 Nov 2026 16:54:01 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=90=9B=20fix(test):=20align=20activit?= =?UTF-8?q?y=20geometry=20probe=20with=20icon-only=20lanes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep current-phase and filled active-lane assertions, while checking inactive CI/Review lanes for their state icon and accessible count words after the chevron update. Signed-off-by: thatguywob --- .../webstatic/testdata/tracker-header-geometry.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js index 25644876b6..654a297121 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js @@ -210,8 +210,15 @@ if (cell.dataset.activityState) coverage.states[cell.dataset.activityState] = (coverage.states[cell.dataset.activityState] || 0) + 1; if (cell.dataset.routeState?.split(' ').includes('active')) { assert(cell.classList.contains('ham-current'), name + 'current phase remains highlighted independently of work'); - const style = getComputedStyle(cell); - assert(Number(style.opacity) >= 0.9 && style.backgroundColor !== 'rgba(0, 0, 0, 0)' && style.backgroundColor !== 'transparent', name + 'queued/unknown/assigned/completed current tracks retain a visible steady fill'); + if (cell.classList.contains('active') || !cell.dataset.track) { + const style = getComputedStyle(cell); + assert(Number(style.opacity) >= 0.9 && style.backgroundColor !== 'rgba(0, 0, 0, 0)' && style.backgroundColor !== 'transparent', name + 'active and stalled current tracks retain a visible steady fill'); + } else { + // Inactive CI/Review lanes keep their current-phase location but + // render only the state-coloured icon (#16599); words stay in the label. + const words = cell.querySelector('.ham-track-state')?.innerText.trim() || ''; + assert(!!cell.querySelector('svg') && words === '' && /\b(CI|Review): (CI|Review)\b/.test(cell.getAttribute('aria-label') || ''), name + 'inactive current tracks retain an icon with their words in the label'); + } } if (cell.dataset.track) { // CI / Review lanes are chevrons like their neighbours: same notch From 598099676c55dc61b41c9707d4d8da8d77c5a17f Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:20:08 -0500 Subject: [PATCH 3/7] fix(dashboard): escape tooltip lines before joining and age moving review states Addresses the review-swarm findings on #16619: - Production esc() flattens newlines to spaces, so escaping the whole tooltip before substituting
    never produced line breaks. Split the tooltip into lines first, escape each, then join with
    . The JS test stub esc() now mirrors production so the test exercises the real path. - The known rule deny-listed moving states, leaving unassigned and waiting_ci (emitted by v5) known forever once stale. Use an allow-list of settled verdicts instead so every other state ages to unknown, with test coverage for unassigned/waiting_ci. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/dashboard/stage_tracker_activity.test.js | 7 ++++--- src/pkg/dashboard/static-src/js/tracker-row-strip.js | 10 +++++++--- src/pkg/dashboard/static/index.html | 10 +++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 3c3cd15420..d40dc0c762 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -13,7 +13,8 @@ function fn(source, name) { assert.ok(match, name); return match[0]; } -const esc = text => String(text).replaceAll('&', '&').replaceAll('<', '<').replaceAll('"', '"'); +// Mirrors production esc(): newlines flatten to spaces. +const esc = text => String(text).replaceAll('&', '&').replaceAll('<', '<').replaceAll('"', '"').replaceAll('\n', ' '); const globals = ` const STAGE_TRACKER_PATH = [0, 10, 20, 30, 50, 80]; const STAGE_TRACKER_TERMINAL = 110; @@ -883,7 +884,7 @@ test('settled current-head verdicts keep one known caption at every observation }); test('motion needs a fresh observation even when the backend active flag is cached', () => { - for (const [kind, state] of [['review', 'reviewing'], ['review', 'adjudicating'], ['review', 'assigned'], ['ci', 'running'], ['ci', 'queued']]) { + for (const [kind, state] of [['review', 'reviewing'], ['review', 'adjudicating'], ['review', 'assigned'], ['review', 'unassigned'], ['review', 'waiting_ci'], ['ci', 'running'], ['ci', 'queued'], ['ci', 'waiting_ci']]) { for (const observed of [new Date(now - 15 * 60000).toISOString(), undefined, new Date(now + 60000).toISOString()]) { const item = { kind: 'pr', head: 'head', [kind + '_activity']: { ...activity(state, 'Work observed', true), observed_at: observed } }; const html = track(item, kind, {}, false, now); @@ -911,7 +912,7 @@ test('review tooltip lists escaped perspective verdicts before current-head prov assert.ok(tip.includes(esc(caption) + '
    correctness ✗: ' + esc(summary))); assert.match(tip, /
    security ✓
    quality ✗: explain the edge case
    head head · verified-review-bundle · observed 15m ago/); assert.doesNotMatch(html, / activityFreshMS || observed > clock); const current = sg.state === 'active'; const state = matches ? a.state || 'unknown' : 'unknown'; - const moving = ['running', 'queued', 'reviewing', 'adjudicating', 'assigned'].includes(state); + // Only settled verdicts outlive the freshness window; every other + // state (running, queued, unassigned, waiting_ci, ...) implies motion. + const settledState = ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing'].includes(state); + const moving = !settledState && state !== 'unknown'; const fresh = Number.isFinite(observed) && !stale; - const known = matches && state !== 'unknown' && (!moving || fresh); + const known = matches && state !== 'unknown' && (settledState || fresh); const active = known && fresh && a.active; const perspectives = known && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; const perspectiveMark = verdict => verdict === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(verdict) ? '✗' : verdict === 'requires_human' ? 'requires human' : verdict || '?'; @@ -331,7 +334,8 @@ (lead ? ' · hive is waiting on ' + lead.waitingOn + (lead.newHead && sha7 ? ' for new head ' + sha7 : '') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); const copy = `${evidenceLink}${personIco}`; - return `
  • ${copy}${esc(fullTip).replaceAll('\n', '
    ')}${decided ? `${decided}` : ''}
  • `; + const tipHtml = fullTip.split('\n').map(esc).join('
    '); + return `
  • ${copy}${tipHtml}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index f190fc5370..b9a4c9edcb 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -18118,9 +18118,12 @@

    Where to get help

    const stale = Number.isFinite(observed) && (clock - observed > activityFreshMS || observed > clock); const current = sg.state === 'active'; const state = matches ? a.state || 'unknown' : 'unknown'; - const moving = ['running', 'queued', 'reviewing', 'adjudicating', 'assigned'].includes(state); + // Only settled verdicts outlive the freshness window; every other + // state (running, queued, unassigned, waiting_ci, ...) implies motion. + const settledState = ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing'].includes(state); + const moving = !settledState && state !== 'unknown'; const fresh = Number.isFinite(observed) && !stale; - const known = matches && state !== 'unknown' && (!moving || fresh); + const known = matches && state !== 'unknown' && (settledState || fresh); const active = known && fresh && a.active; const perspectives = known && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; const perspectiveMark = verdict => verdict === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(verdict) ? '✗' : verdict === 'requires_human' ? 'requires human' : verdict || '?'; @@ -18202,7 +18205,8 @@

    Where to get help

    (lead ? ' · hive is waiting on ' + lead.waitingOn + (lead.newHead && sha7 ? ' for new head ' + sha7 : '') : ''); const tipID = 'ham-track-tip-' + [item.repo || '', item.kind || '', item.number || 0, kind].map(x => encodeURIComponent(String(x))).join('-'); const copy = `${evidenceLink}${personIco}`; - return `
  • ${copy}${esc(fullTip).replaceAll('\n', '
    ')}${decided ? `${decided}` : ''}
  • `; + const tipHtml = fullTip.split('\n').map(esc).join('
    '); + return `
  • ${copy}${tipHtml}${decided ? `${decided}` : ''}
  • `; } // Chevrons for one item. range bounds the columns the item owns (an From ee3a0d4e8d7fabbe87ab8cbf323205d454043fc3 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:59:54 -0500 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=A7=AA=20test(dashboard):=20run=20sta?= =?UTF-8?q?ge=20tracker=20motion=20fixtures=20from=20temp=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lifted dashboard functions push the concatenated node script past the Linux single-argument limit (E2BIG) when passed via -e. Route all stage_tracker_motion_test fixtures through a shared runMotionScript helper that writes the script to t.TempDir() and runs it by path. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../dashboard/stage_tracker_motion_test.go | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/pkg/dashboard/stage_tracker_motion_test.go b/src/pkg/dashboard/stage_tracker_motion_test.go index 4303ddbc9a..1a446e9e08 100644 --- a/src/pkg/dashboard/stage_tracker_motion_test.go +++ b/src/pkg/dashboard/stage_tracker_motion_test.go @@ -217,10 +217,7 @@ assert.strictEqual(stageTrackerAnimateMove(strip, 4, 4, 'wash'), false, 'no colu assert.deepStrictEqual(trace, []); assert.strictEqual(timers.length, 0); ` - cmd := exec.Command(node, "-e", script) - if out, err := cmd.CombinedOutput(); err != nil { - t.Fatalf("node movement sequence fixture failed: %v\n%s", err, out) - } + runMotionScript(t, node, script, "motion_sequence.js", "movement sequence") } func tokensCSS(t *testing.T) string { @@ -371,10 +368,7 @@ assert.strictEqual(stageTrackerMotionEffect('bogus', false), 'wash'); assert.deepStrictEqual(STAGE_TRACKER_MOTIONS.map(m => m.id), ['none', 'puck', 'ripple', 'ghost', 'comet', 'bump', 'wash']); assert.deepStrictEqual(STAGE_TRACKER_MOTIONS.map(m => m.key), ['', 'A', 'B', 'C', 'D', 'E', 'F']); ` - cmd := exec.Command(node, "-e", script) - if out, err := cmd.CombinedOutput(); err != nil { - t.Fatalf("node movement detector fixture failed: %v\n%s", err, out) - } + runMotionScript(t, node, script, "motion_detector.js", "movement detector") } // TestStageTrackerMotionRowStamp runs the real row builder: the moved strip's @@ -495,10 +489,7 @@ assert.deepStrictEqual(ols(stageTrackerRowHtml(next[2], stages, ctx)), [''], 'an assert.deepStrictEqual(ols(stageTrackerRowHtml(next[1], stages, ctx)), ['', ' data-ham-prev-col="4" data-ham-col="6"', ''], 'only the nested PR that moved is stamped (sub-rows sort furthest first)'); assert.deepStrictEqual(ols(stageTrackerRowHtml(next[0], stages, { nowMs: now })), [''], 'no moves in ctx → no stamp'); ` - cmd := exec.Command(node, "-e", script) - if out, err := cmd.CombinedOutput(); err != nil { - t.Fatalf("node row stamp fixture failed: %v\n%s", err, out) - } + runMotionScript(t, node, script, "motion_row_stamp.js", "row stamp") } // The settings-modal preview is one real tracker row, rebuilt in place on @@ -697,15 +688,22 @@ assert.deepStrictEqual(animated, [[claimed, review, 'wash'], [review, claimed, ' // a re-render after clicks picks up where the preview left off assert.strictEqual(activeShort(stageTrackerMotionSectionHtml('wash', stages)), 'CI + Review'); ` - // The lifted strip exceeds Linux's single-argument limit, so the script - // goes through a file rather than -e. - path := filepath.Join(t.TempDir(), "motion_preview_sample.js") + runMotionScript(t, node, script, "motion_preview_sample.js", "motion preview sample") +} + +// runMotionScript writes script to a temp file and runs it with node. The +// lifted dashboard functions push the concatenated source past Linux's +// single-argument limit (E2BIG), so the script goes through a file rather +// than -e. +func runMotionScript(t *testing.T, node, script, name, label string) { + t.Helper() + path := filepath.Join(t.TempDir(), name) if err := os.WriteFile(path, []byte(script), 0o600); err != nil { t.Fatal(err) } cmd := exec.Command(node, path) if out, err := cmd.CombinedOutput(); err != nil { - t.Fatalf("node motion preview sample fixture failed: %v\n%s", err, out) + t.Fatalf("node %s fixture failed: %v\n%s", label, err, out) } } @@ -904,8 +902,5 @@ assert.notStrictEqual(stageTrackerRowSrcKey(R(1, 4, '2m').html), R(1, 4).html); assert.strictEqual(stageTrackerRowHasMove(R(1, 4, '1m', [2, 4]).html), true); assert.strictEqual(stageTrackerRowHasMove(R(1, 4).html), false); ` - cmd := exec.Command(node, "-e", script) - if out, err := cmd.CombinedOutput(); err != nil { - t.Fatalf("node reconcile fixture failed: %v\n%s", err, out) - } + runMotionScript(t, node, script, "motion_reconcile.js", "reconcile") } From 836c9fec9503d989c2ab1a25e076ab58fc1baa34 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:09:00 -0500 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=90=9B=20fix(dashboard):=20keep=20sta?= =?UTF-8?q?le=20marker=20next=20to=20the=20poll=20time=20in=20the=20track?= =?UTF-8?q?=20tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/dashboard/static-src/js/tracker-row-strip.js | 3 +-- src/pkg/dashboard/static/index.html | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pkg/dashboard/static-src/js/tracker-row-strip.js b/src/pkg/dashboard/static-src/js/tracker-row-strip.js index 72e86143d7..4f7cd169c8 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -276,7 +276,6 @@ // Only settled verdicts outlive the freshness window; every other // state (running, queued, unassigned, waiting_ci, ...) implies motion. const settledState = ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing'].includes(state); - const moving = !settledState && state !== 'unknown'; const fresh = Number.isFinite(observed) && !stale; const known = matches && state !== 'unknown' && (settledState || fresh); const active = known && fresh && a.active; @@ -314,7 +313,7 @@ const source = matches ? a.source || 'unavailable' : 'unavailable'; const age = Math.max(0, Math.floor((clock - observed) / 60000)); const ago = age < 1 ? 'just now' : age < 60 ? age + 'm ago' : age < 1440 ? Math.floor(age / 60) + 'h ago' : Math.floor(age / 1440) + 'd ago'; - const freshness = !Number.isFinite(observed) ? 'observation time unknown' : observed > clock ? 'observation time in future · ' + new Date(observed).toISOString() : 'observed ' + ago + (stale && moving ? ' · stale' : '') + ' · ' + new Date(observed).toISOString(); + const freshness = !Number.isFinite(observed) ? 'observation time unknown' : observed > clock ? 'observation time in future · ' + new Date(observed).toISOString() : 'observed ' + ago + (stale ? ' · stale' : '') + ' · ' + new Date(observed).toISOString(); const since = matches && a.since && Number.isFinite(Date.parse(a.since)) ? ' · since ' + new Date(a.since).toISOString() : ''; let blocker = matches && a.blocker && !caption.includes(a.blocker) ? ' · ' + a.blocker : ''; // A sign-off ask: the tooltip carries the question itself (who should diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 6e2b264aed..e40d015e22 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -18189,7 +18189,6 @@

    Where to get help

    // Only settled verdicts outlive the freshness window; every other // state (running, queued, unassigned, waiting_ci, ...) implies motion. const settledState = ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing'].includes(state); - const moving = !settledState && state !== 'unknown'; const fresh = Number.isFinite(observed) && !stale; const known = matches && state !== 'unknown' && (settledState || fresh); const active = known && fresh && a.active; @@ -18227,7 +18226,7 @@

    Where to get help

    const source = matches ? a.source || 'unavailable' : 'unavailable'; const age = Math.max(0, Math.floor((clock - observed) / 60000)); const ago = age < 1 ? 'just now' : age < 60 ? age + 'm ago' : age < 1440 ? Math.floor(age / 60) + 'h ago' : Math.floor(age / 1440) + 'd ago'; - const freshness = !Number.isFinite(observed) ? 'observation time unknown' : observed > clock ? 'observation time in future · ' + new Date(observed).toISOString() : 'observed ' + ago + (stale && moving ? ' · stale' : '') + ' · ' + new Date(observed).toISOString(); + const freshness = !Number.isFinite(observed) ? 'observation time unknown' : observed > clock ? 'observation time in future · ' + new Date(observed).toISOString() : 'observed ' + ago + (stale ? ' · stale' : '') + ' · ' + new Date(observed).toISOString(); const since = matches && a.since && Number.isFinite(Date.parse(a.since)) ? ' · since ' + new Date(a.since).toISOString() : ''; let blocker = matches && a.blocker && !caption.includes(a.blocker) ? ' · ' + a.blocker : ''; // A sign-off ask: the tooltip carries the question itself (who should From 1c4a9bfca588ff802d6203ad3fc42203cd0b9338 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:49:21 -0500 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=93=9D=20docs(dashboard):=20document?= =?UTF-8?q?=20review=20perspectives=20and=20align=20track=20stale=20wordin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document review_activity.perspectives[] in the API reference and the settled-verdict ageing rule in the activity monitor guide. The row tooltip track summary now ages settled verdicts the way the chevron tooltip does ("observed 15m ago · stale") instead of "stale observation". Extract trackerPrefersVerdict so both verdict pickers share the dissent-over- approval rule, and move the failing-perspective caption suffix into trackerPerspectiveFindingLine with a cross-reference to its JS mirror. Hive-Fix-Attempt: 2/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/docs/api-reference/dashboard-misc.md | 4 ++ src/docs/streaming-the-activity-monitor.md | 5 +- src/pkg/dashboard/stage_tracker_activity.go | 52 ++++++++++++++----- .../static-src/js/tracker-row-strip.js | 9 +++- 4 files changed, 55 insertions(+), 15 deletions(-) diff --git a/src/docs/api-reference/dashboard-misc.md b/src/docs/api-reference/dashboard-misc.md index 63173e935a..3ed4656839 100644 --- a/src/docs/api-reference/dashboard-misc.md +++ b/src/docs/api-reference/dashboard-misc.md @@ -6,6 +6,10 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f `GET /api/stage-tracker` adds independent PR `ci_activity`, `review_activity` and `code_activity` observations, also copied to `linked_prs[]`. Each is `{head, state, caption, actor?, source, observed_at?, since?, blocker?, url?, active?}`. +`review_activity` additionally carries `perspectives_done?`, `perspectives_total?` +and `perspectives?: [{name, verdict, summary}]` — the latest current-head bundle +verdict per perspective (dissent outranks approval), with `summary` the first +finding when one was reported. These are display evidence, **not merge authorization**. An absent timestamp means unknown freshness; a different head invalidates the observation. CI is classified only against the resolved required set from the existing diff --git a/src/docs/streaming-the-activity-monitor.md b/src/docs/streaming-the-activity-monitor.md index c7dd5a8cde..9ebfe0e6aa 100644 --- a/src/docs/streaming-the-activity-monitor.md +++ b/src/docs/streaming-the-activity-monitor.md @@ -37,7 +37,10 @@ recorded assignment/transition, never an invented return date. Track tooltips disclose the head, evidence source, observation time, state time and blocker where known. A `?` means stale or missing observation time; -unknown activity has no spinner. Review assignment is read from dispatch, not +unknown activity has no spinner. A settled verdict on the current head +(approved, findings, passing, failing) does not go stale: its caption stays +and the tooltip adds an "observed Nm ago · stale" age, while only motion +states (running, reviewing, queued, ...) fall back to "activity unknown". Review assignment is read from dispatch, not the PR author, claimant, scanner or Prow approval labels. Verified current-head review evidence and the current aggregate supply approval/findings; missing reviewer identity is left unknown. An assignment is not proof of execution, diff --git a/src/pkg/dashboard/stage_tracker_activity.go b/src/pkg/dashboard/stage_tracker_activity.go index cbdeb2a9c9..82f49fcc87 100644 --- a/src/pkg/dashboard/stage_tracker_activity.go +++ b/src/pkg/dashboard/stage_tracker_activity.go @@ -478,12 +478,25 @@ func trackerHeadMatches(repo string, number int, head, observedRepo string, obse return number == observedNumber && head != "" && strings.EqualFold(head, observedHead) && strings.EqualFold(repo, observedRepo) } +// trackerPrefersVerdict reports whether candidate should replace previous as +// the current verdict: dissent beats approval, otherwise the newest wins. +func trackerPrefersVerdict(previous, candidate evidence.Verdict) bool { + previousApproves, candidateApproves := previous.Verdict == "approve", candidate.Verdict == "approve" + if previousApproves != candidateApproves { + return previousApproves + } + return candidate.RecordedAt.After(previous.RecordedAt) +} + +// trackerLatestBundleVerdicts keeps one verdict per reviewer (perspective, +// backend, model): the newest recording, with dissent breaking exact ties. func trackerLatestBundleVerdicts(bundle *evidence.Bundle) []evidence.Verdict { latest := map[string]evidence.Verdict{} for _, verdict := range bundle.Verdicts { key := verdict.Perspective + "\x00" + verdict.Backend + "\x00" + verdict.Model - if previous, ok := latest[key]; !ok || verdict.RecordedAt.After(previous.RecordedAt) || - (verdict.RecordedAt.Equal(previous.RecordedAt) && previous.Verdict == "approve" && verdict.Verdict != "approve") { + previous, ok := latest[key] + if !ok || verdict.RecordedAt.After(previous.RecordedAt) || + (verdict.RecordedAt.Equal(previous.RecordedAt) && trackerPrefersVerdict(previous, verdict)) { latest[key] = verdict } } @@ -508,8 +521,7 @@ func trackerReviewPerspectives(bundle *evidence.Bundle) []StageTrackerPerspectiv previous, ok := latest[verdict.Perspective] // Each backend/model has its own current verdict. An approval by // another reviewer must not hide dissent that still blocks the head. - if !ok || (previous.Verdict == "approve" && verdict.Verdict != "approve") || - ((previous.Verdict == "approve") == (verdict.Verdict == "approve") && verdict.RecordedAt.After(previous.RecordedAt)) { + if !ok || trackerPrefersVerdict(previous, verdict) { latest[verdict.Perspective] = verdict } } @@ -598,6 +610,27 @@ func trackerAssignedCodeWorker(status *StatusPayload, repo string, number int, h return nil } +// trackerPerspectiveFindingLine renders a dissenting perspective as +// " ✗|requires human[: ]" for the review caption, or "" for +// anything else. The tracker-row-strip.js perspectiveLine() mirror rebuilds +// this exact string to avoid repeating the finding; keep the two in step. +func trackerPerspectiveFindingLine(perspective StageTrackerPerspective) string { + var mark string + switch perspective.Verdict { + case "changes_requested", "reject": + mark = "✗" + case "requires_human": + mark = "requires human" + default: + return "" + } + line := perspective.Name + " " + mark + if perspective.Summary != "" { + line += ": " + perspective.Summary + } + return line +} + func stageTrackerReviewActivity(pr github.PullRequest, bundle *evidence.Bundle, agg *review.Aggregate, dispatch review.DispatchState, status *StatusPayload, now time.Time) *StageTrackerActivity { out := trackerUnknownActivity(pr.HeadSHA, "Review unknown · current-head evidence unavailable") if agg != nil && !trackerHeadMatches(pr.Repo, pr.Number, pr.HeadSHA, agg.Repo, agg.Number, agg.HeadSHA) { @@ -733,15 +766,8 @@ func stageTrackerReviewActivity(pr github.PullRequest, bundle *evidence.Bundle, } if out.State == "changes_requested" || out.State == "human_decision" { for _, perspective := range out.Perspectives { - if perspective.Verdict == "changes_requested" || perspective.Verdict == "reject" || perspective.Verdict == "requires_human" { - mark := "✗" - if perspective.Verdict == "requires_human" { - mark = "requires human" - } - out.Caption += " · " + perspective.Name + " " + mark - if perspective.Summary != "" { - out.Caption += ": " + perspective.Summary - } + if line := trackerPerspectiveFindingLine(perspective); line != "" { + out.Caption += " · " + line break } } diff --git a/src/pkg/dashboard/static-src/js/tracker-row-strip.js b/src/pkg/dashboard/static-src/js/tracker-row-strip.js index 4f7cd169c8..14ede90889 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -280,6 +280,9 @@ const known = matches && state !== 'unknown' && (settledState || fresh); const active = known && fresh && a.active; const perspectives = known && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; + // Mirrors trackerPerspectiveFindingLine in stage_tracker_activity.go: + // the dedupe below is an exact string match, so glyph and separator + // changes must land on both sides. const perspectiveMark = verdict => verdict === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(verdict) ? '✗' : verdict === 'requires_human' ? 'requires human' : verdict || '?'; const perspectiveLine = p => String(p.name || 'Perspective') + ' ' + perspectiveMark(p.verdict) + (p.summary ? ': ' + p.summary : ''); // A repair projection can rewrite the generic caption; keep its first @@ -575,7 +578,11 @@ const clock = Number(nowMs) || Date.now(); const fresh = Number.isFinite(observed) && observed <= clock && clock - observed <= activityFreshMS; if ((a.active || ['running', 'reviewing', 'adjudicating'].includes(a.state)) && !fresh) return name + ' activity unknown · last observed ' + (a.state || 'unknown'); - return (a.caption || name + ' unknown') + (!Number.isFinite(observed) ? ' · observation time unknown' : !fresh ? ' · stale observation' : ''); + // A settled verdict on the current head does not go stale: age it + // the way the chevron tooltip does ("observed 15m ago · stale"). + const age = Math.max(0, Math.floor((clock - observed) / 60000)); + const ago = age < 1 ? 'just now' : age < 60 ? age + 'm ago' : age < 1440 ? Math.floor(age / 60) + 'h ago' : Math.floor(age / 1440) + 'd ago'; + return (a.caption || name + ' unknown') + (!Number.isFinite(observed) ? ' · observation time unknown' : observed > clock ? ' · observation time in future' : !fresh ? ' · observed ' + ago + ' · stale' : ''); }).join(' · ') : ''; return `

    ${esc(text + (tracks ? ' · ' + tracks : ''))}

    `; } From 3d98d74a993a2cdf753a2c5f6bd8eb4f66cab083 Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:59:22 -0500 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=8C=B1=20chore(dashboard):=20regenera?= =?UTF-8?q?te=20static/index.html=20from=20static-src?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TestIndexHTMLIsGenerated failed because the last two commits edited static-src/ without re-running the concat generator. Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- src/pkg/dashboard/static/index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index e40d015e22..1694221b4e 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -18193,6 +18193,9 @@

    Where to get help

    const known = matches && state !== 'unknown' && (settledState || fresh); const active = known && fresh && a.active; const perspectives = known && kind === 'review' && Array.isArray(a.perspectives) ? a.perspectives : []; + // Mirrors trackerPerspectiveFindingLine in stage_tracker_activity.go: + // the dedupe below is an exact string match, so glyph and separator + // changes must land on both sides. const perspectiveMark = verdict => verdict === 'approve' ? '✓' : ['changes_requested', 'reject'].includes(verdict) ? '✗' : verdict === 'requires_human' ? 'requires human' : verdict || '?'; const perspectiveLine = p => String(p.name || 'Perspective') + ' ' + perspectiveMark(p.verdict) + (p.summary ? ': ' + p.summary : ''); // A repair projection can rewrite the generic caption; keep its first @@ -18488,7 +18491,11 @@

    Where to get help

    const clock = Number(nowMs) || Date.now(); const fresh = Number.isFinite(observed) && observed <= clock && clock - observed <= activityFreshMS; if ((a.active || ['running', 'reviewing', 'adjudicating'].includes(a.state)) && !fresh) return name + ' activity unknown · last observed ' + (a.state || 'unknown'); - return (a.caption || name + ' unknown') + (!Number.isFinite(observed) ? ' · observation time unknown' : !fresh ? ' · stale observation' : ''); + // A settled verdict on the current head does not go stale: age it + // the way the chevron tooltip does ("observed 15m ago · stale"). + const age = Math.max(0, Math.floor((clock - observed) / 60000)); + const ago = age < 1 ? 'just now' : age < 60 ? age + 'm ago' : age < 1440 ? Math.floor(age / 60) + 'h ago' : Math.floor(age / 1440) + 'd ago'; + return (a.caption || name + ' unknown') + (!Number.isFinite(observed) ? ' · observation time unknown' : observed > clock ? ' · observation time in future' : !fresh ? ' · observed ' + ago + ' · stale' : ''); }).join(' · ') : ''; return `

    ${esc(text + (tracks ? ' · ' + tracks : ''))}

    `; }