Skip to content

✨ Activity Monitor: presence indicator (clanker online / offline / none) on the waiting-on pill - #15070

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
feat/presence-indicator
Oct 28, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
feat/presence-indicator

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15051

What

The "waiting on @login" pill in the Activity Monitor / stage tracker now carries a presence indicator so the operator can anticipate hive's next move — wait vs adopt:

  • 🟢 green dot — contributor's clanker is online/connected → hive waits for them
  • 🟥 red square — clanker offline/disconnected → adoption is the likely next move; tooltip shows the adopt-at time and countdown
  • ◯ grey hollow ring — unknown / no registered clanker (humans without a clanker: pill reads human · no clanker)

Shape differs per state (not colour-only); indicator has role="img" + aria-label; online "breathe" animation is subtle and disabled under prefers-reduced-motion.

Backend

  • New presence object on every PR row (and mirrored sub-row) that is waiting on a named person (071 needs-author, 072 returned-to-contributor, 073 possibly-existing):
    presence{login, state: online|offline|unknown, kind: clanker|human, since, last_seen, next: wait|adopt, adopt_at}
  • Derived from the contributor fleet presence (ContributeWSHub.Presence, registered clankers + last heartbeat) with the same precedence and clocks as the adoption code (grace_online, after_offline, after_unregistered, head-unchanged, held/blocked), so the dot never contradicts the adoption text.
  • src/pkg/dashboard/stage_tracker_presence.go (+ tests).

SPA

  • Indicator rendered inside the adoption pill before the @login; muted waiting on @login pill with indicator for non-adoption waiting rows.
  • Plain-words tooltips, e.g.
    • @Danathar's clanker: online, last seen 2 min ago — hive is waiting for them
    • @hanthor's clanker: offline 26h — hive will adopt at 15:10 (in 38m)
    • @someone: no clanker registered — waiting for a human reply
  • Same indicator in the needs-human popover (where the waiting person is named) and in per-PR sub-rows.
  • Live-updates with the existing SSE/refresh path like other pills. No new inline styles (style ratchet respected), tokens from tracker-cues.

Tests

  • Go: online→wait, offline→adopt (+adopt_at), unregistered clanker, held adoption, human author, only-where-waited-on; Go-driven node fixture test via stdin.
  • Node: stage_tracker_presence.test.js — rendering, tooltip text, aria labels, popover line, style ratchet.

Docs

  • src/docs/dashboard-sections.md (Activity Monitor pills)
  • src/docs/labels-and-control-signals.md (adoption section)
  • changelog.d/added-15051-presence-indicator.md

@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 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
#15104 🐛 Activity Monitor: Rebase, then merge as maintainer; fixer owns parked conflicting PRs; dismiss self-inflicted changes_requested same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15156 🐛 Activity Monitor: an owner's Approve admits the untrusted-author PR head — no adoption, merge as-is; DCO warned before acting same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15154 ✨ Adoption: close the original first when superseding, reopen if the hive's copy fails same files src/docs/dashboard-sections.md
src/docs/labels-and-control-signals.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15118 🐛 fix: open the needs-human popover on issue rows with a parked PR same files src/pkg/dashboard/static/index.html
#15134 🐛 Delegated decision on a capability gap: model the blocker, stop the un-park/re-park loop, name the missing App permission same files src/docs/dashboard-sections.md
src/docs/labels-and-control-signals.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15157 ✨ Conflict-aware merge train in the automerge lanes same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#15085 ✨ Activity Monitor: Adopt now and Reroute to another clanker for PRs waiting on a contributor's clanker same files src/docs/dashboard-sections.md
src/docs/labels-and-control-signals.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html
#14807 ✨ dashboard: stream Job pod logs in the terminal pane for sandbox.runtime: job agents same files src/pkg/dashboard/static/index.html
#15122 🐛 Write-back containment: per-kind gate for every unsolicited GitHub write, with backfill guard same files src/docs/labels-and-control-signals.md
src/pkg/dashboard/static/index.html
#15150 🐛 Activity Monitor: persist the merged count in a server ledger, pin the Merged chip, banner and bee flight on merge same files src/docs/dashboard-sections.md
src/pkg/dashboard/stage_tracker.go
src/pkg/dashboard/static/index.html

@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.

Decision needed: @clubanderson should decide whether this PR or #15054 lands for #15051 — both implement the same waiting-on presence indicator and conflict on the same files.

Overlaps #15054 (same issue #15051, same files, same payload shape). Full side-by-side is on #15054; the short version: #15054 exports automerge.AdoptionDeadline and calls it so the pill and the engine share one clock, while this PR re-derives the clock in the dashboard. Both cannot merge; this is your call as owner, not mine.

One concrete divergence in this PR, against the body's "same precedence and clocks as the adoption code":

  • src/pkg/dashboard/stage_tracker_presence.go:110 drops the lookup's ok. When the hub presence source returns ok=false (or presence is nil), the row falls into the default: branch at :176-177 and projects adopt_at = nudge + after_unregistered (15m). The engine's adoptionDue (src/pkg/github/automerge/automerge_contributor_adopt.go:160) handles !hasPresence separately via adoptionGrace(), which is grace_online (2h) when the nudge went out while the author was online. So with presence unavailable after an online nudge the pill promises adoption ~1h45m before the engine would act. Severity: low (unavailable-hub case only). Carrying ok through — or calling a shared deadline function as #15054 does — closes it.

I have not closed anything.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Superseded by #15054 (earlier fix for #15051). Leaving open because a person authored this PR — close it if #15054 covers your change, or comment why both should land.

@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.

One verified gap in the adopt-at projection, plus this conflicts with #15054 (same issue #15051).

Finding — hold / do-not-merge labels are not honoured by the tracker clock (src/pkg/dashboard/stage_tracker_presence.go:156-160, low/medium)

The body says the projection uses "the same precedence … as the adoption code (…, held/blocked), so the dot never contradicts the adoption text". The only hold the code checks is rec.AdoptionBlocked(head). That method (src/pkg/stagelabels/store.go:1117-1122) returns AdoptBlockedBy for a block the engine recorded — and the engine records one only for the maintainer_policy case (automerge_contributor_adopt.go:599, NoteAdoptionBlocked), and only once adoption is already due. The label hold is a separate check at automerge_contributor_adopt.go:591-594: adoptionBlocked(obs.Labels) logs and returns; nothing is written to the record. So for a 072 clanker PR carrying hold, the engine will never adopt, but stageTrackerPresenceFor still falls through to the switch out.State at :172-186 and emits next: "adopt" with an adopt_at — the tooltip reads "hive will adopt at …" on a PR the hive will not touch. The fix is a label check mirroring adoptionBlocked (hold, do-not-merge, do-not-merge/hold; automerge_contributor_adopt.go:213-221) before computing at. (#15054 does this at its stage_tracker_person_presence.go:98-106.)

Conflict with #15054. #15054 (@thatguywob, green CI, mergeable) also closes #15051: it adds a Presence *StageTrackerPersonPresence to the same StageTrackerItem / StageTrackerLinkedPR structs (stage_tracker.go:401, :492) and edits the same waiting-on pill in static/index.html, with a different shape (available flag, no 017 stage) and a different mechanism — it exports automerge.AdoptionDeadline out of adoptionDue so the tracker reuses the engine's clock instead of re-deriving it (stage_tracker_presence.go:106-186 here). The two cannot both merge. I raised the "which one lands" question to you on #15054 rather than here, since you authored both the issue and this PR; if this one is the survivor, the label-hold gap above is the one thing I'd fix before it lands, and the re-derived clock means future changes to adoptionDue will need a matching edit here (the maintainer_policy pre-due case, for example, is also invisible to this projection).

Not a defect, noted for completeness: stageTrackerWaitingOn (stage_tracker_presence.go:92-101) also emits presence at 017 Possibly-existing, which #15051 scoped to 071/072 and sub-rows; harmless, but it is scope beyond the issue.

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

@clubanderson
clubanderson force-pushed the feat/presence-indicator branch from d520ad7 to 293b20f Compare October 28, 2026 19:49
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added 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 and removed stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act labels Oct 28, 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 added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 28, 2026
@hivecommons-hive hivecommons-hive Bot added stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 28, 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:

  • Sign-off survives the squash

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 hivecommons-hive Bot removed the stage/071-needs-author Human-authored PR: CI red, changes requested or conflicting; diagnosis posted, the author must act label Oct 28, 2026
@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 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.

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.

@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.

Read src/pkg/dashboard/stage_tracker_presence.go side by side with src/pkg/github/automerge/automerge_contributor_adopt.go (adoptionDue, line 152) at v5. The adopt-at projection matches the engine's rules branch for branch: online → nudge + GraceOnline (default 2h, adoptionDue line 169); offline → later of nudge / LastSeen + AdoptAfterOffline (default 15m, lines 175-181); unregistered → nudge + AdoptAfterUnregistered (default 15m). The same guards precede it — head must equal NudgeHead, NudgeCount > 0, not Adopted(head)/AdoptedInPlace(), and additionally AdoptionBlocked(head) so a held row shows no clock. stageTrackerWaitingOn limits presence to PR rows at 071/072/017 with a non-empty author, and the sub-row mirror copies the parent pointer. Looks correct to me.

One open question, not verified as reachable: when the server's presence lookup is nil (presence == nil in stageTrackerPresenceFor), the row falls into the unregistered branch and reports next: adopt at nudge + 15m. The engine with no presence source takes a different path — adoptionDue line 160-162 returns adoptionGrace(rec, policy), which is GraceOnline (2h) when rec.NudgeOnline is set. So a hive with no ContributorPresenceSource wired and an online-nudged PR would show "adopt in 15m" while the engine waits 2h. If s.stageTrackerPresence() can be nil in a running hive, mirroring adoptionGrace in the no-lookup case closes the gap; if it cannot, ignore this. The existing stageTrackerAdoption text shares the lookup, so the two pill texts stay consistent with each other either way.

Also: the PR is mergeable_state=dirty against v5 and needs a rebase before the lane can take it.

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

@hanthor

hanthor commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Following up on #15051: the implementation choice is already resolved in favor of this PR; #15054 was closed as superseded. Please rebase this branch and resolve the outstanding adoption-prediction checks before human approval: when presence lookup is unavailable, the displayed deadline must agree with the adoption engine (do not promise 15-minute adoption if the engine applies the online-nudge grace); held PRs must not promise adoption. Keep the fix here rather than opening another competing implementation. Existing CI/review and head-scoped gates remain required.

…ne) on the waiting-on pill

