feat(miner-portfolio): read-only portfolio dashboard view (#4287) - #4482
Conversation
…4287) Add packages/gittensory-miner/lib/portfolio-dashboard.js: a read-only aggregate view of the miner's OWN local portfolio-queue backlog, in the same three-layer shape as manage-status.js (pure collect -> pure render -> thin CLI glue) but scoped to the queue rather than per-PR manage state. - collectPortfolioDashboard(sources, { nowMs }): a pure aggregator over an injected portfolio-queue store (mirrors collectManageStatus). Read-only — never mutates queue state. Returns counts by status (queued/in_progress/done) globally and per repo, plus the oldest queued item's age when a clock is given. - renderPortfolioDashboardTable + a --json path (mirrors renderManageStatusTable). - runPortfolioDashboard: CLI glue wired as 'gittensory-miner queue dashboard' (one new case in runQueueCli's dispatch, alongside list/next/done). The extension-panel half is a forward dependency, not delivered here: the miner's queue is a local SQLite file with no local-reachable channel a GitHub-page content script can read today; the pure collector is factored to be reusable once one exists. Adds the hand-written .d.ts. Closes JSONbored#4287
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4482 +/- ##
=======================================
Coverage 94.03% 94.03%
=======================================
Files 420 420
Lines 37521 37521
Branches 13701 13701
=======================================
Hits 35282 35282
Misses 1583 1583
Partials 656 656 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 21:41:17 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
Adds
packages/gittensory-miner/lib/portfolio-dashboard.js— a read-only aggregate view of the miner's own local portfolio-queue backlog, in the same three-layer shape asmanage-status.js(pure collect → pure render → thin CLI glue), scoped to the queue rather than per-PR manage state.API
collectPortfolioDashboard(sources, { nowMs })— a pure aggregator over an injected portfolio-queue store (mirrorscollectManageStatus). Read-only — never mutates queue state. Returns counts by status (queued/in_progress/done) globally and per repo, plus the oldest queued item's age in ms when a clock is supplied (null otherwise). Robust to unknown statuses, non-string repos, and malformed timestamps.renderPortfolioDashboardTable+ a--jsonpath (mirrorsrenderManageStatusTable).runPortfolioDashboard— CLI glue wired asgittensory-miner queue dashboardvia one new case inrunQueueCli's dispatch (alongsidelist/next/done; nobinedit needed).Scope
The extension-panel half is a forward dependency, not delivered here: the miner's queue is a local SQLite file with no local-reachable channel a GitHub-page content script can read today (per
portfolio-queue.js's "never uploads, syncs, or phones home" header). The pure collector is factored to be directly reusable once such a channel exists. This is read-only — it doesn't gate or enforce anything (unrelated to the maintainer-only Governor chokepoint work).Tests
test/unit/miner-portfolio-dashboard.test.ts: the collector (invalid-source throw, multi-status/multi-repo aggregation, oldest-queued age, null-age when no clock / nothing queued, unknown-status + non-string-repo + malformed-timestamp handling), the renderer (empty, with/without age), the arg parser, and the CLI runner (table +--json+ bad-arg error). Pure collector/renderer/parser fully covered; typecheck clean; the existing queue-CLI + miner-package skeleton suites stay green. Adds the hand-written.d.ts.Closes #4287