Skip to content

fix(miner): honor --json on manage status and queue dashboard runtime failures - #6147

Closed
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-manage-status-json-errors-v2
Closed

fix(miner): honor --json on manage status and queue dashboard runtime failures#6147
RealDiligent wants to merge 1 commit into
JSONbored:mainfrom
RealDiligent:fix/critical-issue-manage-status-json-errors-v2

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

  • runManageStatus and runPortfolioDashboard wrap store init + collection in try/catch and route failures through reportCliFailure, matching the Make CLI error paths respect --json #4836 CLI contract used by sibling commands (calibration, plan list, queue list).
  • Store opens moved inside try; finally uses optional chaining so partial init still closes opened stores.
  • Tests cover both --json and plain-text store/runtime failure paths for both commands.

Linked issue

No linked issue because: fork contributors cannot open issues on JSONbored/loopover (CreateIssue denied), and the existing help-wanted pool for this bug class is empty. This is a small, self-contained chore/cleanup of the established CLI JSON error contract — same gap class already fixed for discover/manage-poll (#6051/#6072) and loopover-mcp (#6113), applied to the remaining manage status / queue dashboard paths that still escape as uncaught stack traces.

Supersedes #6140 (auto-closed solely for missing upstream issue link; CI was green).

Test plan

  • npx vitest run test/unit/miner-manage-status.test.ts test/unit/miner-portfolio-dashboard.test.ts (23/23 pass)
  • CI validate-tests + codecov patch

@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 15, 2026 19:15
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.33%. Comparing base (4a5bd94) to head (79200d7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6147   +/-   ##
=======================================
  Coverage   95.33%   95.33%           
=======================================
  Files         599      599           
  Lines       47186    47188    +2     
  Branches    15032    15032           
=======================================
+ Hits        44983    44985    +2     
  Misses       1477     1477           
  Partials      726      726           
Flag Coverage Δ
shard-1 43.93% <0.00%> (-0.02%) ⬇️
shard-2 36.68% <0.00%> (+0.01%) ⬆️
shard-3 32.12% <30.00%> (+0.01%) ⬆️
shard-4 32.22% <0.00%> (-1.78%) ⬇️
shard-5 32.64% <70.00%> (+1.15%) ⬆️
shard-6 45.23% <0.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-miner/lib/manage-status.js 97.89% <100.00%> (+0.02%) ⬆️
packages/loopover-miner/lib/portfolio-dashboard.js 100.00% <100.00%> (ø)

… failures

Wrap store init/collection in try/catch and route errors through
reportCliFailure so automation and MCP consumers get parseable
{ ok: false, error } output instead of uncaught stack traces.

Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 15, 2026
@loopover-orb

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-15 19:22:34 UTC

4 files · 1 AI reviewer · 2 blockers · readiness 100/100 · CI green · clean

🛑 Suggested Action - Reject/Close

Review summary
This PR wraps `runManageStatus` and `runPortfolioDashboard` store-init and collection logic in try/catch, routing failures through the existing `reportCliFailure`/`describeCliError` CLI contract already used by `manage-poll` (see test/unit/miner-manage-poll.test.ts precedent). The `finally` blocks correctly switch to optional chaining (`?.close()`) since store variables can now be undefined if init throws mid-try, which prevents a secondary TypeError on cleanup after a real failure. The diff is small, mechanical, and directly mirrors an already-established pattern (#6051/#6072/#6113), with new tests exercising both `--json` and plain-text failure paths for both commands.

Blockers

  • No linked eligible issue is provided (packages/loopover-miner/lib/manage-status.js, portfolio-dashboard.js) — the description argues fork contributors can't open issues here, but per this repo's contribution policy every external PR must close/link an eligible open issue unless explicitly maintainer-authorized, and 'supersedes fix(miner): honor --json on manage status and queue dashboard runtime failures #6140, auto-closed for the same reason' does not itself constitute authorization.
Nits — 4 non-blocking

Why this is blocked

  • No linked eligible issue is provided (packages/loopover-miner/lib/manage-status.js, portfolio-dashboard.js) — the description argues fork contributors can't open issues here, but per this repo's contribution policy every external PR must close/link an eligible open issue unless explicitly maintainer-authorized, and 'supersedes fix(miner): honor --json on manage status and queue dashboard runtime failures #6140, auto-closed for the same reason' does not itself constitute authorization.
  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked eligible issue is provided \(packages/loopover-miner/lib/manage-status.js, portfolio-dashboard.js\) — the description argues fork contributors can't open issues here, but per this repo's contribution policy every external PR must close/link an eligible open issue unless explicitly maintainer-authorized, and 'supersedes \#6140, auto-closed for the same reason' does not itself constitute authorization.

2. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
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 (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 363 registered-repo PR(s), 180 merged, 30 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 363 PR(s), 30 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, Ruby, Svelte, TypeScript, Markdown, MDX
  • Official Gittensor activity: 363 PR(s), 30 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.
🧪 Chat with LoopOver

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

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover 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/loopover-commands

🧪 Experimental — new and may change.

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (No linked issue detected; AI reviewers agree on a likely critical defect: No linked eligible issue is provided (packages/loopover-miner/lib/manage-status.js, portfolio-dashboard.js) — the description argues fork contributors can't open issues here, but per this repo's contribution policy every external PR must close/link an eligible open issue unless explicitly maintainer-authorized, and 'supersedes #6140, auto-closed for the same reason' does not itself constitute authorization.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 15, 2026
@RealDiligent

Copy link
Copy Markdown
Contributor Author

Thanks — understood that outside contributors need an open JSONbored/loopover issue (fork issues / no-issue rationales are not enough for the auto-close policy).

Could a maintainer please file a short tracking issue for this bug class?

Title: fix(miner): manage status / queue dashboard --json crashes on store runtime errors

Body sketch: runManageStatus and runPortfolioDashboard honor reportCliFailure on parse errors but still let SQLite open/read failures throw uncaught (vs calibration / plan list / discover --dry-run). Same #4836 CLI JSON contract as #6051/#6072/#6113.

Ready-to-merge patch is on RealDiligent:fix/critical-issue-manage-status-json-errors-v2 (CI was green; closed only for missing issue link). Happy to reopen immediately with Closes #<new>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant