fix(cli): align root output shapes - #3037
Conversation
Keep root position rows aligned with their human table columns in both single-wallet and all-wallet modes. Emit one consolidated JSON document for explicit validator details and cover the affected human and JSON paths.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE HIGH scrutiny by account age (33 days), mitigated by repository admin access and substantial contribution history; no committer mismatch or Gittensor association; branch targets main. FindingsNo findings. ConclusionThe SDK-only rendering changes are narrow, match the stated purpose, and introduce no security vulnerability, runtime risk, dependency change, or trust-boundary modification. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor association: UNKNOWN; newer account but established repository administrator with substantial contribution history, so review focused on correctness and regression coverage. The implementation matches the substantive PR description. The conditional wallet cell keeps both root-list table shapes aligned, and the JSON-mode early return emits a single validator-summary document without altering human output. Regression tests cover both list modes and explicit-hotkey human/JSON rendering. No runtime code, migration, dependency, or spec-version change is involved. No overlapping PRs were identified. FindingsNo findings. ConclusionThe CLI-only fix is minimal, internally consistent, and adequately covered by focused regression tests. No merge-blocking domain issues found. |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Motivation
btcli root list --coldkey <ss58>crashes in human-output mode withIndexError: list index out of range. The single-wallet view declares fivecolumns but its row builder always emitted the all-wallet view's leading
wallet cell, producing six cells. The same root-output audit also found that
btcli --json root show --hotkey ...could emit multiple JSON documents.Changes
--all, keepingrow widths aligned with
position_columns(all_wallets).validator details, both root-list row shapes, and single-document JSON output.
Behavioral impact
Human
root listoutput now works for both one coldkey and all wallets. JSONoutput for explicit
root show --hotkeyis valid as one parseable document.No chain calls, transaction behavior, or public SDK reads change.
Migration and runtime impact
SDK/CLI-only change. No runtime migration or
spec_versionbump is required.Verification
pytest sdk/python/tests/unit/test_cli.py: 37 passedpytest sdk/python/tests: 1,075 passed, 1 skippedOutput.table()andOutput.columns()call site: no otherrow/header width mismatches found.