Skip to content

feat(miner-ui): add governor pause/resume controls#5611

Merged
JSONbored merged 1 commit into
mainfrom
miner-ui-governor-controls
Jul 13, 2026
Merged

feat(miner-ui): add governor pause/resume controls#5611
JSONbored merged 1 commit into
mainfrom
miner-ui-governor-controls

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Adds apps/gittensory-miner-ui/vite-governor-api.ts: GET /api/governor/pause-state (read) plus POST /api/governor/pause / POST /api/governor/resume (write) — the miner-ui's first write-capable endpoints, thin bridges to the same governor-state.js exports (loadPauseState/savePauseState) the CLI's governor pause/governor resume/governor status already use. No new pause/resume semantics invented; governor-chokepoint.js/governor-chokepoint-persisted.js (the governor's actual decision-to-proceed logic) are completely untouched.
  • Adds apps/gittensory-miner-ui/src/lib/governor.ts: typed client (fetchGovernorPauseState, pauseGovernor, resumeGovernor), mirroring the existing read-only fetchers' error-handling shape.
  • Adds a GovernorControlSection to the ledgers page: current pause state + a Pause/Resume button, wired into LedgersPage's existing fetch-on-mount pattern with its own independent load/action state.
  • Registers governorApiPlugin() in vite.config.ts after authPlugin(), so both the read and write routes are covered by Add auth to the local miner-ui API #4858's cookie auth from the moment they exist.

Scope

This is the governor half of #4857 ("Add real actions to the miner-ui"). Queue release/requeue actions (the other half) are deliberately not included: they need a per-item identifier, which the read-only portfolio-queue API intentionally never republishes over the wire (see vite-portfolio-queue-api.ts's own header comment — repo names are exposed, identifiers/priorities are not). Exposing identifiers safely is a real design decision, not a trivial wire-up, and is left for a follow-up. Also deliberately sequenced after #4858 (merged): a write-capable /api/* endpoint landing before that auth gate would have shipped briefly unauthenticated depending on merge order.

Advances #4857 (not closing it — the queue release/requeue half is still open).

Test plan

  • npm run ui:typecheck (via npm run ui:kit:build first)
  • npm --workspace @loopover/ui-miner run lint — 0 errors (5 pre-existing, unrelated warnings)
  • npm --workspace @loopover/ui-miner run test — 103/103 passing across the app (41 new: route matching, the handler's fresh-install-safe GET path, POST body parsing incl. malformed/non-string reason, store-failure 500s, the actual Vite middleware wiring via both configureServer/configurePreviewServer, GovernorControlSection render/interaction states, the two client fetchers, and LedgersPage integration — load-on-mount, click-to-pause/resume updates the displayed state, button disabled while an action is in flight, error state doesn't break the rest of the page)
  • npm --workspace @loopover/ui-miner run build
  • Manually started the real dev server against a fresh config dir and curled the full flow end-to-end: cookie from /, GET pause-state (not paused), POST pause with a reason, GET pause-state (paused, reason/timestamp present), POST resume (back to not-paused), and confirmed an unauthenticated POST /api/governor/pause is rejected with 401

This change lives entirely under apps/gittensory-miner-ui/**, which vitest.config.ts's root coverage.include explicitly excludes (apps/**) — Codecov's patch gate does not apply here, matching #5605/#5479's precedent.

Adds vite-governor-api.ts (GET /api/governor/pause-state, POST
pause/resume), a client fetcher, and a GovernorControlSection wired
into the ledgers page. The governor half of #4857 -- queue
release/requeue is deferred pending a separate identifier-exposure
design decision. Safe only because #4858 now authenticates all
/api/* requests.
@JSONbored JSONbored self-assigned this Jul 13, 2026
@JSONbored JSONbored merged commit 1021569 into main Jul 13, 2026
9 checks passed
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored deleted the miner-ui-governor-controls branch July 13, 2026 09:28
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 13, 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