Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/added-tracker-claimant-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The activity monitor says who holds a claimed item, not just what kind of actor. `GET /api/stage-tracker` rows (and nested `linked_prs[]`) carry `claimant: {kind: hive-agent|clanker|person, login, agent, hive, since, source}` on claimed / in-progress issues and PRs under review or rework, derived from the worker-claim ledger, the `hive:claim` marker (with its hive fingerprint), an assignee or the agent the status payload says is on it. The lit chevron appends one token after its word — **Claimed · quality**, **Claimed · quality@alchemy** (another hive), **Claimed · @bob's clanker**, **Claimed · @alice** — and the chevron hover adds *Held by: <identity> since <ago> (<source>)*. Nothing is added when nobody is named.
2 changes: 1 addition & 1 deletion src/docs/api-reference/dashboard-misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f
| `GET` | `/api/budget-ignore` | Dashboard auth/session | Budget Ignore Get | `pkg/dashboard/api.go:172` |
| `POST` | `/api/budget-ignore` | Owner only | Budget Ignore Set | `pkg/dashboard/api.go:173` |
| `GET` | `/api/summaries` | Dashboard auth/session | Summaries | `pkg/dashboard/api.go:185` |
| `GET` | `/api/stage-tracker` | Dashboard auth/session | Stage Tracker: every open issue and pull request of the watched repos for the Hive activity monitor — actionable, held, claimed, in-progress, covered-by-PR, filtered (`needs-*`), draft and exempt-labelled items alike, each with `stage`, `stage_since`, `labels`, `created_at`, `author_kind`, `modifiers`, (PRs) `sentinel_alert` / `sentinel_findings` / `sentinel_reason` when the sentinel flagged the PR, `decision_needed` on a row parked on a person (085 / 045 / 015, the needs-human pill; mirrored onto the issue's `linked_prs[]` entry): `{question, asked_by, since, blocker, blocker_reason, options: [{action, label, enabled, reason_if_disabled}]}` — the reviewer's own decision question when the verdict record has one, the blocker in plain words, and the applicable actions under the row context menu's action ids (`decide:delegate` first), (PRs) `lineage` on the hive's copy of an adopted PR — `{kind: adopted|superseded|rebased-by-hive, from_number, from_url, from_author, from_author_kind, to_number, to_url, at, reason}`, derived from the stage store's adoption record or the `hive/adopt-<n>` head branch, mirrored onto the issue's `linked_prs[]` entry; absent on every other row — and (issues) `linked_prs`; items with no stage yet report stage `0` "Open"; `needs_human_labels` is the "a person must act" label set behind the monitor's Needs human facet (the same list as `/api/status.labelPresets[needs-human]`); `recently_merged` lists the PRs (`repo`, `number`, `merged_at`) whose `pr_merged` audit entry is under 30 minutes old, so a client diffing two payloads can tell a merge from a close. Served from a server-side cache rebuilt at most every `dashboard.stage_tracker.cache_ttl_s` (default `governor.eval_interval_s`) from the spoke's existing snapshot — a request never calls GitHub. Carries `generated_at`, `source` (`cache` or `fresh`), `cache_ttl_s`, an `ETag` and `Cache-Control: private, max-age=<remaining>`; `If-None-Match` yields 304. Each hit is recorded under REST caller `dashboard:stage-tracker` so `/api/gh-rate-limits` shows it charged nothing. | `pkg/dashboard/api.go:186` |
| `GET` | `/api/stage-tracker` | Dashboard auth/session | Stage Tracker: every open issue and pull request of the watched repos for the Hive activity monitor — actionable, held, claimed, in-progress, covered-by-PR, filtered (`needs-*`), draft and exempt-labelled items alike, each with `stage`, `stage_since`, `labels`, `created_at`, `author_kind`, `modifiers`, `claimant: {kind: hive-agent|clanker|person, login, agent, hive, since, source: claim-comment|assignee|kick-history|author}` naming who holds a claimed / in-progress issue or a PR under review or rework (absent when nobody is named; mirrored onto `linked_prs[]`), (PRs) `sentinel_alert` / `sentinel_findings` / `sentinel_reason` when the sentinel flagged the PR, `decision_needed` on a row parked on a person (085 / 045 / 015, the needs-human pill; mirrored onto the issue's `linked_prs[]` entry): `{question, asked_by, since, blocker, blocker_reason, options: [{action, label, enabled, reason_if_disabled}]}` — the reviewer's own decision question when the verdict record has one, the blocker in plain words, and the applicable actions under the row context menu's action ids (`decide:delegate` first), (PRs) `lineage` on the hive's copy of an adopted PR — `{kind: adopted|superseded|rebased-by-hive, from_number, from_url, from_author, from_author_kind, to_number, to_url, at, reason}`, derived from the stage store's adoption record or the `hive/adopt-<n>` head branch, mirrored onto the issue's `linked_prs[]` entry; absent on every other row — and (issues) `linked_prs`; items with no stage yet report stage `0` "Open"; `needs_human_labels` is the "a person must act" label set behind the monitor's Needs human facet (the same list as `/api/status.labelPresets[needs-human]`); `recently_merged` lists the PRs (`repo`, `number`, `merged_at`) whose `pr_merged` audit entry is under 30 minutes old, so a client diffing two payloads can tell a merge from a close. Served from a server-side cache rebuilt at most every `dashboard.stage_tracker.cache_ttl_s` (default `governor.eval_interval_s`) from the spoke's existing snapshot — a request never calls GitHub. Carries `generated_at`, `source` (`cache` or `fresh`), `cache_ttl_s`, an `ETag` and `Cache-Control: private, max-age=<remaining>`; `If-None-Match` yields 304. Each hit is recorded under REST caller `dashboard:stage-tracker` so `/api/gh-rate-limits` shows it charged nothing. | `pkg/dashboard/api.go:186` |
| `POST` | `/api/prs/{owner}/{repo}/{number}/queue-automerge` | Merger/owner role | Queue PRAuto Merge | `pkg/dashboard/api.go:187` |
| `GET` | `/api/inference/models/{backend}` | Dashboard auth/session | Inference Models | `pkg/dashboard/api.go:363` |
| `GET` | `/api/hive-id` | Dashboard auth/session | Hive IDGet | `pkg/dashboard/api.go:425` |
Expand Down
4 changes: 4 additions & 0 deletions src/docs/dashboard-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,10 @@ The small icon after the lit pill's words names whose move the row is, and it co

Issues riding one covering PR take that PR's actor; nested PR sub-rows carry their own.

#### Who holds it (claimant)

The icon says what kind of actor holds the row; the `claimant` says *who*. On a claimed or in-progress issue and on a PR from review through its author's rework and adoption (050–074), the payload carries `claimant: {kind, login, agent, hive, since, source}` and the lit chevron appends one short token after its word: a hive lane name (**Claimed · quality**), the lane and a short hive name when the claim came from another hive (**Claimed · quality@alchemy**, the `hosted-ibm-` prefix dropped), a contributor's connected hive (**Claimed · @bob's clanker**) or a person (**Claimed · @alice**). `kind` is `hive-agent` (`agent` is the lane; `hive` is set only when it is not this hive), `clanker` (`login` is the contributor the hive acts for — a registered contributor with a connected hive) or `person`; `source` says where the identity was read: `claim-comment` (the worker-claim ledger or the `hive:claim` marker, which carries the hive fingerprint), `assignee`, `kick-history` (the agent the status payload says is on it) or `author` (a PR's author or adopting agent). The chevron hover adds one line — *Held by: hive agent quality@hosted-ibm-alchemy since 3h ago (claim comment)*. When nothing names a holder the field is absent and nothing is added. Nested covering-PR sub-rows carry their PR's `claimant`.

#### One row per PR

A pull request that closes several open issues (`Closes #A` and `Closes #B`) is drawn once, under the issue the server names in each linked entry's `drawn_under` (its `nested_under`, the lowest-numbered open issue it closes). The other issues keep their own strip and show a compact **↳ #N · under #M** chip beside the title (tooltip: *PR #N covers this issue too; its row is drawn under #M*) instead of a second identical sub-row, so hivecommons/hive#14921 appears once under #14910 and #14911 points at it.
Expand Down
2 changes: 1 addition & 1 deletion src/docs/scale-envelope.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:4804-4814`, descending `AgeMinutes` within each tier).
(`RankActionableIssues`, `src/pkg/github/client.go:4809-4819`, 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).
Expand Down
27 changes: 26 additions & 1 deletion src/pkg/dashboard/stage_tracker.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package dashboard

import (
Expand Down Expand Up @@ -492,6 +492,10 @@
// ClaimantKind is the author kind of whoever holds the live claim on a
// claimed issue (human / clanker / hive), from the worker-claim ledger.
ClaimantKind string `json:"claimant_kind,omitempty"`
// Claimant names who holds the row — the agent, clanker owner or person
// — for the chevron suffix and the "Held by:" hover line
// (stage_tracker_claimant.go).
Claimant *StageTrackerClaimant `json:"claimant,omitempty"`
// StageActor is who holds the next move on this row — hive, clanker,
// human, a foreign bot, or nobody — with the plain-words why. The SPA
// draws the stage pill's actor icon from StageActor.Kind only
Expand Down Expand Up @@ -608,6 +612,9 @@
DCOUnsigned int `json:"dco_unsigned,omitempty"`
DCOTotal int `json:"dco_total,omitempty"`
Head string `json:"head,omitempty"`
// Claimant mirrors the nested PR's holder so the sub-row's chevron
// names them too.
Claimant *StageTrackerClaimant `json:"claimant,omitempty"`
// DecisionNeeded mirrors the nested PR's own row field so the issue's
// sub-row can open the same "Needs human" popover.
DecisionNeeded *StageTrackerDecision `json:"decision_needed,omitempty"`
Expand Down Expand Up @@ -1982,6 +1989,7 @@
soakWindow := s.stageTrackerSoakWindow()
attempts := s.stageTrackerMergeAttempts()
workers := stageTrackerWorkersFromStatus(status)
isClankerOwner := stageTrackerIsClankerOwner()
adoptionClock := s.stageTrackerAdoptionClock()
rerouteCandidates, adoptionEnabled, takeoverGrace := s.stageTrackerRerouteCandidates(), s.stageAdoptionEnabled(), s.takeoverGrace()
finish := func(it *StageTrackerItem, labels []string, stage stagelabels.Stage, rec stagelabels.Record, hasRec bool, draft bool) {
Expand Down Expand Up @@ -2182,6 +2190,15 @@
if it.Stage == trackerNumberClaimed {
it.ClaimantKind = s.stageTrackerClaimantKind(repoName, issue.Number)
}
if stageTrackerClaimantStage(it.Kind, it.Stage) {
var worker *stageTrackerWorker
if w, ok := stageTrackerWorkerOn(workers, repoName, issue.Number); ok {
worker = &w
}
it.Claimant = stageTrackerIssueClaimant(stageTrackerClaimInputs{Ledger: s.stageTrackerLedgerClaim(repoName, issue.Number),
MarkerKind: issue.ClaimKind, MarkerHolder: issue.ClaimedBy, MarkerHive: issue.ClaimHive, Assignees: issue.Assignees,
Worker: worker, Since: it.StageSince, HiveID: status.HiveID, IsClankerOwner: isClankerOwner})
}
for _, lp := range issue.LinkedPRs {
// The claims index may still say "open" for a PR the hive closed
// since (close-first supersession, hivecommons/hive#15135); the
Expand Down Expand Up @@ -2276,6 +2293,13 @@
}
it.DecisionNeeded = stageTrackerDecisionNeededWith(it, agg, sentinelLabel, now, bctx)
it.StageActor = stageTrackerStageActor(it, workers, now)
if stageTrackerClaimantStage(it.Kind, it.Stage) {
var worker *stageTrackerWorker
if w, ok := stageTrackerWorkerOn(workers, repoName, pr.Number); ok {
worker = &w
}
it.Claimant = stageTrackerPRClaimant(stageTrackerClaimInputs{Worker: worker, Since: it.StageSince, Labels: pr.Labels, Author: it.Author, AuthorKind: it.AuthorKind})
}
add(it)
}
for _, repo := range status.Repos {
Expand All @@ -2295,7 +2319,7 @@
// 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, w.Advisory)
CreatedAt: w.CreatedAt, UpdatedAt: w.UpdatedAt, URL: w.URL, ClaimKind: w.ClaimKind, ClaimedBy: w.ClaimedBy, ClaimHive: w.ClaimHive, 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,
Expand Down Expand Up @@ -3050,6 +3074,7 @@
lp.Title, lp.Author, lp.AuthorKind, lp.Stage = pr.Title, pr.Author, pr.AuthorKind, pr.Stage
lp.StageSince, lp.Caption = pr.StageSince, pr.Caption
lp.SentinelAlert, lp.SentinelReason, lp.Head = pr.SentinelAlert, pr.SentinelReason, pr.Head
lp.Claimant = pr.Claimant
lp.Adoption = pr.Adoption
lp.Presence = pr.Presence
lp.Rework = pr.Rework
Expand Down
Loading
Loading