Every PR row that waits on a named person (071, 072, 017) now carries
presence{login, state, kind, since, last_seen, next, adopt_at}, read from
the contributor hub's live presence — the same lookup adoption consults —
and projected through adoption's own clock, so the indicator never
contradicts the adoption text on the row.

The SPA draws it inside the pill before the @login: a filled dot
(--cue-decision, soft breathe, stilled under prefers-reduced-motion) when
the clanker is online, a filled square (--status-error) when it is
offline with the adopt-at time and countdown in the tooltip, a hollow
ring when no clanker is registered (a human's PR). Shape carries the
state, not colour alone; the indicator has its own aria-label. The same
line shows in the Needs-human popover and per-PR sub-rows.

Fixes #15051

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the feat/presence-indicator branch from a40cbb0 to ace6fd4 Compare October 28, 2026 22:59
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 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 28, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 6deede2 into v5 Oct 28, 2026
81 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/presence-indicator branch October 28, 2026 23:12
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#15070ace6fd4` sha256:c0f31d107d18a8fc69cb0a81ce4194b7ac6914ee15f6f0eafad3c73056fb79dc — download from the dashboard or `hivectl review evidence #15070`.

@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 ace6fd4.

@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 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 28, 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.

Read the new projection against the adoption engine it claims to mirror; this looks correct to me.

  • src/pkg/dashboard/stage_tracker_presence.go:142-181 reproduces adoptionDue (src/pkg/github/automerge/automerge_contributor_adopt.go:152-188) branch for branch: online → GraceOnline from the nudge with next: wait; offline → AdoptAfterOffline from max(nudge, last heartbeat); unregistered → AdoptAfterUnregistered. Defaults (pkg/config/config.go:2885-2902) match the engine's inline fallbacks (2h / 15m / 15m).
  • The one place I expected drift — no contribute hub — does not drift: cmd/hive/contributor_nudge_sink.go:33-38 returns a zero ContributorPresence with hasPresence=true, so the engine falls into the unregistered branch exactly as the projection does with a nil presenceLookup.
  • The clock is gated the same way the engine gates it (072 only, nudged, head unchanged, not adopted, AdoptionBlocked empty), so ask/never holds show "waiting" rather than an adopt-at the engine would never act on.
  • SPA: stageTrackerDecisionTriggerHtml (static/index.html:17507) already takes pre-escaped innerHtml, so passing the dot markup instead of esc(text) is safe; esc is applied to the text halves around the dot. No native dialogs, tokens only.

Nit, no action needed: the PR body says 073 possibly-existing; the code and the docs diff correctly say stage/017-possibly-existing.

go build ./pkg/dashboard/ ./pkg/github/automerge/ passes at ace6fd4; CI was still running when I read it.

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

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 dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activity Monitor: presence indicator (clanker online / offline / none) on the waiting-on pill so the operator can anticipate wait vs adopt

2 participants