diff --git a/changelog.d/fixed-advisory-issue-noise.md b/changelog.d/fixed-advisory-issue-noise.md new file mode 100644 index 0000000000..7d77285812 --- /dev/null +++ b/changelog.d/fixed-advisory-issue-noise.md @@ -0,0 +1 @@ +- Dedupe advisories with nothing to act on are no longer filed as issues, and advisory issues no longer look like stalled work ([#15381](https://github.com/hivecommons/hive/issues/15381)): the dedupe lane's prompt files a new checklist only for an action-required row, and the issue-request relay refuses an `issue-create` whose dedupe-checklist body has zero near-duplicate pairs, zero resolved candidates, zero missing PR↔issue links and no task lines (audited as `agent_issue_empty_advisory_refused`, summarised in a knowledge bead). In the Activity Monitor an issue wearing `triage/advisory`, carrying the dedupe-checklist marker or a `Decision required: no` line is an advisory: the Open chevron reads **Advisory · read & close** (or **Advisory · nothing found · safe to close** when its own counts are all zero) with no "· since Nh" or stale tint, the caption is *Advisory for maintainers · read, then close*, it is excluded from Needs human / Needs attention, and the row menu leads with **Close (read)**, which closes the issue as completed through the existing decision path (`close-read`). diff --git a/src/docs/dashboard-sections.md b/src/docs/dashboard-sections.md index 3e2e9b0d1e..88b10eee73 100644 --- a/src/docs/dashboard-sections.md +++ b/src/docs/dashboard-sections.md @@ -1013,6 +1013,12 @@ The *since* time is the item's `created_at`; "next pass" is the governor's next A row that already wears a hold, `blocked`, a draft marker or any stage record is never *New*; neither is an issue at `015` once the stage-label pass has written it. +#### Advisory row (`triage/advisory`, dedupe checklists) + +An issue that is a note for maintainers rather than work — one wearing `triage/advisory`, a dedupe-agent checklist (body opens with ``) or any body whose verdict line reads `Decision required: no` — is an **advisory** ([#15381](https://github.com/hivecommons/hive/issues/15381) sat for hours as a plain *Open · since 3h*, indistinguishable from stalled work). Its row keeps `kind: issue` and carries `advisory{kind: "advisory", source (label|dedupe-checklist|decision-no), empty, chip, caption}`; the Open chevron reads the chip — **Advisory · read & close**, or **Advisory · nothing found · safe to close** when the checklist's own counts are all zero — muted (`ham-open-advisory`, ⓘ), with no *· since Nh* suffix and never the stale tint. The caption is *Advisory for maintainers · read, then close* (or *… · nothing found · safe to close*), the actor is a human with nothing waiting on them, the row is never *New*, never *stalled* or *sent back*, and it is excluded from **Needs human** and **Needs attention**. The row menu leads with **Close (read)**, which posts the existing `POST /api/repos/{owner}/{repo}/items/{number}/decision` with `decision: close-read`: a "Closed as read (advisory acknowledged) by @you from the Hive dashboard" comment, then the issue closes as *completed* (operator action `close-read` in the row's history). + +The enumeration computes the body-derived part (`RepoWorkIssue.advisory`) because sidelined `hive_advisory` rows do not carry the body. Upstream, the issue-request relay refuses an agent's `issue-create` whose body is a dedupe checklist with no actionable finding (verdict `no`, zero near-duplicate pairs, zero resolved candidates, zero missing PR↔issue links, no `- [ ]` task lines): the agent's result file says why, the write audit records `agent_issue_empty_advisory_refused`, and a knowledge bead keeps the summary in the hive's own log — merge-order reminders and cross-links are notes, not issues. + #### Hive's own unblock is live When the blocked sweep or the review-backlog block reconciler lifts `blocked` itself (the tracked PR merged or closed; the `` note), it takes the same path as an inbound label webhook: the tracker cache is dropped and the issue is queued for the targeted re-read (`ItemPatches` delivery `self:edit`), which patches the status row and the governor's cached snapshot at once. A reconcile enumeration that was already listing when the unblock happened used to overwrite that patch with its pre-unblock copy, and the rows reverted to `blocked` until the next pass (~an hour on the hive's hive); the governor now replays re-reads newer than the listing's start onto the pass's result before publishing it, so a row never moves backwards behind a read it has already made. diff --git a/src/docs/scale-envelope.md b/src/docs/scale-envelope.md index e8f8ff1e50..b1bfe44a51 100644 --- a/src/docs/scale-envelope.md +++ b/src/docs/scale-envelope.md @@ -34,7 +34,7 @@ ones to: 2. **Truncation must preserve the prioritization signal, not cut an arbitrary slice.** This holds today and is easy to assume backwards: - Issues are sorted by actionable rank tier, then **oldest first** within each tier before any cap is applied - (`RankActionableIssues`, `src/pkg/github/client.go:4794-4804`, descending `AgeMinutes` within each tier). + (`RankActionableIssues`, `src/pkg/github/client.go:4804-4814`, descending `AgeMinutes` within each tier). - PRs are sorted by **review class then oldest-first within class** (`SortPullRequestsForReview`, `src/pkg/github/review_priority.go:334`; fixes → refactors/docs → tests). diff --git a/src/pkg/dashboard/api_repo_item_decision.go b/src/pkg/dashboard/api_repo_item_decision.go index ccccc7979b..05e83d78d8 100644 --- a/src/pkg/dashboard/api_repo_item_decision.go +++ b/src/pkg/dashboard/api_repo_item_decision.go @@ -65,7 +65,11 @@ const ( repoItemDecisionDirection = "direction" repoItemDecisionCloseSuperseded = "close-superseded" repoItemDecisionCloseWontFix = "close-wontfix" - repoItemDecisionAdopt = "adopt" + // close-read closes an advisory issue (triage/advisory, a dedupe + // checklist) as completed once a maintainer has read it + // (hivecommons/hive#15381): the row's "Close (read)" action. + repoItemDecisionCloseRead = "close-read" + repoItemDecisionAdopt = "adopt" // Merge-gate answers on a PR parked at stage/090-ready-for-human-merge // (hivecommons/hive#15078). merge-now merges through the hive's App at // once, attributed to the operator; queue-merge records the operator's @@ -97,6 +101,7 @@ const ( adoptRequestLabelDesc = "Owner-delegate request: adopt now in supersede mode" issueStateReasonNotPlanned = "not_planned" + issueStateReasonCompleted = "completed" ) // repoItemDecisionChangeRequests is the store a PR direction is recorded in: @@ -274,6 +279,10 @@ func repoItemDecisionResultWith(repoFull string, number int, itemType, decision, out.Action = rowActionClosed out.Outcome = "Closed as won't fix (not planned)." out.Next = "Nothing further to do; the row leaves the tracker on its next refresh." + case repoItemDecisionCloseRead: + out.Action = rowActionClosed + out.Outcome = "Closed as read (advisory acknowledged)." + out.Next = "Nothing further to do; the row leaves the tracker on its next refresh." case repoItemDecisionAdopt: out.Action = rowActionAdopted out.Outcome = "Adoption queued: `" + label + "` applied." @@ -385,9 +394,17 @@ func (s *Server) handleRepoItemDecision(w http.ResponseWriter, r *http.Request) s.audit.LogRecord(user, action, auditDetail("repo", repoFull, "number", numStr, "decision", event.Decision), "", repoFull, number) jsonResponse(w, repoItemDecisionResponse{OK: true, Repo: repoFull, Number: number, Decision: decision, Status: "unparked", Label: ghpkg.HumanAckLabel, Result: repoItemDecisionResult(repoFull, number, itemType, decision, comment, "", ghpkg.HumanAckLabel, nil)}) - case repoItemDecisionCloseSuperseded, repoItemDecisionCloseWontFix: + case repoItemDecisionCloseSuperseded, repoItemDecisionCloseWontFix, repoItemDecisionCloseRead: verb := "won't fix" + stateReason := issueStateReasonNotPlanned supersededBy := "" + if decision == repoItemDecisionCloseRead { + if itemType != "issue" { + jsonError(w, "close-read applies to issues", http.StatusBadRequest) + return + } + verb, stateReason = "read (advisory acknowledged)", issueStateReasonCompleted + } if decision == repoItemDecisionCloseSuperseded { verb = "superseded" ref, err := parseRepoItemSupersededBy(body.SupersededBy, repoFull) @@ -416,7 +433,7 @@ func (s *Server) handleRepoItemDecision(w http.ResponseWriter, r *http.Request) err := gh.CloseIssue(ctx, repoFull, number, ghpkg.IssueCloseOptions{ OverrideReason: "closed as " + verb + " by @" + user + " from the Hive dashboard", SuppressOverrideComment: true, - StateReason: issueStateReasonNotPlanned, + StateReason: stateReason, // A recorded human decision may close a tracking issue; // only the automated paths are refused. AllowTrackingIssue: true, @@ -478,7 +495,7 @@ func (s *Server) handleRepoItemDecision(w http.ResponseWriter, r *http.Request) } s.handlePullRequestMergeDecision(ctx, w, repoFull, number, user, decision, comment) default: - jsonError(w, "unknown decision; want approve, direction, close-superseded, close-wontfix, adopt, reroute, re-author, merge-now or queue-merge", http.StatusBadRequest) + jsonError(w, "unknown decision; want approve, direction, close-superseded, close-wontfix, close-read, adopt, reroute, re-author, merge-now or queue-merge", http.StatusBadRequest) } } diff --git a/src/pkg/dashboard/api_repo_item_decision_test.go b/src/pkg/dashboard/api_repo_item_decision_test.go index 75f3cab323..e813d4ed20 100644 --- a/src/pkg/dashboard/api_repo_item_decision_test.go +++ b/src/pkg/dashboard/api_repo_item_decision_test.go @@ -320,6 +320,32 @@ func TestRepoItemDecisionCloseWontFixCommentsAndCloses(t *testing.T) { } } +// close-read (hivecommons/hive#15381): an advisory issue is closed as +// completed through the same comment + close path; a PR is refused. +func TestRepoItemDecisionCloseReadClosesAsCompleted(t *testing.T) { + mock := &repoItemDecisionMock{issueLabels: []string{"triage/advisory"}} + srv := newRepoItemDecisionServer(t, mock) + + w := postRepoItemDecision(t, srv, 7, "writer", `{"decision":"close-read"}`) + if w.Code != http.StatusOK { + t.Fatalf("close-read: code=%d body=%s", w.Code, w.Body.String()) + } + if len(mock.comments) != 1 || !strings.Contains(mock.comments[0], "Closed as read (advisory acknowledged) by @writer") { + t.Fatalf("comments = %v", mock.comments) + } + if len(mock.edits) != 1 || mock.edits[0]["state"] != "closed" || mock.edits[0]["state_reason"] != issueStateReasonCompleted { + t.Fatalf("edits = %v", mock.edits) + } + var resp repoItemDecisionResponse + _ = json.Unmarshal(w.Body.Bytes(), &resp) + if resp.Status != "closed" || resp.Result == nil || resp.Result.Outcome != "Closed as read (advisory acknowledged)." { + t.Fatalf("resp = %+v", resp) + } + if w := postRepoItemDecision(t, srv, 8, "writer", `{"decision":"close-read","type":"pr"}`); w.Code != http.StatusBadRequest { + t.Fatalf("close-read on a PR: code=%d want 400 body=%s", w.Code, w.Body.String()) + } +} + func TestRepoItemDecisionCloseSupersededPRUsesSweepPath(t *testing.T) { mock := &repoItemDecisionMock{} srv := newRepoItemDecisionServer(t, mock) diff --git a/src/pkg/dashboard/operator_actions.go b/src/pkg/dashboard/operator_actions.go index e821108ec8..67a6b09f38 100644 --- a/src/pkg/dashboard/operator_actions.go +++ b/src/pkg/dashboard/operator_actions.go @@ -36,6 +36,7 @@ const ( operatorActionGiveDirection = "give-direction" operatorActionCloseSuperseded = "close-superseded" operatorActionWontFix = "wontfix" + operatorActionCloseRead = "close-read" operatorActionLetHiveDecide = "let-hive-decide" operatorActionHold = "hold" operatorActionRelease = "release" @@ -326,6 +327,8 @@ func operatorActionFromBody(endpoint string, body []byte) (operatorActionRequest out.Target = strings.TrimSpace(raw.SupersededBy) case repoItemDecisionCloseWontFix: out.Action = operatorActionWontFix + case repoItemDecisionCloseRead: + out.Action = operatorActionCloseRead case repoItemDecisionMergeNow: out.Action = operatorActionMergeNow case repoItemDecisionQueueMerge: diff --git a/src/pkg/dashboard/stage_tracker.go b/src/pkg/dashboard/stage_tracker.go index 86125788ff..89cb2d3507 100644 --- a/src/pkg/dashboard/stage_tracker.go +++ b/src/pkg/dashboard/stage_tracker.go @@ -310,6 +310,11 @@ type StageTrackerItem struct { // does not count them until the PR reaches stage/080 or later. The // labels themselves are untouched; this is presentation only. DeferredModifiers []string `json:"deferred_modifiers,omitempty"` + // Advisory is set on an issue that is a note for maintainers, not work + // (triage/advisory label, dedupe checklist, "Decision required: no"): + // read it, then close it (hivecommons/hive#15381). Its Chip is the + // Open chevron's word; the row never counts as stalled or attention. + Advisory *StageTrackerAdvisory `json:"advisory,omitempty"` // NeedsHuman is true when a person's decision or action is the ONLY // thing that advances the item (stageTrackerNeedsHuman): stages 015 // triage-needed, 045/085 needs-decision, 071/072 needs-author / @@ -2112,7 +2117,7 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto prOpen := func(repo string, number int) bool { return prState(repo, number) == blockedOnPRStateOpen } supersedes := stageTrackerSupersedesIndex(store, status.GitHubBaseURL) issueFilter := s.issueFilterConfig() - addIssue := func(repoName string, issue github.Issue, bucket, bucketReason string, progress *github.IssueChildren) { + addIssue := func(repoName string, issue github.Issue, bucket, bucketReason string, progress *github.IssueChildren, advisoryHint *github.IssueAdvisory) { // A closed issue has no stage; a stage label it closed wearing is // the closed-issue sweep's to remove, not a row to render // (hivecommons/homebrew-hive#127). @@ -2162,7 +2167,10 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto finish(&it, issue.Labels, stage, rec, ok, false) stageTrackerBlockedBy(&it, issue.OpenBlockers()) stageTrackerBlockedOnPR(&it, issue.Body, bucketReason, status.GitHubBaseURL, prState) - applyStageTrackerNew(&it, stageTrackerNewState(it, ok, issueFilter, status.Governor, now)) + advisory := stageTrackerAdvisoryFor(issue.Labels, issue.Body, advisoryHint) + if advisory == nil { + applyStageTrackerNew(&it, stageTrackerNewState(it, ok, issueFilter, status.Governor, now)) + } if it.Stage == trackerNumberClaimed { it.ClaimantKind = s.stageTrackerClaimantKind(repoName, issue.Number) } @@ -2180,6 +2188,7 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto } it.DecisionNeeded = stageTrackerDecisionNeededWith(it, nil, sentinelLabel, now, bctx) it.StageActor = stageTrackerStageActor(it, workers, now) + applyStageTrackerAdvisory(&it, advisory) add(it) } addPR := func(repoName string, pr github.PullRequest, verdict *github.MergeVerdict, bucket, bucketReason string) { @@ -2269,7 +2278,7 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto for _, it := range repoOpenItems(repo) { switch { case it.Kind == "issue" && !it.Sidelined: - addIssue(repoName, it.Issue, "", "", nil) + addIssue(repoName, it.Issue, "", "", nil, nil) case it.Kind == "pr" && !it.Sidelined: addPR(repoName, it.PR.pr, it.PR.verdict, "", "") case it.Kind == "issue": @@ -2277,7 +2286,7 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto // bucket, the open items the first tracker never showed. w := it.WorkIssue addIssue(repoName, github.Issue{Repo: w.Repo, Number: w.Number, Title: w.Title, Author: w.Author, Labels: w.Labels, Assignees: w.Assignees, - CreatedAt: w.CreatedAt, UpdatedAt: w.UpdatedAt, URL: w.URL, ClaimKind: w.ClaimKind, ClaimedBy: w.ClaimedBy, LinkedPRs: w.LinkedPRs, ClaimContext: w.ClaimContext, IsTracker: w.IsTracker, Children: w.Children}, w.Bucket, w.Reason, w.TrackerProgress) + CreatedAt: w.CreatedAt, UpdatedAt: w.UpdatedAt, URL: w.URL, ClaimKind: w.ClaimKind, ClaimedBy: w.ClaimedBy, LinkedPRs: w.LinkedPRs, ClaimContext: w.ClaimContext, IsTracker: w.IsTracker, Children: w.Children}, w.Bucket, w.Reason, w.TrackerProgress, w.Advisory) default: w := it.WorkPR addPR(repoName, github.PullRequest{Repo: w.Repo, Number: w.Number, Title: w.Title, Author: w.Author, Labels: w.Labels, Draft: w.Draft, @@ -2340,7 +2349,9 @@ var stageTrackerNeedsHumanMods = []string{modNeedsHuman, modNeedsDecision, modUn // action is the only thing that advances the item. A hold wins: a held // item is paused, not waiting on a person (hivecommons/hive#15008). func stageTrackerNeedsHuman(it StageTrackerItem) bool { - if stageTrackerOnHold(it) { + // An advisory waits on nobody: reading and closing it is a courtesy, + // not a decision the pipeline is parked on (hivecommons/hive#15381). + if stageTrackerOnHold(it) || it.Advisory != nil { return false } if slices.ContainsFunc(it.Modifiers, func(m string) bool { return slices.Contains(stageTrackerNeedsHumanMods, m) }) { @@ -2397,7 +2408,7 @@ func stageTrackerRegressionHandled(it StageTrackerItem) bool { // parked on a person. Only the shown Modifiers count, so a merge-gate pill // held back until the gate never promotes a row. func stageTrackerNeedsAttention(it StageTrackerItem) bool { - if stageTrackerRegressionHandled(it) { + if it.Advisory != nil || stageTrackerRegressionHandled(it) { return false } return len(it.Modifiers) > 0 || slices.Contains(stageTrackerAttentionStages, it.Stage) diff --git a/src/pkg/dashboard/stage_tracker_advisory.go b/src/pkg/dashboard/stage_tracker_advisory.go new file mode 100644 index 0000000000..d6798d858a --- /dev/null +++ b/src/pkg/dashboard/stage_tracker_advisory.go @@ -0,0 +1,98 @@ +package dashboard + +import ( + "slices" + "strings" + + "github.com/hivecommons/hive/pkg/github" +) + +// An advisory issue (hivecommons/hive#15381): a `triage/advisory` issue, a +// dedupe checklist, or any body whose second line reads "Decision required: +// no" is a note for maintainers to read and close — no agent picks it up, +// nothing waits on it. The tracker says so instead of drawing it as a plain +// "Open · since 3h" row that reads as stalled work. + +const ( + // StageTrackerAdvisoryKind is StageTrackerAdvisory.Kind; the row's own + // kind stays "issue" (keys and URLs depend on it). + StageTrackerAdvisoryKind = "advisory" + // StageTrackerAdvisoryChip / StageTrackerAdvisoryEmptyChip are the Open + // chevron's word (≤ 8 words). Empty is for a checklist that itself says + // it found nothing actionable. + StageTrackerAdvisoryChip = "Advisory · read & close" + StageTrackerAdvisoryEmptyChip = "Advisory · nothing found · safe to close" + // StageTrackerAdvisoryCaption / StageTrackerAdvisoryEmptyCaption are + // the row captions. + StageTrackerAdvisoryCaption = "Advisory for maintainers · read, then close" + StageTrackerAdvisoryEmptyCaption = "Advisory for maintainers · nothing found · safe to close" + // stageTrackerAdvisoryWhy is the StageActor sentence. + stageTrackerAdvisoryWhy = "advisory for maintainers — read it, then close it; nothing waits on it and no agent picks it up" + + stageTrackerAdvisorySourceLabel = "label" + stageTrackerAdvisorySourceChecklist = "dedupe-checklist" + stageTrackerAdvisorySourceVerdict = "decision-no" +) + +// StageTrackerAdvisory is the payload block on an advisory row. +type StageTrackerAdvisory struct { + Kind string `json:"kind"` + // Source says what classified it: label (triage/advisory), + // dedupe-checklist (the body marker) or decision-no (the verdict line). + Source string `json:"source"` + // Empty is true when the advisory's own body says it found nothing. + Empty bool `json:"empty,omitempty"` + Chip string `json:"chip"` + Caption string `json:"caption"` +} + +// stageTrackerAdvisoryFor classifies an issue from its labels, its body +// (when the caller has it) and the enumeration's body-derived hint (when +// it does not). nil for an ordinary issue. +func stageTrackerAdvisoryFor(labels []string, body string, hint *github.IssueAdvisory) *StageTrackerAdvisory { + if hint == nil && strings.TrimSpace(body) != "" { + hint = github.IssueAdvisoryFromBody(body) + } + adv := &StageTrackerAdvisory{Kind: StageTrackerAdvisoryKind} + switch { + case slices.ContainsFunc(labels, func(l string) bool { return strings.EqualFold(strings.TrimSpace(l), github.DedupeAdvisoryLabelName) }): + adv.Source = stageTrackerAdvisorySourceLabel + case hint != nil && hint.DedupeChecklist: + adv.Source = stageTrackerAdvisorySourceChecklist + case hint != nil && hint.DecisionNo: + adv.Source = stageTrackerAdvisorySourceVerdict + default: + return nil + } + adv.Empty = hint != nil && hint.Empty + adv.Chip, adv.Caption = StageTrackerAdvisoryChip, StageTrackerAdvisoryCaption + if adv.Empty { + adv.Chip, adv.Caption = StageTrackerAdvisoryEmptyChip, StageTrackerAdvisoryEmptyCaption + } + return adv +} + +// stageTrackerAdvisoryMods are the pills an advisory never wears: it is +// not work, so it cannot stall or be sent back. +var stageTrackerAdvisoryMods = []string{modStalled, modRegressed} + +// applyStageTrackerAdvisory marks it as an advisory: the caption and the +// actor say "read, then close", the stall/regression pills come off, the +// 000-new block (which would say "waiting for triage") is dropped, and the +// stage actor is a human with nothing blocking on them. +func applyStageTrackerAdvisory(it *StageTrackerItem, adv *StageTrackerAdvisory) { + if it == nil || adv == nil { + return + } + it.Advisory = adv + it.Caption = adv.Caption + it.Actor = "maintainer" + it.Modifiers = slices.DeleteFunc(it.Modifiers, func(m string) bool { return slices.Contains(stageTrackerAdvisoryMods, m) }) + if it.New != nil { + it.New = nil + if it.StageSlug == StageTrackerNewSlug { + it.StageSlug = "" + } + } + it.StageActor = &StageTrackerActor{Kind: StageActorHuman, Why: stageTrackerAdvisoryWhy, Since: it.StageSince} +} diff --git a/src/pkg/dashboard/stage_tracker_advisory_test.go b/src/pkg/dashboard/stage_tracker_advisory_test.go new file mode 100644 index 0000000000..2465ffe63f --- /dev/null +++ b/src/pkg/dashboard/stage_tracker_advisory_test.go @@ -0,0 +1,268 @@ +package dashboard + +import ( + "os" + "os/exec" + "path/filepath" + "strings" + "testing" + "time" + + "github.com/hivecommons/hive/pkg/github" +) + +// hivecommons/hive#15381 as the enumeration saw it: labels help wanted, +// agent/dedupe, triage/advisory; a dedupe-checklist body with zero +// actionable findings. +var issue15381Labels = []string{"help wanted", "agent/dedupe", "triage/advisory"} + +func issue15381Body(t *testing.T) string { + t.Helper() + b, err := os.ReadFile(filepath.Join("..", "github", "testdata", "dedupe_checklist_15381.md")) + if err != nil { + t.Fatal(err) + } + return string(b) +} + +func TestStageTrackerAdvisoryFor(t *testing.T) { + body := issue15381Body(t) + adv := stageTrackerAdvisoryFor(issue15381Labels, body, nil) + if adv == nil || adv.Kind != StageTrackerAdvisoryKind || adv.Source != stageTrackerAdvisorySourceLabel || !adv.Empty { + t.Fatalf("#15381 from labels+body = %+v", adv) + } + if adv.Chip != "Advisory · nothing found · safe to close" || adv.Caption != StageTrackerAdvisoryEmptyCaption { + t.Errorf("#15381 chip/caption = %q / %q", adv.Chip, adv.Caption) + } + // The sidelined path has no body, only the enumeration's hint. + hint := github.IssueAdvisoryFromBody(body) + if got := stageTrackerAdvisoryFor(issue15381Labels, "", hint); got == nil || !got.Empty || got.Chip != adv.Chip { + t.Errorf("#15381 from labels+hint = %+v", got) + } + // Label alone, body unknown: an advisory, not known to be empty. + if got := stageTrackerAdvisoryFor([]string{"Triage/Advisory"}, "", nil); got == nil || got.Empty || got.Chip != "Advisory · read & close" || got.Caption != "Advisory for maintainers · read, then close" { + t.Errorf("label only = %+v", got) + } + // Marker without the label; verdict line without either. + if got := stageTrackerAdvisoryFor(nil, "\nDecision required: yes\n\n- [ ] #1 dup of #2\n", nil); got == nil || got.Source != stageTrackerAdvisorySourceChecklist || got.Empty { + t.Errorf("marker only = %+v", got) + } + if got := stageTrackerAdvisoryFor(nil, "FYI\nDecision required: no\n", nil); got == nil || got.Source != stageTrackerAdvisorySourceVerdict { + t.Errorf("verdict only = %+v", got) + } + if got := stageTrackerAdvisoryFor([]string{"kind/bug"}, "Please fix.", nil); got != nil { + t.Errorf("ordinary issue = %+v", got) + } +} + +// An advisory row in the built tracker: advisory block set, "read, then +// close" caption, no stalled/attention/needs-human accounting, no 000-new +// block, human actor with nothing waiting. +func TestStageTrackerAdvisoryRow(t *testing.T) { + now := time.Date(2026, 10, 29, 12, 0, 0, 0, time.UTC) + s, store := stageTrackerFixture(t, now) + created := now.Add(-3 * time.Hour) + body := issue15381Body(t) + + s.statusMu.Lock() + repo := &s.status.Repos[0] + repo.NonActionableIssues = []any{ + github.RepoWorkIssue{Repo: "acme/console", Number: 15381, Title: "triage: duplicate and overlapping open issues/PRs to consolidate", Author: "hive-app[bot]", + Labels: issue15381Labels, Bucket: "hive_advisory", Reason: "triage/advisory", CreatedAt: created, UpdatedAt: created, + Advisory: github.IssueAdvisoryFromBody(body)}, + github.RepoWorkIssue{Repo: "acme/console", Number: 15382, Title: "Advisory with actions pending", Author: "hive-app[bot]", + Labels: []string{"triage/advisory"}, Bucket: "hive_advisory", Reason: "triage/advisory", CreatedAt: created}, + } + s.statusMu.Unlock() + + resp := s.buildStageTracker(s.status, store, now) + it := trackerItem(t, resp, "issue", 15381) + if it.Advisory == nil || !it.Advisory.Empty || it.Advisory.Kind != "advisory" { + t.Fatalf("#15381 advisory = %+v", it.Advisory) + } + if it.Caption != "Advisory for maintainers · nothing found · safe to close" || it.Advisory.Chip != "Advisory · nothing found · safe to close" { + t.Errorf("#15381 caption/chip = %q / %q", it.Caption, it.Advisory.Chip) + } + if it.Kind != "issue" || it.Stage != 0 || it.New != nil || it.StageSlug == StageTrackerNewSlug { + t.Errorf("#15381 kind/stage/new = %q/%d/%+v slug=%q", it.Kind, it.Stage, it.New, it.StageSlug) + } + if it.NeedsHuman || stageTrackerNeedsAttention(it) || hasMod(it, modStalled) { + t.Errorf("#15381 counted as work: needs_human=%v attention=%v mods=%v", it.NeedsHuman, stageTrackerNeedsAttention(it), it.Modifiers) + } + if it.StageActor == nil || it.StageActor.Kind != StageActorHuman || !strings.Contains(it.StageActor.Why, "nothing waits on it") { + t.Errorf("#15381 actor = %+v", it.StageActor) + } + other := trackerItem(t, resp, "issue", 15382) + if other.Advisory == nil || other.Advisory.Empty || other.Caption != "Advisory for maintainers · read, then close" || other.Advisory.Chip != "Advisory · read & close" { + t.Errorf("label-only advisory = %+v caption=%q", other.Advisory, other.Caption) + } + for _, n := range []int{1, 2, 3} { + if plain, ok := trackerItemOK(resp, "issue", n); ok && plain.Advisory != nil { + t.Errorf("ordinary issue #%d classified as advisory: %+v", n, plain.Advisory) + } + } +} + +func trackerItemOK(resp StageTrackerResponse, kind string, number int) (StageTrackerItem, bool) { + for _, it := range resp.Items { + if it.Kind == kind && it.Number == number { + return it, true + } + } + return StageTrackerItem{}, false +} + +// The SPA side (hivecommons/hive#15381): the Open chevron of an advisory +// row is its chip with no "· since Nh" and no stale tint, the headline is +// the chip, the row leads with Close (read) which posts the existing +// decision path with `close-read`, and the attention / needs-human filters +// skip it. +func TestStageTrackerAdvisoryChipAndAction(t *testing.T) { + html := indexHTML(t) + for _, want := range []string{ + ".ham-seg.active.ham-open-advisory {", + "'decide:close-read': 'Close (read)'", + "function stageTrackerAdvisoryOf(item)", + } { + if !strings.Contains(html, want) { + t.Fatalf("index.html missing %q", want) + } + } + if _, err := exec.LookPath("node"); err != nil { + t.Skip("node not on PATH — the advisory chip/action was NOT executed by this run") + } + // Rendering: the chip, the headline, the filters. + runStageTrackerRowActionsScript(t, "const assert = require('assert');\nfunction esc(s) { return String(s).replace(/&/g, '&').replace(/Advisory · nothing found · safe to close'), strip); +assert.ok(/title="Advisory for maintainers · nothing found · safe to close/.test(strip), strip); +assert.strictEqual(stageTrackerHeadline(empty), 'Advisory · nothing found · safe to close'); +assert.strictEqual(stageTrackerHeadline(plainAdvisory), 'Advisory · read & close'); +assert.strictEqual(stageTrackerActorKind(empty), 'human'); +// Not counted as attention or needs-human. +assert.strictEqual(stageTrackerNeedsAttention(empty), false); +assert.strictEqual(stageTrackerItemNeedsHuman(empty), false); +// An ordinary Open row still says since / stale. +const ordinary = { repo: 'o/r', number: 2, kind: 'issue', stage: 0, caption: 'No stage recorded yet', stage_since: '2026-10-26T09:00:00Z', labels: [], modifiers: [] }; +const os = stageTrackerSegments(ordinary, stages, now)[0]; +assert.strictEqual(os.short, 'Open · since 3d', os.short); +assert.ok(os.openSince && os.openSince.stale); +assert.strictEqual(stageTrackerHeadline(ordinary), 'Open'); + +`) + // Row action: Close (read) leads and posts the existing decision path. + runStageTrackerRowActionsScript(t, stageTrackerRowActionsPreamble(t, html)+stageTrackerConfirmOptOutJS(t, html)+jsFunc(t, html, "stageTrackerAdvisoryOf")+` +const empty = { repo: 'hivecommons/hive', number: 15381, kind: 'issue', title: 'triage: duplicate and overlapping open issues/PRs to consolidate', author: 'hivecommons-hive[bot]', author_kind: 'hive', + stage: 0, created_at: '2026-10-29T09:00:00Z', stage_since: '2026-10-26T09:00:00Z', labels: ['help wanted', 'agent/dedupe', 'triage/advisory'], bucket: 'hive_advisory', modifiers: [], + caption: 'Advisory for maintainers · nothing found · safe to close', + advisory: { kind: 'advisory', source: 'label', empty: true, chip: 'Advisory · nothing found · safe to close', caption: 'Advisory for maintainers · nothing found · safe to close' }, + stage_actor: { kind: 'human', why: 'advisory for maintainers — read it, then close it; nothing waits on it and no agent picks it up' } }; +const plainAdvisory = Object.assign({}, empty, { number: 15382, advisory: { kind: 'advisory', source: 'label', chip: 'Advisory · read & close', caption: 'Advisory for maintainers · read, then close' } }); +const ordinary = { repo: 'o/r', number: 2, kind: 'issue', stage: 0, caption: 'No stage recorded yet', stage_since: '2026-10-26T09:00:00Z', labels: [], modifiers: [] }; + +// Row action: Close (read) leads, posts the existing decision path with close-read. +const ids = as => as.map(a => a.id); +const ctx = { user: true, canHold: true, canHuman: true }; +const as = stageTrackerRowActions(empty, ctx); +assert.deepStrictEqual(ids(as), ['decide:close-read', 'hold', 'retry', 'needs-human', 'open', 'copy'], ids(as).join(',')); +assert.strictEqual(as[0].label, 'Close (read)'); +assert.ok(as[0].lead && as[0].enabled, JSON.stringify(as[0])); +assert.ok(as[0].hint.startsWith('nothing found'), as[0].hint); +assert.ok(stageTrackerRowActions(plainAdvisory, ctx)[0].hint.startsWith('advisory acknowledged')); +const ro = stageTrackerRowActions(empty, { user: false, canHold: true }); +assert.strictEqual(ro[0].enabled, false); assert.strictEqual(ro[0].why, STAGE_TRACKER_WHY_WRITE); +assert.strictEqual(ids(stageTrackerRowActions(ordinary, ctx)).indexOf('decide:close-read'), -1, 'no Close (read) on an ordinary issue'); +const req = stageTrackerActionRequest(empty, 'decide:close-read', {}); +assert.deepStrictEqual(req, { url: '/api/repos/hivecommons/hive/items/15381/decision', body: { decision: 'close-read', comment: '', type: 'issue' } }); +assert.strictEqual(stageTrackerActionLabel('decide:close-read'), 'Close (read)'); +assert.strictEqual(stageTrackerActingCaption('decide:close-read', empty), 'Closing…'); +(async () => { + assert.deepStrictEqual(await stageTrackerActionPayload([empty], 'decide:close-read'), {}); + assert.strictEqual(dialogs.length, 1); + assert.strictEqual(dialogs[0].kind, 'confirm'); + assert.ok(dialogs[0].cfg.message.includes('hivecommons/hive#15381') && dialogs[0].cfg.message.includes('closes as completed'), dialogs[0].cfg.message); + dialogAnswer = false; + assert.strictEqual(await stageTrackerActionPayload([empty], 'decide:close-read'), null); +})().catch(e => { console.error(e); process.exit(1); }); +`) +} diff --git a/src/pkg/dashboard/static-src/css/tracker.css b/src/pkg/dashboard/static-src/css/tracker.css index 966b13fb34..eabaf0daff 100644 --- a/src/pkg/dashboard/static-src/css/tracker.css +++ b/src/pkg/dashboard/static-src/css/tracker.css @@ -304,6 +304,10 @@ it a move but the next pass" (hivecommons/hive#15094). */ .ham-seg.active.ham-open-new { background: var(--blue); color: var(--surface-0); } .ham-seg.active.ham-open-new .ham-seg-t::before { content: '✦'; margin-right: var(--sp-1); } + /* Advisory (hivecommons/hive#15381): a note for maintainers, not + work — muted, never stale-tinted, read then close. */ + .ham-seg.active.ham-open-advisory { background: var(--surface-2); color: var(--muted); } + .ham-seg.active.ham-open-advisory .ham-seg-t::before { content: 'ⓘ'; margin-right: var(--sp-1); } .ham-seg.active.ham-open-stale { background: color-mix(in srgb, var(--amber) 65%, var(--red)); } .ham-detour { white-space: normal; overflow-wrap: anywhere; } .ham-current-stage { display: none; margin: 0; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; } diff --git a/src/pkg/dashboard/static-src/js/tracker-actions.js b/src/pkg/dashboard/static-src/js/tracker-actions.js index f43bb5eb6a..0049fe8d05 100644 --- a/src/pkg/dashboard/static-src/js/tracker-actions.js +++ b/src/pkg/dashboard/static-src/js/tracker-actions.js @@ -34,6 +34,7 @@ const STAGE_TRACKER_ACTION_LABELS = { 'decide:delegate': 'Let hive decide', 'decide:delegate-all': 'Let hive decide — all PRs', 'decide:delegate:rerun': 'Re-run decision', 'decide:approve': 'Approve', 'decide:direction': 'Give direction', 'decide:close-superseded': 'Close as superseded by', 'decide:close-wontfix': "Close as won't-fix", + 'decide:close-read': 'Close (read)', 'decide:adopt': 'Adopt (hive takes over)', 'decide:merge-now': 'Approve & merge as maintainer', 'decide:queue-merge': 'Approve — let hive merge', 'decide:re-author': 'Re-author as hive PR', @@ -390,6 +391,11 @@ // hold): the ask the row makes has its answer first. const triage = stageTrackerTriageNeeded(item); if (triage) out.push({ id: 'accept-triage', label: 'Accept triage', hint: stageTrackerTriageHint(item, ctx, ctx.nowMs, ctx.governor), enabled: write, why: write ? '' : STAGE_TRACKER_WHY_WRITE, lead: true }); + // An advisory issue (hivecommons/hive#15381) asks for one thing: + // read it, then close it. "Close (read)" leads; it is the existing + // decision close path with the verdict `close-read`. + const advisory = typeof stageTrackerAdvisoryOf === 'function' ? stageTrackerAdvisoryOf(item) : null; + if (advisory) out.push(Object.assign({ id: 'decide:close-read', label: STAGE_TRACKER_ACTION_LABELS['decide:close-read'], hint: advisory.empty ? 'nothing found · closes as completed' : 'advisory acknowledged · closes as completed', lead: true }, stageTrackerActionAllowed('decide:close-read', ctx))); for (const a of lead) out.push(a); if (target) { const on = target === item ? '' : ' PR #' + (Number(target.number) || 0); @@ -1432,6 +1438,8 @@ const v = await stageTrackerAsk(id, 'prompt', { title: stageTrackerActionLabel(id), label: 'Comment for ' + refs + ' (optional)', placeholder: 'Why this is closed', confirmLabel: 'Close' }); return v == null ? null : { comment: v }; } + case 'decide:close-read': + return (await stageTrackerAsk(id, 'confirm', { title: 'Close (read)', message: 'Close ' + refs + ' as read, as ' + who + '? It is an advisory for maintainers — nothing waits on it; the issue closes as completed with a note that you read it.', confirmLabel: 'Close' })) ? {} : null; case 'decide:merge-now': { const base = items.map(it => it.base_ref || '').filter(Boolean)[0] || 'its base branch'; if (items.some(stageTrackerNeedsRebase)) { @@ -1509,7 +1517,7 @@ const STAGE_TRACKER_ACTING_CAPTIONS = { 'hold': 'Holding…', 'release': 'Releasing hold…', 'retry': 'Re-evaluating…', 'needs-human': 'Marking needs-human…', 'accept-triage': 'Accepting triage…', 'blocker:recheck': 'Checking App permissions…', 'blocker:close-partial': 'Closing as partial…', - 'decide:delegate': 'Hive deciding…', 'decide:delegate-all': 'Hive deciding each PR…', 'decide:delegate:rerun': 'Hive deciding again…', 'decide:approve': 'Approving…', 'decide:direction': 'Recording direction…', 'decide:close-superseded': 'Closing…', 'decide:close-wontfix': 'Closing…', + 'decide:delegate': 'Hive deciding…', 'decide:delegate-all': 'Hive deciding each PR…', 'decide:delegate:rerun': 'Hive deciding again…', 'decide:approve': 'Approving…', 'decide:direction': 'Recording direction…', 'decide:close-superseded': 'Closing…', 'decide:close-wontfix': 'Closing…', 'decide:close-read': 'Closing…', 'decide:merge-now': 'Merging…', 'decide:queue-merge': 'Queuing for merge…', 'decide:re-author': 'Queuing re-authoring…', 'decide:merge-now': 'Merging…', 'decide:queue-merge': 'Queuing for merge…', 'decide:adopt': 'Adopting…', 'decide:adopt-now': 'Adopting now…', 'decide:reroute': 'Rerouting…', diff --git a/src/pkg/dashboard/static-src/js/tracker-filter.js b/src/pkg/dashboard/static-src/js/tracker-filter.js index f02c3a4e63..985ac6b889 100644 --- a/src/pkg/dashboard/static-src/js/tracker-filter.js +++ b/src/pkg/dashboard/static-src/js/tracker-filter.js @@ -67,6 +67,8 @@ function stageTrackerNeedsAttention(item) { const mods = Array.isArray(item.modifiers) ? item.modifiers : []; const n = Number(item.stage) || 0; + // An advisory is a note, not work (hivecommons/hive#15381). + if (item && item.advisory) return false; if (stageTrackerRegressionHandled(item)) return false; return mods.length > 0 || STAGE_TRACKER_ATTENTION_STAGES.indexOf(n) >= 0; } @@ -109,7 +111,7 @@ // cannot disagree. Stage/modifier based: labels alone (needs-signal, // hold, …) never qualify a row. A held row is paused, not waiting. function stageTrackerItemNeedsHuman(item) { - if (!item || stageTrackerItemOnHold(item)) return false; + if (!item || item.advisory || stageTrackerItemOnHold(item)) return false; const mods = Array.isArray(item.modifiers) ? item.modifiers : []; if (mods.some(m => STAGE_TRACKER_NEEDS_HUMAN_MODS.indexOf(m) >= 0)) return true; const n = Number(item.stage) || 0; diff --git a/src/pkg/dashboard/static-src/js/tracker-row.js b/src/pkg/dashboard/static-src/js/tracker-row.js index 6e62e04bb5..5f11fb93d1 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row.js +++ b/src/pkg/dashboard/static-src/js/tracker-row.js @@ -69,19 +69,22 @@ // 000-new: the payload says nothing has placed the item yet and // names who moves it next (hivecommons/hive#15094). const openNew = n === 0 && state === 'active' && !openHold && !openBlocked && !openDraft && typeof stageTrackerNewState === 'function' && !!stageTrackerNewState(item); + const advisory = n === 0 && state === 'active' && !openHold && !openBlocked && typeof stageTrackerAdvisoryOf === 'function' ? stageTrackerAdvisoryOf(item) : null; if (openHold) word = 'Open · hold'; else if (openBlocked) word = 'Open · blocked'; + else if (advisory) word = advisory.chip || 'Advisory · read & close'; else if (openDraft) word = 'Draft'; else if (openNew) word = 'New'; // A plain, blocked or draft Open step (no stage label, not held) // says how long it has sat there, from the same instant the since - // column shows — a stale blocked item is exactly what should stand out. + // column shows — a stale blocked item is exactly what should stand + // out. An advisory never does: nothing waits on it. let openSince = null; - if (n === 0 && state === 'active' && !openHold && !detour && nowMs) { + if (n === 0 && state === 'active' && !openHold && !advisory && !detour && nowMs) { const os = stageTrackerOpenSince(item); if (os.ms) { word += ' · since ' + stageTrackerShortAgo(nowMs - os.ms); openSince = Object.assign({ stale: !openDraft && nowMs - os.ms > STAGE_TRACKER_OPEN_STALE_DAYS * 86400000 }, os); } } - return { number: n, code: n ? String(n).padStart(3, '0') : '', short: word, label: (typeof stageTrackerStageName === 'function' && (stageTrackerStageName(tipStage) || stageTrackerStageName(st))) || tipStage.label || st.label || String(n), description: tipStage.description || st.description || '', state, terminal: false, detour: n === anchor ? detour : null, hold: openHold, blocked: openBlocked, draft: openDraft, isNew: openNew, openSince }; + return { number: n, code: n ? String(n).padStart(3, '0') : '', short: word, label: (typeof stageTrackerStageName === 'function' && (stageTrackerStageName(tipStage) || stageTrackerStageName(st))) || tipStage.label || st.label || String(n), description: tipStage.description || st.description || '', state, terminal: false, detour: n === anchor ? detour : null, hold: openHold, blocked: openBlocked, draft: openDraft, isNew: openNew && !advisory, advisory: !!advisory, openSince }; }); segs.push({ number: STAGE_TRACKER_TERMINAL, code: '', short: 'Merged', label: 'Merged', description: 'Merged — the pipeline is complete', state: terminal ? 'active' : 'todo', terminal, cap: true, detour: null }); return segs; @@ -181,6 +184,14 @@ return state + (sa.kind === 'bot' ? ' · bot PR' : ' · nobody on it'); } + // Advisory (hivecommons/hive#15381): a payload `advisory` block means + // the issue is a note for maintainers, not work — the chevron word is + // its chip, it never reads stale or "since Nh", and the row action is + // Close (read). Pure so the fixture tests can lift it by name. + function stageTrackerAdvisoryOf(item) { + if (!item || item.kind === 'pr' || !item.advisory || typeof item.advisory !== 'object') return null; + return item.advisory; + } // 000-new (hivecommons/hive#15094): a payload `new` block on a stage-0 // row means nothing has placed the item yet. These are pure so the // fixture tests can lift them by name. @@ -271,7 +282,7 @@ if (sg.number < from || sg.number > to) return `
`; const sentinel = !!(sg.detour && sg.detour.sentinel); const sentinelSuffix = !!(sg.detour && sg.detour.sentinelSuffix); - const cls = ['ham-seg', sg.state, sg.cap ? 'cap' : '', sg.cap && sg.terminal ? 'merged' : '', sg.detour ? 'detoured' : '', sg.hold ? 'ham-open-hold' : '', sg.blocked ? 'ham-open-blocked' : '', sg.draft ? 'ham-open-draft' : '', sg.isNew ? 'ham-open-new' : '', sg.openSince && sg.openSince.stale ? 'ham-open-stale' : '', sentinel || sentinelSuffix ? 'ham-sentinel' : ''].filter(Boolean).join(' '); + const cls = ['ham-seg', sg.state, sg.cap ? 'cap' : '', sg.cap && sg.terminal ? 'merged' : '', sg.detour ? 'detoured' : '', sg.hold ? 'ham-open-hold' : '', sg.blocked ? 'ham-open-blocked' : '', sg.draft ? 'ham-open-draft' : '', sg.isNew ? 'ham-open-new' : '', sg.advisory ? 'ham-open-advisory' : '', sg.openSince && sg.openSince.stale ? 'ham-open-stale' : '', sentinel || sentinelSuffix ? 'ham-sentinel' : ''].filter(Boolean).join(' '); const active = sg.state === 'active'; let tip = ''; if (active) { @@ -279,6 +290,7 @@ if (sg.blocked) tip += ' — ' + stageTrackerBlockedTip(item); if (sg.draft) tip += ' — ' + STAGE_TRACKER_DRAFT_TIP; if (sg.isNew && typeof stageTrackerNewLines === 'function') tip = 'New — ' + stageTrackerNewLines(item, nowMs).join(' — '); + if (sg.advisory) tip = (item.advisory && item.advisory.caption) || 'Advisory for maintainers · read, then close'; if (sg.openSince) tip += ' — open since ' + new Date(sg.openSince.ms).toISOString() + (sg.openSince.fromCreated ? ' (opened)' : ''); // The shared Merge gate word hides 080 vs 095 vs 100; the chevron tooltip carries it. // With merge_gate in the payload the sentence is the gate's own @@ -565,7 +577,7 @@ request still on the wire) is a different thing drawn on the chevron; this badge appears once the server has recorded the action. */ const STAGE_TRACKER_ACTED_LABELS = { - approve: 'Approve', 'give-direction': 'Give direction', 'close-superseded': 'Close as superseded', wontfix: "Close as won't-fix", + approve: 'Approve', 'give-direction': 'Give direction', 'close-superseded': 'Close as superseded', wontfix: "Close as won't-fix", 'close-read': 'Closed (read)', 'let-hive-decide': 'Let hive decide', hold: 'Hold', release: 'Release hold', 'accept-triage': 'Accept triage', 'mark-needs-human': 'Mark needs-human', 'merge-now': 'Approve & merge as maintainer', 'queue-merge': 'Approve — let hive merge', adopt: 'Adopt', 'adopt-now': 'Adopt now', reroute: 'Reroute to another clanker', @@ -679,7 +691,7 @@ } // Row-menu action id each ledger action was submitted under, so the // option the owner just took is not offered back to them. - const STAGE_TRACKER_ACTED_OPTION_ID = { 'let-hive-decide': 'decide:delegate', approve: 'decide:approve', 'give-direction': 'decide:direction', 'close-superseded': 'decide:close-superseded', wontfix: 'decide:close-wontfix', 'accept-triage': 'accept-triage', hold: 'hold', 'merge-now': 'decide:merge-now', 'queue-merge': 'decide:queue-merge', 're-author': 'decide:re-author', adopt: 'decide:adopt', 'adopt-now': 'decide:adopt-now', reroute: 'decide:reroute' }; + const STAGE_TRACKER_ACTED_OPTION_ID = { 'let-hive-decide': 'decide:delegate', approve: 'decide:approve', 'give-direction': 'decide:direction', 'close-superseded': 'decide:close-superseded', wontfix: 'decide:close-wontfix', 'close-read': 'decide:close-read', 'accept-triage': 'accept-triage', hold: 'hold', 'merge-now': 'decide:merge-now', 'queue-merge': 'decide:queue-merge', 're-author': 'decide:re-author', adopt: 'decide:adopt', 'adopt-now': 'decide:adopt-now', reroute: 'decide:reroute' }; // Pure: what the owner can still do when their action changed nothing // (no-op) or the item has not moved (stuck): the enabled options from // the row's decision_needed payload, minus the one just taken. diff --git a/src/pkg/dashboard/static-src/js/tracker-words.js b/src/pkg/dashboard/static-src/js/tracker-words.js index d328b0f0ab..7bdf783755 100644 --- a/src/pkg/dashboard/static-src/js/tracker-words.js +++ b/src/pkg/dashboard/static-src/js/tracker-words.js @@ -347,6 +347,8 @@ const holdLabels = stageTrackerHoldLabels(item); if (mods.indexOf('stalled') >= 0) return 'Stalled'; if (mods.indexOf('regressed') >= 0 && !stageTrackerRegressionHandled(item)) return 'Sent back'; + // Advisory (hivecommons/hive#15381): the chip is the headline. + if (n === 0 && item.kind !== 'pr' && item.advisory && typeof item.advisory === 'object') return item.advisory.chip || 'Advisory · read & close'; if (n === 0 && mods.indexOf('hold') >= 0) return 'Open · on hold' + (holdLabels.length ? ' (' + holdLabels.join(', ') + ')' : ''); if (n === 0 && mods.indexOf('blocked') >= 0) return 'Open · blocked'; if (n === 0 && mods.indexOf('draft') >= 0) return 'Open · draft'; diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 2428f0540b..834b3aceab 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -1627,6 +1627,10 @@ it a move but the next pass" (hivecommons/hive#15094). */ .ham-seg.active.ham-open-new { background: var(--blue); color: var(--surface-0); } .ham-seg.active.ham-open-new .ham-seg-t::before { content: '✦'; margin-right: var(--sp-1); } + /* Advisory (hivecommons/hive#15381): a note for maintainers, not + work — muted, never stale-tinted, read then close. */ + .ham-seg.active.ham-open-advisory { background: var(--surface-2); color: var(--muted); } + .ham-seg.active.ham-open-advisory .ham-seg-t::before { content: 'ⓘ'; margin-right: var(--sp-1); } .ham-seg.active.ham-open-stale { background: color-mix(in srgb, var(--amber) 65%, var(--red)); } .ham-detour { white-space: normal; overflow-wrap: anywhere; } .ham-current-stage { display: none; margin: 0; font-size: var(--fs-xs); color: var(--muted); overflow-wrap: anywhere; } @@ -14480,6 +14484,8 @@