Skip to content

feat(miner-ui): add a build-time-flagged demo mode (no backend, no credentials)#7209

Merged
JSONbored merged 1 commit into
mainfrom
worktree-miner-ui-demo-mode
Jul 18, 2026
Merged

feat(miner-ui): add a build-time-flagged demo mode (no backend, no credentials)#7209
JSONbored merged 1 commit into
mainfrom
worktree-miner-ui-demo-mode

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • apps/loopover-miner-ui only exists today as something an individual AMS miner builds and runs locally — there's no way to show anyone what it looks like without them self-hosting it first, and Spec: client-surface strategy for hosted AMS (web dashboard vs. mobile/desktop apps vs. CLI-only) #5229's open decision about whether hosted AMS reuses this dashboard is currently being made with no working prototype to point at.
  • Confirmed the 12 local API plugins backing this dashboard's real data are Vite dev/preview-server-only (configureServer/configurePreviewServer hooks, no build-time hooks) — they never run in a built, deployed context at all. This rules out "swap the plugin for a mock" as an approach for an eventual static/Worker deploy; the mock has to live at the frontend fetch-client layer instead.
  • Adds VITE_DEMO_MODE (mirrors loopover-ui's signInPreview() build-time-flag mechanism — same mechanism family, just covering N fabricated API responses instead of one fake session object) gating a demo branch in the five REST fetchers backing the three main dashboard routes: run-history, ledgers, portfolio-queue + its release/requeue actions, governor.
  • Governor pause/resume and queue release/requeue mutate real in-memory, browser-session-only state rather than a static read-only view — harmless to simulate (no real governor/queue to protect), and a demo control that visibly does nothing is a worse demo than one that responds.
  • A visible "Demo — sample data, no live backend" badge in the header keeps this honest. Every fixture value is entirely synthetic — no real repo, run, ledger entry, or account referenced anywhere.

Scoped deliberately to this mock layer only:

  • discover/attempt/chat (which trigger a real coding-agent iteration or ground against a live MCP connection) are not covered — fabricating a convincing multi-minute agent run is a separate, much larger content-design task than tabular summary data.
  • The CI build+deploy workflow (a new subdomain Worker deploy) is not in this PR — that's a guarded CI-config-touching change deserving its own focused PR.

Advances #5963 (a scoped first slice, not the full issue — see above)

Test plan

  • npm run typecheck (miner-ui workspace) — clean
  • npm run lint (miner-ui workspace) — clean (0 errors, only pre-existing unrelated warnings)
  • Full miner-ui test suite (npx vitest run in apps/loopover-miner-ui) — 320/320 passing
  • New tests: demo-data.test.ts (fixture shape invariants, governor pause/resume state transitions, queue-item removal), plus a demo-mode test added to each of the 5 fetcher test files confirming the demo branch never calls the injected fetchImpl
  • UI Evidence — visual change is a small header badge; not captured as a screenshot for this PR, but verified via the demo-mode test suite that the badge only renders when VITE_DEMO_MODE=1

Safety

apps/** is outside Codecov's patch-coverage scope entirely (repo codecov.yml's ignore list), so no coverage obligation here — verified against the actual config rather than assumed. Zero behavior change for the real (non-demo) self-host build: import.meta.env.VITE_DEMO_MODE is a build-time constant, so the "off" branch (real fetch calls) is what every production/self-host build ships, byte-identical to before this PR.

…edentials)

apps/loopover-miner-ui only exists as something an individual AMS miner
builds and runs locally -- there's no way to show anyone what it looks
like without them self-hosting it first, and #5229's open decision about
whether hosted AMS reuses this dashboard is currently being made with no
working prototype to point at.

The 12 local API plugins that back this dashboard's real data are
Vite dev/preview-server-only (configureServer/configurePreviewServer
hooks) -- they never run in a built, deployed context at all, so "swap
the plugin for a mock" can't work for an eventual static/Worker deploy.
The mock has to live at the frontend fetch-client layer instead.

Adds VITE_DEMO_MODE (mirrors loopover-ui's signInPreview() build-time-flag
mechanism) gating a demo branch in the five REST fetchers backing the
three main dashboard routes (run-history, ledgers, portfolio-queue +
its release/requeue actions, governor). Governor pause/resume and
queue release/requeue mutate real in-memory (browser-session-only) state
rather than a static read-only view -- harmless to simulate, and a control
that visibly does nothing is a worse demo than one that responds. A
visible "Demo — sample data, no live backend" badge keeps this honest;
every fixture value is entirely synthetic.

Scoped deliberately to this mock layer only -- discover/attempt/chat
(which trigger a real coding-agent iteration or ground against a live MCP
connection) and the CI build+deploy workflow are follow-up work, not this
change.

Advances #5963
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 7328476 Commit Preview URL

Branch Preview URL
Jul 18 2026, 09:11 PM

@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@JSONbored JSONbored self-assigned this Jul 18, 2026
@JSONbored
JSONbored merged commit 6b11f02 into main Jul 18, 2026
12 checks passed
@JSONbored
JSONbored deleted the worktree-miner-ui-demo-mode branch July 18, 2026 21:13
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant