Skip to content

feat(miner-manage-ui): fold run-state into the manage-status panel - #4494

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
oktofeesh1:feat/miner-manage-status-run-portfolio-4279
Jul 9, 2026
Merged

feat(miner-manage-ui): fold run-state into the manage-status panel#4494
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
oktofeesh1:feat/miner-manage-status-run-portfolio-4279

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

gittensory-miner manage status only ever showed PR-scoped rows (from the portfolio queue + manage_pr_update events), so a repo actively being discovered/planned/prepared with zero PRs yet was invisible in the panel. This adds a "run portfolio" view that folds each tracked repo's current discover/plan/prepare run state (run-state.js) alongside its managed PR rows into one row per repo.

  • run-state.js: adds listRunStates() (store method + module-level default-store helper) returning every recorded repo's run state, sorted by repo full name. Read-only, mirrors the existing getRunState legacy-row fail-closed behavior.
  • manage-status.js: adds collectRunPortfolio(sources) — a pure aggregator that folds collectManageStatus PR rows with listRunStates() by repo, and renderRunPortfolioTable(portfolio) for the compact per-repo companion table.
  • runManageStatus now also opens/owns a run-state store, and:
    • --json output gains a new runPortfolio key additive only — the existing rows key/shape is unchanged, so an existing consumer parsing rows alone sees byte-identical output.
    • text output appends the new run-portfolio table after the existing PR table.
  • README: documents the two previously-undocumented manage status/manage poll command lines and the new run-portfolio behavior, with an explicit note that a real GUI dashboard (apps/gittensory-miner-ui/) is a later phase of the same roadmap and out of scope here.

Closes #4279

Test plan

  • test/unit/miner-run-state.test.ts — added tests for listRunStates (sorted output, legacy-row fail-closed drop, module-level default-store helper)
  • test/unit/miner-manage-status.test.ts — added tests for collectRunPortfolio (run-state-only repo, PR-only repo, multi-PR fold sorted by repo, invalid-store rejection) and renderRunPortfolioTable (empty + null-state cases), plus rewrote the runManageStatus CLI test to assert both the unchanged rows output and the new additive runPortfolio output
  • npm run typecheck
  • npm run test:ci (full local gate, green)

Add listRunStates() to run-state.js and a new collectRunPortfolio /
renderRunPortfolioTable pair in manage-status.js that folds each
tracked repo's discover/plan/prepare run state alongside its managed
PR rows into one row per repo, so a repo actively being worked with
zero PRs yet still shows up. runManageStatus additively includes a
runPortfolio key in --json output and appends the new table to text
output; the existing rows key and PR table are unchanged.

A real GUI dashboard (apps/gittensory-miner-ui/) is a later phase of
the same roadmap and out of scope here.

Closes JSONbored#4279
@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner July 9, 2026 22:00
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.03%. Comparing base (953fdef) to head (04db05b).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4494   +/-   ##
=======================================
  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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tip

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

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-09 22:15:03 UTC

7 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds a read-only 'run portfolio' view to `manage status`, folding `run-state.js`'s per-repo discover/plan/prepare state alongside existing PR-scoped rows, closing #4279. The core aggregation (`collectRunPortfolio`) and `listRunStates` are pure/read-only, correctly mirror the existing fail-closed legacy-row handling in `getRunState`, and the JSON/text output changes are genuinely additive — the existing `rows` key and PR table are untouched. Test coverage is thorough (run-state-only repo, PR-only repo, multi-PR fold, invalid-store rejection, empty/null-state rendering, and a full CLI round-trip for both text and `--json`), and the README updates plus issue link are appropriate.

Nits — 5 non-blocking
  • packages/gittensory-miner/lib/manage-status.js:182-192 — `renderManageStatusTable` and `renderRunPortfolioTable` both hardcode column widths (24/12/20/4); consider extracting shared width constants so the two tables can't silently drift out of alignment as columns are added.
  • packages/gittensory-miner/lib/run-state.js:93-98 — `listRunStates()` allocates a full array via `.all()` then filters/maps; fine at expected repo-tracking scale, but worth a one-line note if this table is ever expected to grow unbounded.
  • The external magic-number/debug-leftover flags on `console.log` calls and `feat(miner-manage-ui): manage-phase dashboard panel for run portfolio #4279` issue references in comments are false positives — those are legitimate CLI output and issue citations, not debug leftovers or unexplained literals.
  • Consider a shared `formatTableRow(columns)` helper for `manage-status.js` given two now-near-identical table renderers, to avoid a third copy-paste if a third table view is added later.
  • The README note distinguishing this from the out-of-scope `apps/gittensory-miner-ui/` GUI phase is a good call — keeps the PR's scope honest against the roadmap.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4279
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: 32 registered-repo PR(s), 25 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor oktofeesh1; Gittensor profile; 32 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Addressed
The PR adds listRunStates() to run-state.js and folds it with collectManageStatus via a new collectRunPortfolio aggregator and renderRunPortfolioTable, exposed additively in both --json (new runPortfolio key, rows unchanged) and text output, with new unit tests in both miner-manage-status.test.ts and miner-run-state.test.ts, and updates the README's Commands section plus notes the Phase 6 GUI depe

Review context
  • Author: oktofeesh1
  • 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: 32 PR(s), 0 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.

🟩 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 591b230 into JSONbored:main Jul 9, 2026
10 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 9, 2026
@JSONbored JSONbored added gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 9, 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. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Development

Successfully merging this pull request may close these issues.

feat(miner-manage-ui): manage-phase dashboard panel for run portfolio

2 participants