Skip to content

[scanner] Dim the Activity Monitor display-mode board when its data goes stale #15930

Closed

Description

@hivecommons-hive

Part of #15860

Make a display-mode board say honestly when its data is stale. The board dims and reads Stale: last update 4 m ago when the SSE feed or the spoke goes quiet. This is the "honest liveness" piece of Part A.

Depends on #15925 (the ?display=1 shell).

Decision constraints that apply (from the maintainer's /hive decision on #15860)

  • Apply this only in display mode (body.display-mode). Make no change to the ordinary Activity Monitor or to what headless ?kiosk=1 renders. The existing "updated … ago" chip keeps its current behaviour everywhere.
  • Rendering only: no new endpoints, credentials or privileges.

Where

  • src/pkg/dashboard/static-src/js/tracker-filter-render.js: stageTrackerUpdatedHtml(d, nowMs, pollError, pollErrorSinceMs) already computes stale = failing || ageMs > 2 * cache_ttl_s. stageTrackerPollFailed() / stageTrackerPollOk() track poll errors. stageTrackerTickClock() re-renders the chip.
  • src/pkg/dashboard/static-src/js/sse-bootstrap.js: noteSSEFrame() sets _sseLastFrameAtMs. sseWatchdogTick(), the onerror reconnect (3 s) and the roll check via versionReadUpgradeProgress() are the ✨ Show the upgrade animation for every roll (announce + SIGTERM fallback) #15804 roll signal. The sseStreamIdle() helper lives between // sse watchdog helpers begin/end markers.
  • STAGE_TRACKER_POLL_MS is the poll interval.
  • src/pkg/dashboard/static-src/css/popout.css: the dim and banner styles, scoped to body.display-mode.
  • Regenerate src/pkg/dashboard/static/index.html with go generate ./src/pkg/dashboard/webstatic.

What

  • Add a pure stageTrackerDisplayStale(nowMs, sseLastFrameMs, pollMs, generatedAtMs, cacheTtlMs). It returns { stale, sinceMs, reason }, where stale is true when:
    • SSE has been silent for more than 2× pollMs, or
    • generated_at is older than 2× cache_ttl_s.
  • Put the helper between // tracker display liveness helpers begin/end markers.
  • In display mode, a 1 s clock tick evaluates the helper. When stale, it sets body.display-stale, which dims the board, and shows a banner with Stale: last update N ago.
  • The display header shows the hive id (already available to stageTrackerPopoutSyncTitle()), a clock and a live dot that turns amber when stale.
  • Recovery: in display mode only, after 5 consecutive failed reconnects, schedule location.reload() on an exponential backoff (30 s doubling, capped at 10 min). Also reload once when the existing roll signal reports that an upgrade finished. A reload keeps the URL, so the view survives.
  • Respect prefers-reduced-motion for the dim transition.
  • Document the stale indicator in the display-mode section of src/docs/streaming-the-activity-monitor.md.

Decision taken by hive: the reload backoff constants are fixed in code (5 failures, 30 s → 10 min). There are no new URL or config knobs, so the change stays bounded.

Acceptance

  • If the spoke is killed or SSE is dropped, the display-mode board dims within 2× the poll interval and recovers by itself when frames resume.
  • Outside display mode, nothing changes. Existing stage_tracker_poll_failure_test.go and sse_watchdog_helpers.test.js still pass.
  • changelog.d/added-activity-monitor-display-stale.md fragment.

Tests

  • New src/pkg/dashboard/stage_tracker_display_liveness.test.js (node:test). Lift the helper by marker from static/index.html. Cover SSE-silent, TTL-expired, fresh and never-connected cases, plus the backoff schedule.
  • CI runs the tests; do not run them locally (see AGENTS.md).

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

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature.
    agent/scannerCreated or modified by the scanner agent
    on Oct 31, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 31, 2026
  3. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    Consolidated finding. This was filed as a separate issue; it references exactly the same files as this one (AGENTS.md, changelog.d/added-activity-monitor-display-stale.md, src/docs/streaming-the-activity-monitor.md, src/pkg/dashboard/stage_tracker_display_liveness.test.js, src/pkg/dashboard/static-src/css/popout.css, src/pkg/dashboard/static-src/js/sse-bootstrap.js, src/pkg/dashboard/static-src/js/tracker-filter-render.js, src/pkg/dashboard/static/index.html, sse_watchdog_helpers.test.js, stage_tracker_poll_failure_test.go, static/index.html), so it was folded in here instead. Address it in the same PR as this issue — two PRs editing the same files would conflict.

    [scanner] Announce RFC decision/target/needs-decision changes into the thread, edit on retitle, suppress same-author duplicates

    Part of #15860

    Make a display-mode board say honestly when its data is stale. The board dims and reads Stale: last update 4 m ago when the SSE feed or the spoke goes quiet. This is the "honest liveness" piece of Part A.

    Depends on #15925 (the ?display=1 shell).

    Decision constraints that apply (from the maintainer's /hive decision on #15860)

    • Apply this only in display mode (body.display-mode). Make no change to the ordinary Activity Monitor or to what headless ?kiosk=1 renders. The existing "updated … ago" chip keeps its current behaviour everywhere.
    • Rendering only: no new endpoints, credentials or privileges.

    Where

    • src/pkg/dashboard/static-src/js/tracker-filter-render.js: stageTrackerUpdatedHtml(d, nowMs, pollError, pollErrorSinceMs) already computes stale = failing || ageMs > 2 * cache_ttl_s. stageTrackerPollFailed() / stageTrackerPollOk() track poll errors. stageTrackerTickClock() re-renders the chip.
    • src/pkg/dashboard/static-src/js/sse-bootstrap.js: noteSSEFrame() sets _sseLastFrameAtMs. sseWatchdogTick(), the onerror reconnect (3 s) and the roll check via versionReadUpgradeProgress() are the ✨ Show the upgrade animation for every roll (announce + SIGTERM fallback) #15804 roll signal. The sseStreamIdle() helper lives between // sse watchdog helpers begin/end markers.
    • STAGE_TRACKER_POLL_MS is the poll interval.
    • src/pkg/dashboard/static-src/css/popout.css: the dim and banner styles, scoped to body.display-mode.
    • Regenerate src/pkg/dashboard/static/index.html with go generate ./src/pkg/dashboard/webstatic.

    What

    • Add a pure stageTrackerDisplayStale(nowMs, sseLastFrameMs, pollMs, generatedAtMs, cacheTtlMs). It returns { stale, sinceMs, reason }, where stale is true when:
      • SSE has been silent for more than 2× pollMs, or
      • generated_at is older than 2× cache_ttl_s.
    • Put the helper between // tracker display liveness helpers begin/end markers.
    • In display mode, a 1 s clock tick evaluates the helper. When stale, it sets body.display-stale, which dims the board, and shows a banner with Stale: last update N ago.
    • The display header shows the hive id (already available to stageTrackerPopoutSyncTitle()), a clock and a live dot that turns amber when stale.
    • Recovery: in display mode only, after 5 consecutive failed reconnects, schedule location.reload() on an exponential backoff (30 s doubling, capped at 10 min). Also reload once when the existing roll signal reports that an upgrade finished. A reload keeps the URL, so the view survives.
    • Respect prefers-reduced-motion for the dim transition.
    • Document the stale indicator in the display-mode section of src/docs/streaming-the-activity-monitor.md.

    Decision taken by hive: the reload backoff constants are fixed in code (5 failures, 30 s → 10 min). There are no new URL or config knobs, so the change stays bounded.

    Acceptance

    • If the spoke is killed or SSE is dropped, the display-mode board dims within 2× the poll interval and recovers by itself when frames resume.
    • Outside display mode, nothing changes. Existing stage_tracker_poll_failure_test.go and sse_watchdog_helpers.test.js still pass.
    • changelog.d/added-activity-monitor-display-stale.md fragment.

    Tests

    • New src/pkg/dashboard/stage_tracker_display_liveness.test.js (node:test). Lift the helper by marker from static/index.html. Cover SSE-silent, TTL-expired, fresh and never-connected cases, plus the backoff schedule.
    • CI runs the tests; do not run them locally (see AGENTS.md).

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

  4. clubanderson commented on Oct 31, 2026

    @clubanderson
    Member

    @hanthor Tracking implementation of your RFC #15860 here. Implementer requirement: mention @hanthor in the associated PR description, link this issue and RFC #15860, and post a completion comment mentioning @hanthor after the PR actually merges, with the merge link and a clear distinction between source shipped and deployment/activation. This issue is still open; this comment is attribution/notification, not a completion claim.

  5. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  6. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    Fixed by #15970 (merged f78dd92). Closing. Reply /reopen if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerCreated or modified by the scanner agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions