Skip to content

🐛 fix(stage): clear needs-triage once an issue is actionable or claimed - #14648

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
fix/triage-on-claimed
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
fix/triage-on-claimed

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #14644

What

needs-triage is now removed in the same label write that moves an issue to stage/020-claimed or later; open issues already at 020+ still wearing it are reconciled on the next sweep; the activity monitor derives a row's stage text from the stage label only and reports a leftover needs-triage as stale_labels (muted tooltip line) instead of "Triage needed".

Why

#14586: a hive-filed self-report (fleetreport stamps needs-triage at filing) was claimed by the scanner, closed, and still wore needs-triage — the tracker read Claimed · triage needed. 015 is documented as a tracking state, not a gate (stagelabels.go, transition table 015→020), so the scanner rightly claimed it; but stagelabels.Plan never touched the non-owned label and stage_tracker.go deliberately kept the chip on non-015 stages. This PR makes the code match the documented design: claiming settles triage.

How

  • stagelabels: Desired.Clear — labels Plan removes alongside the stage (case-insensitive, never adds, no-op when absent). Stage.SettlesTriage() is true at 020/030/040 and PR-mirrored stages; false at 010/015/017/045 (which the table lets fall back to 015, so the label must survive there).
  • stageengine: IssueFacts.TriageAwaitingLabel; Decision.Clear populated when the derived stage settles triage, so a direct 015→020 claim (sweep or out-of-cycle FactSink) clears it atomically with the stage write via Enforce.
  • github: sweep pre-plan sets want.Clear so an already-correct 020 issue still wearing the label gets one reconciling write.
  • dashboard: modifier dropped and StaleLabels set when stage.SettlesTriage(); stageTrackerStaleLabelsText tooltip helper; no "Accept triage" offered on a claimed row.
  • Tests: Plan/SettlesTriage table, derive 015→020 / 030 / 040 / 045 / absent-label, sweep end-to-end (removed contains needs-triage + 015, unrelated labels untouched, already-claimed sheds only the stale label, untriaged keeps it), dashboard Go + node fixture.
  • Docs: labels-and-control-signals.md (015 row, reporter-trust row, diagram), dashboard-sections.md; changelog fragment.

Not in this PR

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#14651 🌱 dashboard: defer merge-gate pills until the PR reaches the gate CONFLICT src/docs/dashboard-sections.md
src/pkg/dashboard/static/index.html
#14657 🐛 dashboard: anchor tracker rows on the open PR when the issue has closed same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14656 🐛 fix: keep the header's right chips from overlapping the title at 769-900px same files src/pkg/dashboard/static/index.html
#14573 ✨ feat(dashboard): show a draft pill in the activity tracker CONFLICT src/docs/dashboard-sections.md
#14630 🐛 fix(dashboard): enrich soft-linked stage-tracker issues with title and state same files src/pkg/dashboard/stage_tracker.go

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 27, 2026
@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 27, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • build-and-test

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Why:

  • the branch conflicts with the base and needs a rebase

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

