Skip to content

feat(miner-ui): surface claim, event, and governor ledger data - #5574

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat-miner-ui-ledgers
Jul 13, 2026
Merged

feat(miner-ui): surface claim, event, and governor ledger data#5574
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
davion-knight:feat-miner-ui-ledgers

Conversation

@davion-knight

Copy link
Copy Markdown
Contributor

What

Adds a read-only Ledgers view to the miner-ui, surfacing the claim, event, and governor ledgers that had no UI today. Per #4855.

  • New local dev-server API (vite-ledgers-api.ts) — sibling of the existing vite-portfolio-queue-api.ts/vite-run-state-api.ts. It bridges the browser app to the three node:sqlite ledgers via their existing read exports, aggregating server-side to:
    • Claims → total + counts by status (active/released/expired)
    • Governor → total + counts by event type
    • Events → total + counts by type + a capped feed of recent entries
  • SAFETY: every ledger is projected to counts + explicitly-listed safe columns. The free-text claim note and the raw event/governor payload/payload_json are structurally omitted — they never cross the wire (the same no-secret / no-excluded-column invariant the read-only MCP tools enforce). A canary test proves each excluded raw field is absent from the response.
  • New /ledgers route (src/routes/ledgers.tsx) built with the shared @jsonbored/gittensory-ui-kit Card/Table components (per Extract a shared design-system package for gittensory-ui and gittensory-miner-ui #4966/Migrate gittensory-miner-ui onto the shared design system #4967), plus a nav link. Same 4-state pattern as the portfolio/run-history views (loading / error / fresh-install empty / populated), and the same fresh-install rule (the resolved DB path is probed first, so a fresh install is never written to).

Tests

src/ledgers.test.tsx (13 tests): the empty summary, all four view states, the client fetch (well-formed / non-2xx / malformed / thrown), and the API handler — correct aggregation, the leakage-invariant canary, the fresh-install no-write path, path/method fall-through, and error→500.

Verified locally: 13 tests pass, tsc --noEmit clean, existing miner-ui suite still green.

Fixes #4855

Add a read-only Ledgers view to the miner-ui (JSONbored#4855). A new local dev-server API
(vite-ledgers-api.ts) bridges the browser app to the claim/event/governor SQLite
ledgers via their existing read exports, aggregating SERVER-SIDE to status/type
counts plus a small feed of explicitly-projected safe columns — raw payloads and
the free-text claim note never cross the wire (the same no-secret/no-excluded-column
invariant the read-only MCP tools enforce). The view is built with the shared
gittensory-ui-kit Card/Table components and mirrors the portfolio/run-history 4-state
pattern (loading / error / fresh-install empty / populated).

Fixes JSONbored#4855
@superagent-security

Copy link
Copy Markdown
Contributor

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

@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
@loopover-orb

loopover-orb Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-13 06:34:24 UTC

7 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a read-only Ledgers view (claim/event/governor) to miner-ui, following the existing portfolio/run-state API-plugin pattern with server-side aggregation, an explicit safe-column projection, and a canary test proving raw `note`/`payload` fields never cross the wire. The fresh-install probe (`fileExists` before calling `list*`/`read*`) correctly avoids creating a DB file on first load, matching the sibling APIs. The implementation is clean, well-tested (13 tests covering all four view states plus API aggregation/error/fresh-install paths), and closes the linked issue #4855 with narrowly-scoped, read-only work.

Nits — 5 non-blocking
  • `summarizeEvents` in vite-ledgers-api.ts:79 assumes `readEvents()` returns rows in ascending chronological order (oldest-first) before slicing the last N and reversing — worth confirming that ordering guarantee holds in `event-ledger.js`, since if it doesn't, the 'recent' feed silently shows the wrong entries.
  • `LedgersView` in ledgers.tsx:59 is a fairly large single component (~76 lines) mixing three sections' worth of layout logic; consider splitting into per-section components for readability, though not required.
  • Magic numbers `200`/`500` in vite-ledgers-api.ts:125,128 for status codes could be self-documenting constants, though the context makes them obvious.
  • routeTree.gen.ts is an auto-generated file — confirm it was regenerated via the router codegen tool rather than hand-edited, since diffs to generated files are easy to get subtly wrong.
  • Consider naming the HTTP status literals (e.g. `const OK = 200`) in vite-ledgers-api.ts for consistency with other constants like `RECENT_EVENT_LIMIT`.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #4855
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 124 registered-repo PR(s), 89 merged, 2 issue(s).
Contributor context ✅ Confirmed Gittensor contributor davion-knight; Gittensor profile; 124 PR(s), 2 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: moderate — The diff is a well-scoped, safety-conscious read-only UI feature that directly closes issue #4855 and follows established sibling-API conventions without introducing new architectural surface.
Linked issue satisfaction

Addressed
The PR adds a single combined /ledgers view in the miner-ui backed by a new API bridging the existing claim/event/governor ledger read exports, built with the shared design-system Card/Table components per #4966/#4967 as required, with tests covering all states.

Review context
  • Author: davion-knight
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 124 PR(s), 2 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

Visual preview
Route Viewport Before (production) After (this PR's preview) Diff
/ledgers desktop before /ledgers after /ledgers
/ledgers mobile before /ledgers (mobile) after /ledgers (mobile)
/ desktop before / after /
/ mobile before / (mobile) after / (mobile)

Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

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

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit aa7382d into JSONbored:main Jul 13, 2026
8 checks passed
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.

Surface claim/event/governor ledger data in the miner-ui

1 participant