feat(miner): respect --json on CLI error paths - #5543
Conversation
Add shared cli-error helper and wire parse/runtime failure paths across miner subcommands so --json callers always receive parseable { ok: false, error } on stdout.
Co-authored-by: Cursor <cursoragent@cursor.com>
…ored#4836) Co-authored-by: Cursor <cursoragent@cursor.com>
…4836) Extend unit tests for JSON error output across queue, plan, state, claim, ledger, governor, loop, manage-poll, and calibration. Wrap calibration ledger open in try/catch so --json callers get structured errors. Co-authored-by: Cursor <cursoragent@cursor.com>
…red#4836) Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…#4836) Co-authored-by: Cursor <cursoragent@cursor.com>
|
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 #5543 +/- ##
==========================================
+ Coverage 94.79% 94.87% +0.07%
==========================================
Files 567 568 +1
Lines 45090 45035 -55
Branches 14675 14675
==========================================
- Hits 42743 42726 -17
+ Misses 1613 1575 -38
Partials 734 734
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…bored#4836) Co-authored-by: Cursor <cursoragent@cursor.com>
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-13 04:04:09 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk 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.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
Summary
cli-errorhelper (reportCliFailure,argsWantJson,describeCliError) so miner CLI failure paths emit{ ok: false, error }on stdout when--jsonis set.--jsonfailures.--jsonfailure paths, and dedicated coverage for parse/runtime error branches.Closes #4836
Test plan
npx vitest run test/unit/miner-cli-error.test.ts test/unit/miner-cli-json-error-coverage.test.tsnpx vitest run test/unit/miner-discover-cli.test.ts -t "portfolio queue open fails"Notes