A hive-filed self-report wears needs-triage from filing (fleetreport);
015 is a tracking state, not a gate, so the scanner claims it, and the
stage reconciler never touched the non-owned label — leaving claimed and
closed issues reading "Triage needed" on the activity monitor (#14586).

- stagelabels: Desired.Clear names labels Plan removes alongside the
  stage; Stage.SettlesTriage() is true from 020 on (and PR-mirrored
  stages), false at 010/015/017/045 which may fall back to 015.
- stageengine: IssueFacts.TriageAwaitingLabel; Decision.Clear set when
  the derived stage settles triage, so a direct 015→020 claim removes
  needs-triage in the same label write.
- github: sweep reconciles open issues already at 020+ still wearing it.
- dashboard: stage text comes from the stage label only; a stale
  needs-triage on 020+ is dropped from modifiers and reported as
  stale_labels with a muted tooltip line.

Fixes #14644

Signed-off-by: Andy Anderson <andy@clubanderson.com>
…t into node fixtures

Desired now carries a []string (Clear), so the struct is no longer
comparable with !=; and the Go-driven node fixtures that evaluate
stageTrackerTooltip must extract the new helper it calls.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/triage-on-claimed branch from 6ecb06b to b9f68ea Compare October 27, 2026 18:15
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 27, 2026
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 27, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 27, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me — read at b9f68ea against the v5 tree, not just the diff.

  • stagelabels.go SettlesTriage(): s != None && !s.Before(Claimed) && s != IssueNeedsDecision. Against the definitions table (stagelabels.go:262-278) that is true for 020/030/040 and every PR-mirrored stage, false for 010/015/017/045/None — exactly the set the PR body and labels-and-control-signals.md describe.
  • Plan (stagelabels.go:814-838): clearSet is consulted only after the wanted check, so a label the stage still wants can never be cleared; it removes the label as spelled in current, so mis-cased labels come off too. Never adds. Matches the doc comment on Desired.Clear.
  • Sweep path, issue_stage_labels.go:483-485 → :490: setting want.Clear makes Plan non-empty for an already-correct 020 issue, so it enters pending and reaches ReconcileBatch instead of hitting the continue at :491. The actual write is then the engine's Decision.Clear from issueFactsFrom(in, prStage) → resolveIssueLabelFacts (issue_stage_facts.go:38), which now sets TriageAwaitingLabel — so pre-plan and engine agree on the same label.
  • Out-of-cycle path: issueDeriver.Derive (issue_stage_facts.go:131-139) rebuilds the input from f.Labels and re-runs resolveIssueLabelFacts, so a FactSink claim (015→020) also gets Clear populated — the "atomically with the stage write" claim in the body holds for both entry points.
  • Dashboard stage_tracker.go:1180-1186: StaleLabels is set only when stage != TriageNeeded and the chip was present; at 015 itself the chip is simply dropped as before. No change for 010/017/045 rows.

Body matches diff; no scope beyond #14644. Nothing blocking from me — the BLOCKED merge state is the branch's review requirement, not a red check (the three CANCELLED "Sign-off survives the squash" runs are superseded runs; the current one is green).

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me at b9f68ea; the two write paths agree and Clear survives all the way to the label call. No changes requested.

What I checked in the tree, not just the diff:

  • Both paths produce the same removal. The sweep pre-plan sets want.Clear at src/pkg/github/issue_stage_labels.go:485-487, and the engine path sets Decision.Clear via issueTriageClear (src/pkg/stageengine/derive_issue.go:74-80) from IssueFacts.TriageAwaitingLabel, which resolveIssueLabelFacts fills from the same triageAwaitingLabel constant (issue_stage_facts.go:102-105). The reconciler then calls Writer.Apply(ctx, f.Ref, f.Labels, d.Desired()) (stageengine/reconciler.go:159) → stageWriter.Apply (github/stage_writer.go:26) → Plan(hint, want) / Plan(fresh, want) (stagelabels/enforce.go:65,75) — nothing in that chain rebuilds Desired without Clear. The Enforce helper at enforce.go:107 builds its own Desired{Stage, Role} but that is a different entry point and is not on this path.
  • The pre-plan addition is needed, not redundant. issue_stage_labels.go:501-508 skips the item entirely when Plan yields no add/remove; without want.Clear an issue already at 020 wearing the label would never reach the engine write. The 14587 case in issue_stage_labels_triage_clear_test.go:46-48 covers exactly that.
  • Desired is no longer comparable (slice field, stagelabels.go:780). I grepped pkg/ and cmd/ for ==/!= on Desired and map keys of that type: the only use was deriver_test.go:34, which this PR switches to reflect.DeepEqual. go build of stagelabels, stageengine, github, dashboard passes on this head.
  • SettlesTriage boundaries (stagelabels.go:421-423: s != None && !s.Before(Claimed) && s != IssueNeedsDecision) line up with the transition table's fall-back-to-015 stages the comment names, and TestSettlesTriage pins all nine.
  • Dashboard: stage_tracker.go:1180-1185 moves the chip to StaleLabels only when stage != TriageNeeded, so 015 keeps nothing stale (asserted at stage_tracker_triage_modifier_test.go:69-71). stageTrackerTriageNeeded in index.html is unchanged and reads modifiers, so "Accept triage" disappears on claimed rows purely because the payload no longer carries the modifier — the node test at stage_tracker_stale_triage.test.js:37 pins it.

PR body and diff match; the only thing holding this is the rebase against v5 (overlaps #14573 on dashboard-sections.md / index.html).

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 8e9c592 into v5 Oct 27, 2026
80 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/triage-on-claimed branch October 27, 2026 18:29
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#14648b9f68ea` sha256:7cf413bec2379a29e04d8966fcff84bc6f198e436473a43a4fd273772de636ea — download from the dashboard or `hivectl review evidence #14648`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at b9f68ea.

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/human A person pushed this PR themselves conflicts-with-open-pr Open PR has a merge conflict with another open PR dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

needs-triage survives a claim: claimed (and closed) self-reports still read "Triage needed" on the activity monitor

1 participant