From ed1fe5cb5f8bae8e2d9b1fd9aac57acc4512265e Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Wed, 4 Nov 2026 11:29:57 -0500 Subject: [PATCH] fix(dashboard): keep stale review verdicts known and name the failing perspective MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A verified review bundle on the current head was re-captioned "Review activity unknown · last observed " by the tooltip builder as soon as its observation aged past the two-minute freshness window, while the chevron colour still followed the state — so a red chevron claimed not to know anything. Only motion goes stale; a settled verdict keeps its words and shows "observed Nm ago". review_activity now carries perspectives[] {name, verdict, summary} from the bundle's latest verdicts, the caption names the first non-approving perspective ("correctness ✗: …"), and the tooltip lists every perspective on its own line before head/source/observed. Fixes #16617 Signed-off-by: Andrew Anderson --- .../fixed-review-activity-stale-unknown.md | 1 + src/pkg/dashboard/stage_tracker_activity.go | 106 +++++++++++++++++- .../dashboard/stage_tracker_activity.test.js | 32 +++++- .../dashboard/stage_tracker_activity_test.go | 73 ++++++++++++ src/pkg/dashboard/static-src/css/tracker.css | 2 +- .../static-src/js/tracker-row-strip.js | 30 ++++- src/pkg/dashboard/static/index.html | 32 ++++-- 7 files changed, 260 insertions(+), 16 deletions(-) create mode 100644 changelog.d/fixed-review-activity-stale-unknown.md diff --git a/changelog.d/fixed-review-activity-stale-unknown.md b/changelog.d/fixed-review-activity-stale-unknown.md new file mode 100644 index 0000000000..5a5617c04e --- /dev/null +++ b/changelog.d/fixed-review-activity-stale-unknown.md @@ -0,0 +1 @@ +- Activity Monitor: a red Review chevron no longer reads "Review activity unknown · last observed changes_requested" once its verified bundle is older than the freshness window. A settled verdict on the current head keeps its state; staleness is an "observed Nm ago" suffix; and `review_activity.perspectives[]` names each perspective's verdict so the caption and tooltip say which perspective failed and why (hivecommons/hive#16617). diff --git a/src/pkg/dashboard/stage_tracker_activity.go b/src/pkg/dashboard/stage_tracker_activity.go index 94e5cf04be..fa4de6dad5 100644 --- a/src/pkg/dashboard/stage_tracker_activity.go +++ b/src/pkg/dashboard/stage_tracker_activity.go @@ -45,6 +45,100 @@ type StageTrackerActivity struct { // verdict for the current head. PerspectivesDone int `json:"perspectives_done,omitempty"` PerspectivesTotal int `json:"perspectives_total,omitempty"` + // Perspectives are the latest per-perspective verdicts of the verified + // bundle on the current head, so a red Review chevron can always name + // which perspective failed and why (hivecommons/hive#16617). Empty when + // no bundle exists for the head. + Perspectives []StageTrackerPerspective `json:"perspectives,omitempty"` +} + +// StageTrackerPerspective is one reviewer perspective's latest verdict on +// the current head: its name, the verdict word (approve, changes_requested, +// reject, requires_human) and the first finding's one-line summary. +type StageTrackerPerspective struct { + Name string `json:"name"` + Verdict string `json:"verdict"` + Summary string `json:"summary,omitempty"` +} + +// stageTrackerBundlePerspectives folds the bundle's latest verdicts into one +// entry per perspective: a non-approving verdict wins over an approval from +// another model, otherwise the most recent one does. Sorted by name. +func stageTrackerBundlePerspectives(bundle *evidence.Bundle) []StageTrackerPerspective { + type pick struct { + verdict evidence.Verdict + set bool + } + picks := map[string]pick{} + for _, verdict := range trackerLatestBundleVerdicts(bundle) { + if verdict.Perspective == "" { + continue + } + previous := picks[verdict.Perspective] + if !previous.set || + (previous.verdict.Verdict == "approve" && verdict.Verdict != "approve") || + (previous.verdict.Verdict == "approve") == (verdict.Verdict == "approve") && verdict.RecordedAt.After(previous.verdict.RecordedAt) { + picks[verdict.Perspective] = pick{verdict: verdict, set: true} + } + } + names := make([]string, 0, len(picks)) + for name := range picks { + names = append(names, name) + } + slices.Sort(names) + out := make([]StageTrackerPerspective, 0, len(names)) + for _, name := range names { + verdict := picks[name].verdict + p := StageTrackerPerspective{Name: name, Verdict: verdict.Verdict} + if len(verdict.Findings) > 0 { + p.Summary = stageTrackerFirstLine(verdict.Findings[0].Summary) + } + out = append(out, p) + } + return out +} + +// stageTrackerFailingPerspective is the caption fragment naming the first +// perspective that did not approve — "correctness ✗: " — or the empty string +// when every perspective approved. +func stageTrackerFailingPerspective(perspectives []StageTrackerPerspective) string { + p := stageTrackerFirstNonApproving(perspectives) + if p == nil { + return "" + } + mark := "✗" + if p.Verdict == "requires_human" { + mark = "?" + } + if p.Summary == "" { + return p.Name + " " + mark + } + return p.Name + " " + mark + ": " + p.Summary +} + +func stageTrackerFirstNonApproving(perspectives []StageTrackerPerspective) *StageTrackerPerspective { + for i := range perspectives { + if p := &perspectives[i]; p.Verdict != "approve" && p.Verdict != "" { + return p + } + } + return nil +} + +// stageTrackerBlockerRepeats reports whether the aggregate's one-line +// blocker restates the named perspective's finding (both are first-line +// truncations of the same reviewer text), so the tooltip says it once. +func stageTrackerBlockerRepeats(blocker string, perspectives []StageTrackerPerspective) bool { + p := stageTrackerFirstNonApproving(perspectives) + if p == nil || p.Summary == "" || blocker == "" { + return false + } + const probe = 40 + key := []rune(strings.TrimSuffix(p.Summary, "…")) + if len(key) > probe { + key = key[:probe] + } + return len(key) > 0 && strings.Contains(blocker, string(key)) } const trackerActivityFreshWindow = 2 * time.Minute @@ -440,6 +534,8 @@ 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 = stageTrackerBundlePerspectives(bundle) + failing := stageTrackerFailingPerspective(out.Perspectives) for _, verdict := range trackerLatestBundleVerdicts(bundle) { if !verdict.RecordedAt.IsZero() && (out.Since == nil || verdict.RecordedAt.After(*out.Since)) { at := verdict.RecordedAt @@ -462,6 +558,12 @@ func stageTrackerReviewActivity(pr github.PullRequest, bundle *evidence.Bundle, case "changes_requested", "reject": out.State, out.Caption = "changes_requested", "Review findings · awaiting author" out.Blocker = stageTrackerFixerExhaustedSummary(agg) + if failing != "" { + out.Caption += " · " + failing + if stageTrackerBlockerRepeats(out.Blocker, out.Perspectives) { + out.Blocker = "" + } + } case "requires_human": out.State, out.Caption = "human_decision", "Review findings · needs owner sign-off" out.Blocker = agg.DecisionQuestion @@ -471,7 +573,9 @@ func stageTrackerReviewActivity(pr github.PullRequest, bundle *evidence.Bundle, for _, verdict := range trackerLatestBundleVerdicts(bundle) { if verdict.Verdict == "changes_requested" || verdict.Verdict == "reject" { out.State, out.Caption = "changes_requested", "Review findings · awaiting author" - if len(verdict.Findings) > 0 { + if failing != "" { + out.Caption += " · " + failing + } else if len(verdict.Findings) > 0 { out.Blocker = verdict.Findings[0].Summary } break diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index a2ee508b03..20a6d1e419 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -543,7 +543,8 @@ test('old-head or stale observations cannot fabricate running/completion, but do } else { assert.match(cells.ci, /active ham-current[^]*CI \?\/\? · running { + const observed = new Date(now - 36 * 60000).toISOString(); + const item = { kind: 'pr', head: 'b5c1f96c', review_activity: { + head: 'b5c1f96c', state: 'changes_requested', source: 'verified-review-bundle', observed_at: observed, since: new Date(now - 100 * 60000).toISOString(), + caption: 'Review findings · awaiting author · correctness ✗: Provenance helpers are a faithful move from the automerge engine', + perspectives_done: 5, perspectives_total: 5, + perspectives: [ + { name: 'correctness', verdict: 'changes_requested', summary: 'Provenance helpers are a faithful move from the automerge engine' }, + { name: 'plan-match', verdict: 'approve' }, { name: 'quality', verdict: 'approve' }, { name: 'security', verdict: 'approve' }, { name: 'style', verdict: 'approve' }, + ], + } }; + const html = track(item, 'review', { state: 'active' }, false, now); + assert.match(html, /ham-activity-track failing/, 'the chevron is red'); + assert.match(html, /data-display-state="known"/); + assert.doesNotMatch(html, /unknown|stale|last observed/, 'a verdict on this head is known however old the observation'); + const tip = html.match(/title="([^"]*)"/)[1]; + assert.match(tip, /^Current pipeline phase · Review: Review 5\/5 · changes requested · Review findings · awaiting author · correctness ✗: Provenance/); + assert.equal((tip.match(/Review 5\/5 · changes requested/g) || []).length, 1, 'one state, said once'); + assert.match(tip, /\ncorrectness ✗: Provenance helpers are a faithful move from the automerge engine\nplan-match ✓\nquality ✓\nsecurity ✓\nstyle ✓\nhead b5c1f96c · verified-review-bundle · observed 36m ago · /, 'every perspective on its own line, then head / source / observed / since'); + assert.doesNotMatch(html, /data-motion/); + // Motion, by contrast, does age into unknown: a reviewer last seen working + // 36 minutes ago cannot be assumed to still be at it. + item.review_activity = { ...activity('reviewing', 'Review working · reviewer', true), head: 'b5c1f96c', observed_at: observed, actor: 'reviewer' }; + assert.match(track(item, 'review', {}, false, now), /Review activity unknown · last observed reviewing/); + // No bundle for the head is the only unknown verdict. + item.review_activity = { head: 'other', state: 'changes_requested', caption: 'Review findings · awaiting author', source: 'verified-review-bundle', observed_at: observed }; + assert.match(track(item, 'review', {}, false, now), /data-activity-state="unknown"/); +}); diff --git a/src/pkg/dashboard/stage_tracker_activity_test.go b/src/pkg/dashboard/stage_tracker_activity_test.go index 6c58028cc8..98bfc05d83 100644 --- a/src/pkg/dashboard/stage_tracker_activity_test.go +++ b/src/pkg/dashboard/stage_tracker_activity_test.go @@ -2,6 +2,7 @@ package dashboard import ( "os/exec" + "reflect" "strings" "testing" "time" @@ -485,3 +486,75 @@ func TestStageTrackerActivityReviewPerspectiveCounts(t *testing.T) { t.Fatalf("old-head evidence leaked into counts: %d/%d", got.PerspectivesDone, got.PerspectivesTotal) } } + +// hivecommons/hive#16617: a verified bundle on the current head keeps its +// verdict however long ago it was observed, and names each perspective's +// verdict so a red chevron can say which perspective failed and why. +func TestStageTrackerActivityStaleBundleKeepsVerdictAndPerspectives(t *testing.T) { + now := time.Date(2026, 11, 4, 16, 30, 0, 0, time.UTC) + pr, _, status := trackerActivityFixture(now) + dispatch := review.DispatchState{GeneratedAt: now} + finding := "Provenance helpers are a faithful move from the automerge engine; relay gate lifts only after author confirms." + verdicts := func(observed time.Time, correctness string) []evidence.Verdict { + return []evidence.Verdict{ + {Perspective: "security", Backend: "b", Model: "m", Verdict: "approve", RecordedAt: observed}, + {Perspective: "correctness", Backend: "b", Model: "m", Verdict: correctness, RecordedAt: observed, Findings: []evidence.Finding{{Summary: finding}}}, + {Perspective: "style", Backend: "b", Model: "m", Verdict: "approve", RecordedAt: observed}, + } + } + for _, tc := range []struct { + name string + observed time.Time + aggVerdict review.Verdict + humanSummary string + correctness string + wantState string + wantCaptionPart string + wantBlocker string + }{ + {"fresh changes_requested", now.Add(-30 * time.Second), "changes_requested", "", "changes_requested", "changes_requested", "correctness ✗: " + finding, ""}, + {"stale changes_requested keeps verdict", now.Add(-90 * time.Minute), "changes_requested", "", "changes_requested", "changes_requested", "correctness ✗: " + finding, ""}, + {"aggregate blocker restating the finding is said once", now.Add(-90 * time.Minute), "changes_requested", "correctness requires human: " + finding, "requires_human", "changes_requested", "correctness ?: " + finding, ""}, + {"unrelated aggregate blocker is kept", now.Add(-90 * time.Minute), "changes_requested", "fixer gave up after 3 attempts", "changes_requested", "changes_requested", "correctness ✗: " + finding, "fixer gave up after 3 attempts"}, + } { + t.Run(tc.name, func(t *testing.T) { + bundle := &evidence.Bundle{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, UpdatedAt: tc.observed, Verdicts: verdicts(tc.observed, tc.correctness)} + agg := &review.Aggregate{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Verdict: tc.aggVerdict, RecordedAt: tc.observed} + if tc.humanSummary != "" { + agg.HumanSummaries = []string{tc.humanSummary} + } + got := stageTrackerReviewActivity(pr, bundle, agg, dispatch, status, now) + if got.State != tc.wantState || got.Source != "verified-review-bundle" { + t.Fatalf("state/source = %s/%s, want %s/verified-review-bundle: %+v", got.State, got.Source, tc.wantState, got) + } + if !strings.Contains(got.Caption, tc.wantCaptionPart) || strings.Contains(got.Caption, "unknown") { + t.Fatalf("caption %q does not name the failing perspective %q", got.Caption, tc.wantCaptionPart) + } + if got.Blocker != tc.wantBlocker { + t.Fatalf("blocker = %q, want %q", got.Blocker, tc.wantBlocker) + } + if got.ObservedAt == nil || !got.ObservedAt.Equal(tc.observed) { + t.Fatalf("observed_at = %v, want %v", got.ObservedAt, tc.observed) + } + want := []StageTrackerPerspective{ + {Name: "correctness", Verdict: tc.correctness, Summary: stageTrackerFirstLine(finding)}, + {Name: "security", Verdict: "approve"}, + {Name: "style", Verdict: "approve"}, + } + if !reflect.DeepEqual(got.Perspectives, want) { + t.Fatalf("perspectives = %+v, want %+v", got.Perspectives, want) + } + }) + } + // No bundle for the head at all is the only "unknown". + if got := stageTrackerReviewActivity(pr, nil, nil, dispatch, status, now); got.State != "unknown" || len(got.Perspectives) != 0 { + t.Fatalf("no bundle should be unknown with no perspectives: %+v", got) + } + // Two models on one perspective: the non-approving one is the one named. + bundle := &evidence.Bundle{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, UpdatedAt: now, Verdicts: append(verdicts(now, "approve"), + evidence.Verdict{Perspective: "correctness", Backend: "b2", Model: "m2", Verdict: "changes_requested", RecordedAt: now.Add(-time.Minute), Findings: []evidence.Finding{{Summary: "off-by-one"}}})} + got := stageTrackerReviewActivity(pr, bundle, nil, dispatch, status, now) + if got.State != "changes_requested" || !strings.Contains(got.Caption, "correctness ✗: off-by-one") || got.Perspectives[0].Verdict != "changes_requested" { + t.Fatalf("split-model perspective did not name the dissent: %+v", got) + } +} diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index b68f720ef5..c41b377f45 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -451,7 +451,7 @@ .ham-chevron-copy { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--ham-chevron-text-lines); line-clamp: var(--ham-chevron-text-lines); max-height: calc(var(--ham-chevron-text-lines) * var(--ham-chevron-line-height) * 1em); flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: normal; overflow-wrap: anywhere; text-align: center; } .ham-chevron-copy :is(.ham-seg-t, .ham-detour, .ham-holder, .ham-gate-detail) { display: inline; white-space: normal; overflow-wrap: anywhere; } .ham-chevron-copy > .ham-decision-trigger { min-height: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--ham-chevron-text-lines); line-clamp: var(--ham-chevron-text-lines); max-width: 100%; overflow: hidden; white-space: normal; overflow-wrap: anywhere; } - .config-tooltip.ham-chevron-tip { overflow-wrap: anywhere; max-width: calc(100vw - var(--sp-8)); max-height: calc(100vh - var(--sp-8)); overflow-y: auto; pointer-events: auto; } + .config-tooltip.ham-chevron-tip { overflow-wrap: anywhere; white-space: pre-line; max-width: calc(100vw - var(--sp-8)); max-height: calc(100vh - var(--sp-8)); overflow-y: auto; pointer-events: auto; } @keyframes ham-pulse { 0%, 100% { opacity: 0; } 50% { opacity: 0.3; } } /* ---- tracker-cues: the Activity Monitor's shared cue vocabulary ------ Owner request: a viewer must always read where an item stands, 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 bd577488fd..20d6c15d7d 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-strip.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-strip.js @@ -154,8 +154,13 @@ 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; + // A settled verdict on the current head (a pass / fail, approval, + // findings or a sign-off ask from the verified bundle) does not age + // into "unknown": only motion does. The chevron colour comes from + // the state, so the words must agree with it (hivecommons/hive#16617). + const settledVerdict = matches && ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing'].includes(state); + const known = matches && state !== 'unknown' && (settledVerdict || (Number.isFinite(observed) && !stale)); + const active = known && a.active && !stale; 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 : ''); @@ -169,7 +174,11 @@ const running = stageTrackerTrackRunning(item, kind); const cls = finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : running ? 'active' : text ? 'pending' : 'todo'; const source = matches ? a.source || 'unavailable' : 'unavailable'; - const freshness = !Number.isFinite(observed) ? 'observation time unknown' : (stale ? 'stale · ' : 'observed · ') + new Date(observed).toISOString(); + const ageMin = Number.isFinite(observed) ? Math.max(0, Math.round((clock - observed) / 60000)) : 0; + const ageWord = ageMin < 60 ? ageMin + 'm ago' : ageMin < 48 * 60 ? Math.floor(ageMin / 60) + 'h ago' : Math.floor(ageMin / 1440) + 'd ago'; + const freshness = !Number.isFinite(observed) ? 'observation time unknown' + : stale && settledVerdict ? 'observed ' + ageWord + ' · ' + new Date(observed).toISOString() + : (stale ? 'stale · ' : 'observed · ') + 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 : ''; // A sign-off ask: the tooltip carries the question itself (who should @@ -180,7 +189,14 @@ // 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; + // One line per reviewer perspective ("correctness ✗: …", "security + // ✓") so a red chevron always names what failed and why. + const perspectives = matches && Array.isArray(a.perspectives) ? a.perspectives.filter(p => p && p.name).map(p => { + const mark = p.verdict === 'approve' ? '✓' : p.verdict === 'requires_human' ? '?' : '✗'; + return p.name + ' ' + mark + (p.summary ? ': ' + p.summary : ''); + }) : []; + const perspectiveLines = perspectives.length ? '\n' + perspectives.join('\n') + '\n' : ''; + let tip = caption + blocker + detail + perspectiveLines + (perspectiveLines ? '' : ' · ') + 'head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since; 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 : ''; @@ -204,7 +220,7 @@ const evidenceLink = ownsPR && evidenceURL ? `${icon}${word}` : icon + word; const routeState = (sg.state || 'todo') + (sg.detour ? ' detoured' : ''); const hold = item.hold; - const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + (text ? text + ' · ' : '') + tip + + const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + (text && tip.indexOf(text) !== 0 ? text + ' · ' : '') + tip + (matches && a.actor ? ' · actor ' + a.actor : '') + (codeNote || contextWord ? ' · ' + (codeNote || contextWord) : '') + (hold ? ' · ' + (hold.pill || 'Held by @' + hold.by) + (hold.reason ? ' · ' + hold.reason : '') : '') + @@ -403,7 +419,9 @@ 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' : ''); + const ageMin = Math.max(0, Math.round((clock - observed) / 60000)); + const ageWord = ageMin < 60 ? ageMin + 'm ago' : ageMin < 48 * 60 ? Math.floor(ageMin / 60) + 'h ago' : Math.floor(ageMin / 1440) + 'd ago'; + return (a.caption || name + ' unknown') + (!Number.isFinite(observed) ? ' · observation time unknown' : !fresh ? ' · observed ' + ageWord : ''); }).join(' · ') : ''; return `

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

`; } diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 65f75928f7..de0082abe9 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1788,7 +1788,7 @@ .ham-chevron-copy { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--ham-chevron-text-lines); line-clamp: var(--ham-chevron-text-lines); max-height: calc(var(--ham-chevron-text-lines) * var(--ham-chevron-line-height) * 1em); flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: normal; overflow-wrap: anywhere; text-align: center; } .ham-chevron-copy :is(.ham-seg-t, .ham-detour, .ham-holder, .ham-gate-detail) { display: inline; white-space: normal; overflow-wrap: anywhere; } .ham-chevron-copy > .ham-decision-trigger { min-height: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--ham-chevron-text-lines); line-clamp: var(--ham-chevron-text-lines); max-width: 100%; overflow: hidden; white-space: normal; overflow-wrap: anywhere; } - .config-tooltip.ham-chevron-tip { overflow-wrap: anywhere; max-width: calc(100vw - var(--sp-8)); max-height: calc(100vh - var(--sp-8)); overflow-y: auto; pointer-events: auto; } + .config-tooltip.ham-chevron-tip { overflow-wrap: anywhere; white-space: pre-line; max-width: calc(100vw - var(--sp-8)); max-height: calc(100vh - var(--sp-8)); overflow-y: auto; pointer-events: auto; } @keyframes ham-pulse { 0%, 100% { opacity: 0; } 50% { opacity: 0.3; } } /* ---- tracker-cues: the Activity Monitor's shared cue vocabulary ------ Owner request: a viewer must always read where an item stands, @@ -17928,8 +17928,13 @@

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; + // A settled verdict on the current head (a pass / fail, approval, + // findings or a sign-off ask from the verified bundle) does not age + // into "unknown": only motion does. The chevron colour comes from + // the state, so the words must agree with it (hivecommons/hive#16617). + const settledVerdict = matches && ['approved', 'changes_requested', 'human_decision', 'passing', 'failing', 'skipped', 'missing'].includes(state); + const known = matches && state !== 'unknown' && (settledVerdict || (Number.isFinite(observed) && !stale)); + const active = known && a.active && !stale; 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 : ''); @@ -17943,7 +17948,11 @@

Where to get help

const running = stageTrackerTrackRunning(item, kind); const cls = finished ? 'done' : finding ? 'failing' : settled ? 'done decided' : running ? 'active' : text ? 'pending' : 'todo'; const source = matches ? a.source || 'unavailable' : 'unavailable'; - const freshness = !Number.isFinite(observed) ? 'observation time unknown' : (stale ? 'stale · ' : 'observed · ') + new Date(observed).toISOString(); + const ageMin = Number.isFinite(observed) ? Math.max(0, Math.round((clock - observed) / 60000)) : 0; + const ageWord = ageMin < 60 ? ageMin + 'm ago' : ageMin < 48 * 60 ? Math.floor(ageMin / 60) + 'h ago' : Math.floor(ageMin / 1440) + 'd ago'; + const freshness = !Number.isFinite(observed) ? 'observation time unknown' + : stale && settledVerdict ? 'observed ' + ageWord + ' · ' + new Date(observed).toISOString() + : (stale ? 'stale · ' : 'observed · ') + 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 : ''; // A sign-off ask: the tooltip carries the question itself (who should @@ -17954,7 +17963,14 @@

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; + // One line per reviewer perspective ("correctness ✗: …", "security + // ✓") so a red chevron always names what failed and why. + const perspectives = matches && Array.isArray(a.perspectives) ? a.perspectives.filter(p => p && p.name).map(p => { + const mark = p.verdict === 'approve' ? '✓' : p.verdict === 'requires_human' ? '?' : '✗'; + return p.name + ' ' + mark + (p.summary ? ': ' + p.summary : ''); + }) : []; + const perspectiveLines = perspectives.length ? '\n' + perspectives.join('\n') + '\n' : ''; + let tip = caption + blocker + detail + perspectiveLines + (perspectiveLines ? '' : ' · ') + 'head ' + (item.head || 'unknown') + ' · ' + source + ' · ' + freshness + since; 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 : ''; @@ -17978,7 +17994,7 @@

Where to get help

const evidenceLink = ownsPR && evidenceURL ? `${icon}${word}` : icon + word; const routeState = (sg.state || 'todo') + (sg.detour ? ' detoured' : ''); const hold = item.hold; - const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + (text ? text + ' · ' : '') + tip + + const fullTip = (current ? 'Current pipeline phase · ' : '') + name + ': ' + (text && tip.indexOf(text) !== 0 ? text + ' · ' : '') + tip + (matches && a.actor ? ' · actor ' + a.actor : '') + (codeNote || contextWord ? ' · ' + (codeNote || contextWord) : '') + (hold ? ' · ' + (hold.pill || 'Held by @' + hold.by) + (hold.reason ? ' · ' + hold.reason : '') : '') + @@ -18177,7 +18193,9 @@

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' : ''); + const ageMin = Math.max(0, Math.round((clock - observed) / 60000)); + const ageWord = ageMin < 60 ? ageMin + 'm ago' : ageMin < 48 * 60 ? Math.floor(ageMin / 60) + 'h ago' : Math.floor(ageMin / 1440) + 'd ago'; + return (a.caption || name + ' unknown') + (!Number.isFinite(observed) ? ' · observation time unknown' : !fresh ? ' · observed ' + ageWord : ''); }).join(' · ') : ''; return `

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

`; }