Skip to content

Rebuild provider dashboard as a fleet-ops console - #279

Merged
Gajesh2007 merged 1 commit into
masterfrom
worktree-provider-dashboard
Jun 6, 2026
Merged

Gajesh2007 merged 1 commit into
masterfrom
worktree-provider-dashboard

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented Jun 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Replaces the "We're rebuilding this page" placeholder at /providers with a detailed, modular fleet-operations dashboard. Frontend-only — no backend or protocol changes; uses data already exposed by /v1/me/providers and /v1/me/summary.

The dashboard answers, at a glance, the three questions a provider has:

  • Is everything OK? — a top Fleet Health Strip: one plain-language verdict, a segmented capacity bar (earning / degraded / blocked / offline), and money KPIs (24h, 7d, withdrawable, earning-now).
  • Is there an issue with this machine? — an aggregated, deduped Attention Feed (one row per issue across the fleet, with ×N machines chips that scroll to the card) + per-machine cards whose hero verdict is the load-bearing verb EARNING / NOT EARNING.
  • What can I do? — every warning maps to a concrete fix: a copyable command (darkbloom start, reinstall, restart…), an in-app link (setup / models / payouts), or guidance — surfaced right next to the problem.

Highlights

  • Single routing deriver (routing.ts) feeds the fleet strip, the attention feed, and each machine card, so the glance, the list, and the detail can never disagree.
  • Rich machine cards: hero verdict with the why + fix inline; hand-built live gauges (thermal, memory pressure, CPU, concurrency, decode TPS, GPU memory — no chart library); models loaded/catalog; earnings + reputation; expandable backend slots (token-budget headroom) and a vertical attestation chain (Secure Enclave → OS → MDM → Apple) with a live "Verify against Apple Root CA" button reusing @/lib/cert-verify.
  • Graceful states: onboarding (0 machines), offline / never_seen / untrusted, degraded, blocked, and missing-live-metrics (honest "no live metrics", never zeroed gauges).
  • Data via same-origin proxy routes /api/me/providers + /api/me/summary (forwarding the Privy bearer token) — avoids CORS and keeps the coordinator URL server-side.
  • Modularity: ~32 single-responsibility files under src/app/providers/dashboard/ replace the 722-line monolith; a thin ProviderDashboardContent shim keeps the page import stable (mirrors the src/components/api-keys/ pattern).

Testing

  • New vitest suites: routing, fixes↔warnings contract (every warning id must have a fix), aggregate (dedup / sort / fleet verdict / no false all-clear), format, plus full-page render tests (healthy fleet, mixed problem fleet, onboarding).
  • 211 tests pass, eslint src/ clean, next build green.

Quality gate

Reviewed by independent correctness and design/UX/a11y agents; applied their fixes (dark-mode pill contrast, card borders, focus-visible rings + aria-pressed, tabular-nums, copy-command overflow safety, update-chip wired to latest version, "earning now" counts degraded machines).

Preview

cd console-ui && npm run dev, then open /providers.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Replace the "We're rebuilding this page" placeholder at /providers with a
detailed, modular fleet-operations dashboard for providers.

- Fleet health strip: plain-language verdict + segmented capacity bar + money KPIs
- Aggregated, deduped attention feed; every issue carries a concrete fix
  (copyable command, in-app link, or guidance) enforced by a test
- Rich per-machine cards: EARNING / NOT EARNING hero verdict with the why +
  fix inline, hand-built live gauges (thermal, memory, CPU, concurrency,
  decode TPS, GPU memory), models, earnings/reputation, and expandable
  backend slots + a vertical attestation chain with live Apple Root CA verify
- One routing deriver feeds the strip, feed, and cards so they never disagree
- Fetches the same-origin /api/me/{providers,summary} proxy routes
- Handles onboarding, offline, never_seen, untrusted, degraded, blocked, and
  missing-live-metrics states gracefully
- Modular package (~32 single-responsibility files) replaces the 722-line
  monolith; thin ProviderDashboardContent shim keeps the page import stable
- Tests: routing, fixes↔warnings contract, aggregate, format + full-page
  render tests (healthy / problem fleet / onboarding); 211 vitest pass,
  eslint clean, next build green
@vercel

vercel Bot commented Jun 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
d-inference Ready Ready Preview Jun 6, 2026 8:11am
d-inference-console-ui-dev Ready Ready Preview Jun 6, 2026 8:11am
d-inference-landing Ready Ready Preview Jun 6, 2026 8:11am

Request Review

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

This PR adds a provider dashboard UI and associated tests; none of the changed files match any affected_files pattern in the current threat model, and the changes are largely presentational.


Trust boundaries touched

No existing TB is directly modified. The new dashboard components are read-only UI that consumes coordinator API data already protected by TB-001 and TB-004.


New attack surface not covered by the threat model

Two areas warrant a threat model update rather than a security finding, but engineering should be aware:

  1. Provider status/attestation data surfaced in the browser (AttestationPanel.tsx, CardRoutingVerdict.tsx, TrustFooter.tsx)
    These components presumably fetch and render live provider trust-level fields (SIP state, binary hash, trust tier, routing verdict) from the coordinator. If those fetches go through a BFF route that accepts x-coordinator-url, this is another instance of the existing SSRF primitive (T-017 / SEC-001). Check whether any new /api/providers/* BFF routes were added alongside these components; if so they should be audited against the same allowlist requirement as the payment routes.

  2. fixes.ts / FixAffordance.tsx — operator-facing remediation actions
    If "fix" affordances trigger state-mutating coordinator calls (e.g. re-enrolling a device, overriding trust level, or re-running attestation) rather than just displaying advice, those call paths cross TB-001 or TB-006 and should be explicitly scoped in the threat model. The PR diff does not include the coordinator-side handlers for these actions, so their authentication and authorization cannot be assessed here.

  3. FleetControls.tsx
    Fleet-level controls visible in the dashboard may allow bulk actions across providers. If any control triggers a coordinator write (restart, deregister, trust override), it should be covered under TB-006 admin controls and verified to require appropriate credentials.


SEC-* findings resolved

None — this PR does not touch any open-finding file paths.


Recommendation

If FixAffordance and FleetControls issue mutating coordinator requests, add console-ui/src/app/providers/dashboard/fixes.ts and FleetControls.tsx to the affected_files lists for T-017 (SSRF via client-controlled URL) and T-004 (consumer key used for elevated operations), and ensure the corresponding BFF routes enforce an allowlisted coordinator URL and require appropriate scoped credentials. No action needed for the purely display components.


🔐 Threat model: docs/threat-model.yaml · Updates on each push to this PR

Comment on lines +2 to +12
import {
formatUSD,
formatNumber,
abbreviateNumber,
maskSerial,
shortModelName,
pct,
clampPct,
formatTps,
humanizeUptime,
} from "@/app/providers/dashboard/format";
@Gajesh2007
Gajesh2007 merged commit 401d7c4 into master Jun 6, 2026
21 of 23 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b02758799

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

untrusted: {
kind: "command",
label: "Restart & re-link",
command: "darkbloom restart && darkbloom login",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Replace unsupported restart command

For the dashboard fixes that surface a copyable restart action, darkbloom restart is not a valid provider CLI subcommand: the CLI registers Start, Stop, Status, Doctor, Models, Local, Login, Logout, Benchmark, Update, Verify, Enroll, Unenroll, Logs, Report, and AutoUpdate in provider-swift/Sources/darkbloom/Darkbloom.swift, and the existing diagnostic guidance uses darkbloom stop && darkbloom start for a re-register restart. Users following these new fixes for untrusted/stale/crashed machines will copy a command that fails before recovery (and before darkbloom login in this case).

Useful? React with 👍 / 👎.

value={clampPct(headroom)}
colorClass="bg-accent-brand"
height="h-1"
label={`Token budget ${abbreviateNumber(s.active_tokens)} of ${abbreviateNumber(s.max_tokens_potential)}`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the provider-reported token budget

When Swift providers report active_token_budget_max, coordinator admission uses the provider-reported active_token_budget_used + queued_token_budget <= active_token_budget_max path in freeMemoryAdmits, not active_tokens/max_tokens_potential. This panel labels the legacy active/max-potential counters as the token budget, so queued reservations are omitted and idle slots with available budget can have the headroom bar hidden entirely, giving operators the wrong view of why a machine can or cannot accept more work.

Useful? React with 👍 / 👎.

const groups = new Map<string, AttentionGroup>();

for (const p of providers) {
const warnings = computeWarnings(p, ctx);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize nullable provider model lists

The coordinator's myProvider.Models field is a Go slice without omitempty, so persisted or live providers with no models can be serialized as "models": null. This new dashboard now runs every provider through computeWarnings, which dereferences p.models.length, so any linked/never-seen machine whose stored model list is still nil will crash the whole /providers page before rendering the onboarding or machine cards. Normalize models to [] after parsing, or make the warning logic tolerate null.

Useful? React with 👍 / 👎.

This branch had an error being deployed

1 failed and 3 active deployments
Preview – d-inference-console-ui-dev — 6b027587 Deployed Jun 6, 2026 by vercel[bot]
Preview – d-inference — 6b027587 Deployed Jun 6, 2026 by vercel[bot]
Preview – d-inference-landing — 6b027587 Deployed Jun 6, 2026 by vercel[bot]
benchmarks — 6b027587 Deployed Jun 6, 2026 by Gajesh2007 via E2E Benchmarks #588
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant