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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity Monitor: a PR or issue by a registered contributor-hub clanker owner now reads as a clanker (author_kind_source `registry`) instead of an inferred person, so the row icon, its tooltip and the stage pill's holder ("@login's clanker") agree with the stage engine that adopts such PRs.
2 changes: 1 addition & 1 deletion src/docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ The **Hive activity monitor** section (sidebar, Dashboard group; expanded by def

**Sounds (opt-in).** The speaker chip at the right end of the toolbar (๐Ÿ”‡ off / ๐Ÿ”Š on; default off, remembered per browser under the `localStorage` key `hive.tracker.sound`) enables two short sounds, both synthesised in the browser with the Web Audio API (no audio file, no network request). The **merge zap** โ€” just under half a second of bug-zapper arc: a ~4 ms high-voltage "snap", then a sputtering electric sizzle (bright noise and a 240 Hz square chopped by a 120 Hz mains pulse train, dropping out and re-striking at random) that holds ~80 ms and dies away, high-passed at 700 Hz โ€” plays when a pull request the tab was already showing merges while the page is open. The trigger compares tracker payloads: a PR counts as merged when its stage reaches the โœ“ cap or when its key appears in the payload's `recently_merged` list (the hive's `pr_merged` audit entries of the last 30 minutes โ€” sweep, queue, relay and human merges the PR poller observed alike โ€” which is how a PR that simply dropped out of the open list is told apart from one closed unmerged). Entries that name the repo by its configured short name are qualified to the `owner/name` the rows carry, and a PR that drops off the list a poll before its audit entry lands is still remembered as open until `recently_merged` settles it, so the two never have to arrive in the same payload. It never fires on the first load, for rows that were already merged, for issues, or for a PR it has already zapped; several merges in one refresh play at most two zaps. The **new-item buzz** โ€” a quieter 0.18 s sawtooth near 120 Hz with a ~30 Hz tremolo through a lowpass โ€” plays when an issue or pull request appears on the list that the previous payload did not have; it never fires on the first populated payload, buzzes once per item, and plays at most two buzzes per refresh. Nothing plays while the tab is hidden. Turning the chip on plays one zap then one buzz so you can hear both. The audio context is created on a user gesture and resumed if the browser suspended it; if the autoplay policy still holds it suspended when a sound is due, that sound is skipped and the next click or key press re-arms it. Detection runs over the union of every configured repo's rows, keyed `owner/name/kind#number`, so the sounds fire for each repo the hive governs. Either sound can be replaced from the card's โš™ settings modal with a user-supplied file (WAV or anything `decodeAudioData` accepts, capped at 4 MB) stored in the browser's IndexedDB (`hive-tracker-sounds`); a stored file that fails to decode falls back to the built-in voice. The modal also carries the **Play sounds** master toggle and a 0โ€“100 **Volume** slider (`localStorage` key `hive.tracker.sound.volume`) that scales the master gain of both built-in and uploaded sounds. Closed issues are not an event the tracker payload carries, so nothing plays for them.

The endpoint returns `stages` (the stage table with `short`, `branch_from`, configured dwell and `falls_to` โ€” the lower same-kind stages a move to which is a regression per the stage engine, so the event line says "fell back to" only for those; 015 โ†’ 010 triage accepted, 085 โ†’ 080 decision made and 072 โ†’ 070 author resuming read "moved to"), `items` (one per open issue/PR represented by the status snapshot, including actionable and held items plus display-only non-actionable issues, drafts, and exempt PRs: `labels`, `created_at`, `updated_at`, `bucket`, `bucket_reason`, stage, `stage_since`, humanised `reason`/`caption`, `actor`, `modifiers`, `author_kind` + `author_kind_source`, `lane`, `tier`, `linked_pr`, `linked_prs` (number, title, url, author, author kind, stage, `stage_since`, `caption` and `modifiers` of each open covering PR โ€” enough to draw the nested sub-row without a second lookup), `nested_under` (on a PR: the issue it is listed under), nudge info and the last eight `history` hops from the stage store) and `author_kind_labels`. It answers `{"status":"initializing"}` until the first scan.
The endpoint returns `stages` (the stage table with `short`, `branch_from`, configured dwell and `falls_to` โ€” the lower same-kind stages a move to which is a regression per the stage engine, so the event line says "fell back to" only for those; 015 โ†’ 010 triage accepted, 085 โ†’ 080 decision made and 072 โ†’ 070 author resuming read "moved to"), `items` (one per open issue/PR represented by the status snapshot, including actionable and held items plus display-only non-actionable issues, drafts, and exempt PRs: `labels`, `created_at`, `updated_at`, `bucket`, `bucket_reason`, stage, `stage_since`, humanised `reason`/`caption`, `actor`, `modifiers`, `author_kind` + `author_kind_source` (`label`, `inferred`, or `registry` โ€” the author has a contributor-hub profile on this hive, so their clanker pushed it; the row icon, tooltip and claimant all read this one value), `lane`, `tier`, `linked_pr`, `linked_prs` (number, title, url, author, author kind, stage, `stage_since`, `caption` and `modifiers` of each open covering PR โ€” enough to draw the nested sub-row without a second lookup), `nested_under` (on a PR: the issue it is listed under), nudge info and the last eight `history` hops from the stage store) and `author_kind_labels`. It answers `{"status":"initializing"}` until the first scan.

## PR review and link signals

Expand Down
25 changes: 23 additions & 2 deletions src/pkg/dashboard/stage_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@ type StageTrackerItem struct {
BucketReason string `json:"bucket_reason,omitempty"`
// AuthorKind is human / clanker / hive ("" = unknown) and
// AuthorKindSource says whether it came from an author/<kind> label
// ("label") or was inferred from the PR's hive markers ("inferred").
// ("label"), was inferred from the PR's hive markers ("inferred") or
// from the author's contributor-hub registration ("registry").
AuthorKind string `json:"author_kind,omitempty"`
AuthorKindSource string `json:"author_kind_source,omitempty"`
// Tier is the author/<tier> admission label without its prefix.
Expand Down Expand Up @@ -886,9 +887,29 @@ const (
authorKindLabelPfx = "author/"
authorKindSrcLabel = "label"
authorKindSrcInfer = "inferred"
botLoginSuffix = "[bot]"
// authorKindSrcRegistry: the author has a contributor-hub profile on
// this hive, so its connected clanker pushed the item (authorkind rule
// "registry", the same one the stage engine applies).
authorKindSrcRegistry = "registry"
botLoginSuffix = "[bot]"
)

// stageTrackerRegistryAuthorKind overlays the contributor-hub registry on
// an inferred author kind, mirroring pkg/authorkind rule 6 (RelayKnown โ†’
// Clanker) so the tracker row and its claimant agree with the stage
// engine's own classification (hivecommons/hive#16015). An author/<kind>
// label and a hive (App-authored) verdict are stronger and stand; a
// registered contributor's login otherwise reads clanker, source registry.
func stageTrackerRegistryAuthorKind(kind, source, author string, isClankerOwner func(string) bool) (string, string) {
if source == authorKindSrcLabel || kind == authorKindHive || isClankerOwner == nil {
return kind, source
}
if author = strings.TrimSpace(author); author == "" || !isClankerOwner(author) {
return kind, source
}
return authorKindClanker, authorKindSrcRegistry
}

// stageTrackerBranchFrom says which main segment a detour stage hangs off.
// The PR strip collapses 050 and 060 into one "CI / Review" chevron (060 is
// pre-admission: approved, CI still pending or red), so review-side detours
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/dashboard/stage_tracker_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto
} else if strings.HasSuffix(strings.ToLower(issue.Author), botLoginSuffix) {
it.AuthorKind, it.AuthorKindSource = authorKindHive, authorKindSrcInfer
}
it.AuthorKind, it.AuthorKindSource = stageTrackerRegistryAuthorKind(it.AuthorKind, it.AuthorKindSource, it.Author, isClankerOwner)
if l, ok := config.FirstOriginLabel(issue.Labels); ok {
it.Origin = config.OriginSourceOf(l)
} else {
Expand Down Expand Up @@ -374,6 +375,7 @@ func (s *Server) buildStageTracker(status *StatusPayload, store *stagelabels.Sto
it.BaseRef = pr.BaseRef
it.ciRed = strings.EqualFold(pr.CIStatus, "failure") || len(pr.FailingChecks) > 0
it.AuthorKind, it.AuthorKindSource = stageTrackerAuthorKind(pr.Labels, pr.Author, pr.AppAuthored, pr.HiveAttributed)
it.AuthorKind, it.AuthorKindSource = stageTrackerRegistryAuthorKind(it.AuthorKind, it.AuthorKindSource, it.Author, isClankerOwner)
if it.AuthorKindSource == authorKindSrcLabel {
resp.AuthorKindLabels = true
}
Expand Down
60 changes: 60 additions & 0 deletions src/pkg/dashboard/stage_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1174,3 +1174,63 @@ func TestStageTrackerEnrichSoftLinks(t *testing.T) {
t.Fatalf("issues GETs in one rebuild = %d, want the cap %d", n, stageTrackerLinkLookups)
}
}

// hivecommons/hive#16015: the row's author kind and its claimant come from
// one source of truth. A login with a contributor-hub profile is a clanker
// owner (pkg/authorkind rule "registry", the one the stage engine applies
// when it adopts), so the tracker must not read it as a person just because
// the PR carries no author/<kind> label or hive marker.
func TestStageTrackerRegistryAuthorKind(t *testing.T) {
owner := func(login string) bool { return strings.EqualFold(login, "karibhou") }
cases := []struct {
kind, src, author string
owner func(string) bool
wantKind, wantSrc string
}{
{authorKindHuman, authorKindSrcInfer, "Karibhou", owner, authorKindClanker, authorKindSrcRegistry},
{authorKindHuman, authorKindSrcInfer, "pat", owner, authorKindHuman, authorKindSrcInfer},
{authorKindHuman, authorKindSrcLabel, "karibhou", owner, authorKindHuman, authorKindSrcLabel},
{authorKindHive, authorKindSrcInfer, "karibhou", owner, authorKindHive, authorKindSrcInfer},
{"", "", "karibhou", owner, authorKindClanker, authorKindSrcRegistry},
{authorKindHuman, authorKindSrcInfer, "karibhou", nil, authorKindHuman, authorKindSrcInfer},
{authorKindHuman, authorKindSrcInfer, "", owner, authorKindHuman, authorKindSrcInfer},
}
for _, c := range cases {
k, src := stageTrackerRegistryAuthorKind(c.kind, c.src, c.author, c.owner)
if k != c.wantKind || src != c.wantSrc {
t.Errorf("%q/%q/%q: got %q/%q want %q/%q", c.kind, c.src, c.author, k, src, c.wantKind, c.wantSrc)
}
}
}

func TestStageTrackerRegisteredContributorIsClanker(t *testing.T) {
setupContributeEnv(t)
if err := saveContributorProfile(&ContributorProfile{GitHubUsername: "Karibhou", ContributorID: "c-karibhou", TrustTier: "trusted"}); err != nil {
t.Fatal(err)
}
now := time.Date(2026, 10, 21, 18, 49, 0, 0, time.UTC)
s, store := stageTrackerFixture(t, now)
s.statusMu.RLock()
status := s.status
s.statusMu.RUnlock()
resp := s.buildStageTracker(status, store, now)

pr101 := trackerItem(t, resp, "pr", 101)
if pr101.AuthorKind != authorKindClanker || pr101.AuthorKindSource != authorKindSrcRegistry {
t.Fatalf("pr101 by registered contributor: kind=%q src=%q, want clanker/registry", pr101.AuthorKind, pr101.AuthorKindSource)
}
if pr101.Claimant == nil || pr101.Claimant.Kind != claimantKindClanker || pr101.Claimant.Login != "karibhou" {
t.Fatalf("pr101 claimant = %+v, want the contributor's clanker", pr101.Claimant)
}
if issue7 := trackerItem(t, resp, "issue", 7); issue7.AuthorKind != authorKindClanker || issue7.AuthorKindSource != authorKindSrcRegistry {
t.Fatalf("issue7 by registered contributor: kind=%q src=%q", issue7.AuthorKind, issue7.AuthorKindSource)
}
// Labels and the App's own login outrank the registry.
if pr102 := trackerItem(t, resp, "pr", 102); pr102.AuthorKind != authorKindHive || pr102.AuthorKindSource != authorKindSrcLabel {
t.Fatalf("pr102: kind=%q src=%q", pr102.AuthorKind, pr102.AuthorKindSource)
}
// A hive-attributed relay PR keeps its marker-inferred source.
if pr103 := trackerItem(t, resp, "pr", 103); pr103.AuthorKind != authorKindClanker || pr103.AuthorKindSource != authorKindSrcInfer {
t.Fatalf("pr103: kind=%q src=%q", pr103.AuthorKind, pr103.AuthorKindSource)
}
}
5 changes: 5 additions & 0 deletions src/pkg/dashboard/stage_tracker_ui_rows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ assert.strictEqual(stageTrackerTrailText({ history: [] }), '');
assert.strictEqual(stageTrackerTrailText({}), '');
assert.strictEqual(stageTrackerTrailText({ history: [{ number: 0 }, { number: 10 }] }), 'Open โ†’ Actionable', '000 reads as Open');
assert.ok(!stageTrackerTooltip({ kind: 'pr', number: 1, stage: 50, history: [{ number: 999 }, { number: 998 }] }, now).includes('Trail:'), 'no Trail clause when nothing can be named');
// hivecommons/hive#16015: a registered contributor's PR reads as their clanker,
// and the tooltip says the registry decided it; an inferred kind still says so.
assert.ok(stageTrackerTooltip({ kind: 'pr', number: 15998, stage: 74, author: 'Karibhou', author_kind: 'clanker', author_kind_source: 'registry' }, now).includes('Author: @Karibhou (agent, registered contributor)'), 'registry source named in the tooltip');
assert.ok(stageTrackerTooltip({ kind: 'pr', number: 1, stage: 50, author: 'pat', author_kind: 'human', author_kind_source: 'inferred' }, now).includes('Author: @pat (person, inferred)'), 'inferred source still named');
assert.ok(stageTrackerTooltip({ kind: 'pr', number: 1, stage: 50, author: 'pat', author_kind: 'human', author_kind_source: 'label' }, now).includes('Author: @pat (person)'), 'label source says nothing');
const savedStages = _stageTracker;
_stageTracker = null;
assert.strictEqual(stageTrackerTrailText(live14787), 'review-pending โ†’ needs-author โ†’ review-pending โ†’ needs-decision', 'the slug stands in before the stage table loads');
Expand Down
5 changes: 4 additions & 1 deletion src/pkg/dashboard/static-src/js/tracker-row-strip.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,17 @@
const ak = item.author_kind || '';
// Plain words for author_kind in hover text (hivecommons/hive#15394).
const akPlain = { human: 'person', clanker: 'agent', hive: 'hive', bot: 'bot' };
// How the kind was read: author/<kind> label (said nothing), hive
// markers, or the author's contributor-hub profile (hivecommons/hive#16015).
const akSource = { inferred: ', inferred', registry: ', registered contributor' }[item.author_kind_source] || '';
const mods = Array.isArray(item.modifiers) ? item.modifiers : [];
const sinceMs = Date.parse(item.stage_since || '');
const trail = stageTrackerTrailText(item);
const openHeld = (Number(item.stage) || 0) === 0 && mods.indexOf('hold') >= 0;
const lines = openHeld
? [stageTrackerHeadline(item) + (item.caption || item.reason ? ' ยท ' + (item.caption || item.reason) : '') + (item.repo ? ' ยท ' + item.repo : '')]
: [stageTrackerHeadline(item), item.caption || item.reason || '', item.repo || ''];
if (item.author || ak) lines.push('Author: ' + (item.author ? '@' + item.author : '') + (ak ? ' (' + (akPlain[ak] || ak) + (item.author_kind_source === 'inferred' ? ', inferred' : '') + ')' : '') + (item.tier ? ' ยท ' + item.tier : ''));
if (item.author || ak) lines.push('Author: ' + (item.author ? '@' + item.author : '') + (ak ? ' (' + (akPlain[ak] || ak) + akSource + ')' : '') + (item.tier ? ' ยท ' + item.tier : ''));
if (item.origin) lines.push('Origin: origin/' + item.origin);
if (item.kind === 'issue' && Array.isArray(item.linked_prs) && item.linked_prs.length) lines.push('Covering PR: ' + item.linked_prs.map(lp => Number(lp.number) || 0).sort((x, y) => x - y).map(n => '#' + n).join(', '));
else if (item.kind === 'issue' && item.linked_pr) lines.push('Covering PR: #' + item.linked_pr + (typeof stageTrackerLineageClause === 'function' ? stageTrackerLineageClause(item) : ''));
Expand Down
5 changes: 4 additions & 1 deletion src/pkg/dashboard/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17241,14 +17241,17 @@ <h3 class="faq-group-title">Where to get help</h3>
const ak = item.author_kind || '';
// Plain words for author_kind in hover text (hivecommons/hive#15394).
const akPlain = { human: 'person', clanker: 'agent', hive: 'hive', bot: 'bot' };
// How the kind was read: author/<kind> label (said nothing), hive
// markers, or the author's contributor-hub profile (hivecommons/hive#16015).
const akSource = { inferred: ', inferred', registry: ', registered contributor' }[item.author_kind_source] || '';
const mods = Array.isArray(item.modifiers) ? item.modifiers : [];
const sinceMs = Date.parse(item.stage_since || '');
const trail = stageTrackerTrailText(item);
const openHeld = (Number(item.stage) || 0) === 0 && mods.indexOf('hold') >= 0;
const lines = openHeld
? [stageTrackerHeadline(item) + (item.caption || item.reason ? ' ยท ' + (item.caption || item.reason) : '') + (item.repo ? ' ยท ' + item.repo : '')]
: [stageTrackerHeadline(item), item.caption || item.reason || '', item.repo || ''];
if (item.author || ak) lines.push('Author: ' + (item.author ? '@' + item.author : '') + (ak ? ' (' + (akPlain[ak] || ak) + (item.author_kind_source === 'inferred' ? ', inferred' : '') + ')' : '') + (item.tier ? ' ยท ' + item.tier : ''));
if (item.author || ak) lines.push('Author: ' + (item.author ? '@' + item.author : '') + (ak ? ' (' + (akPlain[ak] || ak) + akSource + ')' : '') + (item.tier ? ' ยท ' + item.tier : ''));
if (item.origin) lines.push('Origin: origin/' + item.origin);
if (item.kind === 'issue' && Array.isArray(item.linked_prs) && item.linked_prs.length) lines.push('Covering PR: ' + item.linked_prs.map(lp => Number(lp.number) || 0).sort((x, y) => x - y).map(n => '#' + n).join(', '));
else if (item.kind === 'issue' && item.linked_pr) lines.push('Covering PR: #' + item.linked_pr + (typeof stageTrackerLineageClause === 'function' ? stageTrackerLineageClause(item) : ''));
Expand Down
Loading