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/fixed-15422-claim-ledger-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix the tracker holder tooltip to identify local claims as coming from the claim ledger.
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 @@ -39,7 +39,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`, `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; a PR in a conflict-aware merge train carries `merge_train` `{id, state, front, position, size, attempt, max_attempts, overlap_files, ahead, length, head_number, head_state, head_reason, head_since, eta_s, eta_at, eta_basis, late, stalled, stalled_s}` — `head_state` one of `needs-human` / `ci` / `soaking` / `ready` / `merging` / `fixing` / `unknown` with `head_reason` in plain words; `eta_s` / `eta_at` the estimated wait for this member's own merge attempt (own remaining soak + each PR ahead's remaining soak or one sweep + the next sweep tick; absent while the head waits on a person or CI), `eta_at` anchored to the member's first estimate at its position so a countdown survives polls, `eta_basis` its short reading ("2 ahead · head soaking 12m · next sweep in 40s"), `late` once now has overrun the first estimate twice over, `stalled` / `stalled_s` once the head has sat longer than `governor.merge_train_stall_warn_s` ([#15395](https://github.com/hivecommons/hive/issues/15395)); a PR the queue holds because another open PR declares the same `Fixes #N` carries no `merge_train` and a `merge_gate` of `{state: "duplicate-of:<winner>", duplicate_of, duplicate_issue}` plus the `needs-decision` modifier (the queue keeps one PR per issue: green first, then the earlier-opened); a PR GitHub reports conflicting on its own, or one at stage/072, carries no `merge_train` and is not counted in any member's `size` / `length` — the state slugs (`front`, `queued-behind`) are payload values only, the SPA renders ordinal places ("Merge queued · 1st"). 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-ledger|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; a PR in a conflict-aware merge train carries `merge_train` `{id, state, front, position, size, attempt, max_attempts, overlap_files, ahead, length, head_number, head_state, head_reason, head_since, eta_s, eta_at, eta_basis, late, stalled, stalled_s}` — `head_state` one of `needs-human` / `ci` / `soaking` / `ready` / `merging` / `fixing` / `unknown` with `head_reason` in plain words; `eta_s` / `eta_at` the estimated wait for this member's own merge attempt (own remaining soak + each PR ahead's remaining soak or one sweep + the next sweep tick; absent while the head waits on a person or CI), `eta_at` anchored to the member's first estimate at its position so a countdown survives polls, `eta_basis` its short reading ("2 ahead · head soaking 12m · next sweep in 40s"), `late` once now has overrun the first estimate twice over, `stalled` / `stalled_s` once the head has sat longer than `governor.merge_train_stall_warn_s` ([#15395](https://github.com/hivecommons/hive/issues/15395)); a PR the queue holds because another open PR declares the same `Fixes #N` carries no `merge_train` and a `merge_gate` of `{state: "duplicate-of:<winner>", duplicate_of, duplicate_issue}` plus the `needs-decision` modifier (the queue keeps one PR per issue: green first, then the earlier-opened); a PR GitHub reports conflicting on its own, or one at stage/072, carries no `merge_train` and is not counted in any member's `size` / `length` — the state slugs (`front`, `queued-behind`) are payload values only, the SPA renders ordinal places ("Merge queued · 1st"). 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
2 changes: 1 addition & 1 deletion src/docs/dashboard-sections.md
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ Issues riding one covering PR take that PR's actor; nested PR sub-rows carry the

#### 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`.
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-ledger` (the worker-claim ledger), `claim-comment` (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 ledger)*. 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

Expand Down
3 changes: 2 additions & 1 deletion src/pkg/dashboard/stage_tracker_claimant.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const (
claimantKindClanker = "clanker"
claimantKindPerson = "person"

claimantSourceClaimLedger = "claim-ledger"
claimantSourceClaimComment = "claim-comment"
claimantSourceAssignee = "assignee"
claimantSourceKickHistory = "kick-history"
Expand Down Expand Up @@ -69,7 +70,7 @@ type stageTrackerClaimInputs struct {
// when nothing names anyone.
func stageTrackerIssueClaimant(in stageTrackerClaimInputs) *StageTrackerClaimant {
if c := in.Ledger; c != nil && c.Holder != "" {
out := &StageTrackerClaimant{Source: claimantSourceClaimComment, Since: in.Since}
out := &StageTrackerClaimant{Source: claimantSourceClaimLedger, Since: in.Since}
if !c.ClaimedAt.IsZero() {
out.Since = timePtr(c.ClaimedAt)
}
Expand Down
14 changes: 7 additions & 7 deletions src/pkg/dashboard/stage_tracker_claimant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ func TestStageTrackerIssueClaimant(t *testing.T) {
want *StageTrackerClaimant
}{
{"ledger agent from another hive", stageTrackerClaimInputs{Ledger: &claims.Claim{Holder: "quality", Kind: claims.KindAgent, Hive: "hosted-ibm-alchemy", ClaimedAt: claimedAt}, HiveID: "hosted-ibm-main", Since: &since},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "quality", Hive: "hosted-ibm-alchemy", Since: &claimedAt, Source: claimantSourceClaimComment}},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "quality", Hive: "hosted-ibm-alchemy", Since: &claimedAt, Source: claimantSourceClaimLedger}},
{"ledger agent from this hive drops the hive", stageTrackerClaimInputs{Ledger: &claims.Claim{Holder: "quality", Kind: claims.KindAgent, Hive: "hosted-ibm-main", ClaimedAt: claimedAt}, HiveID: "hosted-ibm-main"},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "quality", Since: &claimedAt, Source: claimantSourceClaimComment}},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "quality", Since: &claimedAt, Source: claimantSourceClaimLedger}},
{"ledger contributor is a clanker", stageTrackerClaimInputs{Ledger: &claims.Claim{Holder: "bob", Kind: claims.KindContributor, ClaimedAt: claimedAt}},
&StageTrackerClaimant{Kind: claimantKindClanker, Login: "bob", Since: &claimedAt, Source: claimantSourceClaimComment}},
&StageTrackerClaimant{Kind: claimantKindClanker, Login: "bob", Since: &claimedAt, Source: claimantSourceClaimLedger}},
{"ledger human is a person", stageTrackerClaimInputs{Ledger: &claims.Claim{Holder: "alice", Kind: claims.KindHuman, ClaimedAt: claimedAt}},
&StageTrackerClaimant{Kind: claimantKindPerson, Login: "alice", Since: &claimedAt, Source: claimantSourceClaimComment}},
&StageTrackerClaimant{Kind: claimantKindPerson, Login: "alice", Since: &claimedAt, Source: claimantSourceClaimLedger}},
{"marker with fleet fingerprint", stageTrackerClaimInputs{MarkerKind: "agent", MarkerHolder: "fixer", MarkerHive: "hosted-ibm-alchemy", HiveID: "local", Since: &since},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "fixer", Hive: "hosted-ibm-alchemy", Since: &since, Source: claimantSourceClaimComment}},
{"assignee who owns a clanker", stageTrackerClaimInputs{MarkerHolder: "Bob", Since: &since, IsClankerOwner: clankerOwners},
Expand All @@ -39,7 +39,7 @@ func TestStageTrackerIssueClaimant(t *testing.T) {
{"kick history fallback", stageTrackerClaimInputs{Worker: &stageTrackerWorker{Agent: "fixer", At: kickedAt}, Since: &since},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "fixer", Since: &kickedAt, Source: claimantSourceKickHistory}},
{"ledger beats assignee", stageTrackerClaimInputs{Ledger: &claims.Claim{Holder: "quality", Kind: claims.KindAgent, ClaimedAt: claimedAt}, Assignees: []string{"alice"}},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "quality", Since: &claimedAt, Source: claimantSourceClaimComment}},
&StageTrackerClaimant{Kind: claimantKindHiveAgent, Agent: "quality", Since: &claimedAt, Source: claimantSourceClaimLedger}},
{"nobody", stageTrackerClaimInputs{Since: &since}, nil},
}
for _, tc := range cases {
Expand Down Expand Up @@ -127,9 +127,9 @@ const since = new Date(now - 3 * 3600000).toISOString();
const issue = (n, extra) => Object.assign({ repo: 'hivecommons/hive', number: n, kind: 'issue', title: 'fix it', url: 'https://x/' + n, stage: 20, stage_since: since, caption: 'Claimed', author: 'alice', stage_actor: { kind: 'hive', why: 'holds the live claim' } }, extra || {});

// Hive agent from this hive: lane name only.
let row = stageTrackerRowHtml(issue(1, { claimant: { kind: 'hive-agent', agent: 'quality', since, source: 'claim-comment' } }), stages, ctx);
let row = stageTrackerRowHtml(issue(1, { claimant: { kind: 'hive-agent', agent: 'quality', since, source: 'claim-ledger' } }), stages, ctx);
assert.strictEqual(litWord(row), 'Claimed · quality', litWord(row));
assert.strictEqual(heldLine(row), 'Held by: hive agent quality since 3h ago (claim comment)', litTitle(row));
assert.strictEqual(heldLine(row), 'Held by: hive agent quality since 3h ago (claim ledger)', litTitle(row));
assert.ok(strip(row).includes('class="ham-ico ham-actor-ico"'), 'the actor icon stays');

// Hive agent from another hive: lane@short-hive on the chevron, the full hive in the hover.
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/static-src/js/tracker-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
// since, source} (hivecommons/hive#15422). The chevron gets one short
// token after the stage word; the hover gets one "Held by:" line.
const STAGE_TRACKER_HIVE_PREFIXES = ['hosted-ibm-', 'hosted-'];
const STAGE_TRACKER_CLAIMANT_SOURCE = { 'claim-comment': 'claim comment', assignee: 'assignee', 'kick-history': 'kick history', author: 'PR author' };
const STAGE_TRACKER_CLAIMANT_SOURCE = { 'claim-ledger': 'claim ledger', 'claim-comment': 'claim comment', assignee: 'assignee', 'kick-history': 'kick history', author: 'PR author' };
function stageTrackerShortHive(hive) {
const h = String(hive || '');
const p = STAGE_TRACKER_HIVE_PREFIXES.find(x => h.startsWith(x));
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15756,7 +15756,7 @@ <h3 class="faq-group-title">Where to get help</h3>
// since, source} (hivecommons/hive#15422). The chevron gets one short
// token after the stage word; the hover gets one "Held by:" line.
const STAGE_TRACKER_HIVE_PREFIXES = ['hosted-ibm-', 'hosted-'];
const STAGE_TRACKER_CLAIMANT_SOURCE = { 'claim-comment': 'claim comment', assignee: 'assignee', 'kick-history': 'kick history', author: 'PR author' };
const STAGE_TRACKER_CLAIMANT_SOURCE = { 'claim-ledger': 'claim ledger', 'claim-comment': 'claim comment', assignee: 'assignee', 'kick-history': 'kick history', author: 'PR author' };
function stageTrackerShortHive(hive) {
const h = String(hive || '');
const p = STAGE_TRACKER_HIVE_PREFIXES.find(x => h.startsWith(x));
Expand Down
Loading