Skip to content

🐛 fix(dashboard): show the fleet running · $/hour figure in the visible Governor grid - #14597

Merged
hivecommons-hive[bot] merged 2 commits into
v5from
feat/fleet-run-governor-stat
Oct 27, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
v5from
feat/fleet-run-governor-stat

Conversation

@clubanderson

@clubanderson clubanderson commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Problem

#14580 (#14576) added a fleet running N · $X this hour figure to the governor strip, but it renders inside .oc-gov-strip, which the SPA hides (display:none, "compact governor strip no longer needed"). The figure was wired and tested but never visible to an operator.

Fix

Add a fleet running gov-stat (id="gov-fleet-run", fleetRunStatHtml()) to the visible Governor gov-grid after MTTR, fed by the same fleetRun status field as the strip. The hidden strip figure is left in place so existing tests and ids are unchanged.

Tests

  • pkg/dashboard/webstatic/fleet_run_stat_test.go — asserts the gov-stat exists in the Governor grid, uses tokens only, and reuses fleetRun.
  • go test ./pkg/dashboard/webstatic 92.9 % (floor 88).

Follow-up to #14580; relates to #14576.

Evidence (screenshots)

Governor grid with the new RUNNING stat (3 · $– this hour — $– because a running agent's model is unpriced), captured against hive's own spoke:

governor grid running stat

…ernor grid

fleetRunStripHtml landed in .oc-gov-strip, which is display:none, so the
fleet figure from #14580 was never on screen. Render the same figure as a
gov-stat in the Governor section and pin it with a webstatic test.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 27, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 27, 2026
@hivecommons-hive hivecommons-hive Bot added author/human A person pushed this PR themselves dco All commits are DCO signed-off 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 27, 2026
@github-actions

github-actions Bot commented Oct 27, 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
#14573 ✨ feat(dashboard): show a draft pill in the activity tracker same files 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.

Reviewed — no findings from this perspective.

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

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

Reviewed (correctness) — no blocking findings; one body/test gap.

The PR body says fleet_run_stat_test.go "asserts the gov-stat … uses tokens only, and reuses fleetRun". The test at src/pkg/dashboard/webstatic/fleet_run_stat_test.go:27-31 only checks that ${fleetRunStatHtml()} sits inside the gov-grid and that the id="gov-fleet-run" / title="RUNNING markup exists — nothing pins the fleetRun source or token-only styling. Either trim the body or add the assertion, e.g.:

	if !strings.Contains(html, `id="gov-fleet-run"`) || !strings.Contains(html, `class="gov-stat" title="RUNNING`) {
		t.Fatal("fleet run gov-stat markup missing")
	}
	fn := strings.Index(html, "function fleetRunStatHtml()")
	if fn < 0 || !strings.Contains(html[fn:fn+600], "window._lastStatus?.fleetRun") {
		t.Fatal("fleetRunStatHtml does not read the shared fleetRun status field")
	}

Otherwise the implementation (index.html:13565-13570) mirrors fleetRunStripHtml (:13571-13576) exactly and is placed in the single Governor gov-grid (:19128-19134), fed by window._lastStatus which is set at :34188 before renderGovernor at :34226.

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

@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 diff against v5 plus run_meter.go and the renderGovernor call path. The change does what it says: .oc-gov-strip is display:none (src/pkg/dashboard/static/index.html:633-634), so the #14580 figure was indeed never visible, and the new fleetRunStatHtml() tile renders inside the visible gov-grid (index.html:19134). window._lastStatus = data (index.html:34188) runs before renderGovernor(...) (index.html:34226), so the tile refreshes with every status poll. The new test's string anchors (gov-grid sec-headline once at 19128, temp-gauge at 19156) hold. Looks correct to me.

One verified mismatch in the operator-facing text, low severity:

  • index.html:13569 — the tooltip explains $– as "when a running agent's model is unpriced"; the backend says otherwise. $– is shown when hourPriced is false, and HourPriced is m.hourSeen (src/pkg/dashboard/run_meter.go:162), which flips true on the first observeEstimate call in the clock hour (run_meter.go:107-110) regardless of model pricing. The existing doc has it right: "$– means the hive has not yet taken a reading this hour" (src/docs/dashboard-sections.md:100). The PR body/screenshot caption repeats the unpriced-model explanation, so an operator reading the tooltip would go looking for a pricing gap that isn't there. Suggest aligning the tooltip (and the body) with the doc wording.

Also worth a one-line doc touch: src/docs/dashboard-sections.md:100 still points operators at "the compact strip at the top of the Agents view" for the running figure — that strip is the hidden one this PR works around. Pointing it at the Governor tile would keep docs and UI in step.

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

@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 at 0c462ac against the tree, not just the diff. Looks correct to me.

  • .oc-gov-strip really is display:none (src/pkg/dashboard/static/index.html:634), so the #14580 figure was never on screen — the problem statement holds.
  • fleetRunStatHtml() (index.html:13562–13570) reads the same fleetRun.{running,hourPriced,hourUSD} fields as fleetRunStripHtml() (index.html:13571–13576), which match FrontendFleetRun in run_meter.go:51–53; the $– unpriced branch is identical.
  • The new tile follows the existing gov-stat → .label/.val idiom used by the mode and next run tiles (index.html:19130, 19154), and both test anchors (gov-grid sec-headline at 19128, temp-gauge at 19156) exist in the order the test assumes.

No findings. Not approving — that is a human's signature — but nothing here needs one from me.

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

@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/static/index.html at 310891f. Looks correct to me.

  • fleetRunStatHtml() (line 13565) and the existing fleetRunStripHtml() (line 13571) read the same window._lastStatus?.fleetRun and apply the same hourPriced guard, so the two figures cannot disagree; they emit distinct ids (gov-fleet-run vs oc-fleet-run), so rendering both leaves no duplicate DOM id.
  • .gov-stat .val (line 1761) is element-agnostic and three existing tiles already use <div class="val"> rather than the spark-row/span form, so the new tile styles like its neighbours.
  • webstatic/fleet_run_stat_test.go pins the placement inside the gov-grid sec-headline … temp-gauge span, which is the right invariant for the regression described.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 4bf2e4d into v5 Oct 27, 2026
76 of 77 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/fleet-run-governor-stat branch October 27, 2026 17:03
@hivecommons-hive

Copy link
Copy Markdown
Contributor
Evidence bundle `#14597310891f` sha256:c1bdf42be33007da0dadb3602571695c602a2ab2a53f2830c95bbee45078e009 — download from the dashboard or `hivectl review evidence #14597`.

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

@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 diff at 310891f against the v5 tree. The premise and the fix both check out:

  • .oc-gov-strip { display: none; ... } at src/pkg/dashboard/static/index.html:633-634, so the existing fleetRunStripHtml() (:13571) genuinely never reaches the screen.
  • fleetRunStatHtml() (:13565) reads the same window._lastStatus.fleetRun fields (running, hourPriced, hourUSD) as its twin and uses the same fmtUSD (:25121) and $– fallback, so the two render identical numbers.
  • In the status poll, window._lastStatus = data (:34188) runs before renderGovernor(...) (:34226), so the tile is rebuilt from the current poll, matching the tooltip's "updates with every status poll".
  • The tile is inserted in renderGovernor's gov-grid between MTTR and "on hold", and the webstatic test pins exactly that placement.

Looks correct to me.

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

@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

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. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/M Denotes a PR that changes 30-99 lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant