Skip to content

fix(cli): align root output shapes - #3037

Open
UnArbosFive wants to merge 1 commit into
mainfrom
fix/root-list-table-shape
Open

fix(cli): align root output shapes#3037
UnArbosFive wants to merge 1 commit into
mainfrom
fix/root-list-table-shape

Conversation

@UnArbosFive

Copy link
Copy Markdown
Contributor

Motivation

btcli root list --coldkey <ss58> crashes in human-output mode with
IndexError: list index out of range. The single-wallet view declares five
columns 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

  • Make root-position rows include the wallet cell only for --all, keeping
    row widths aligned with position_columns(all_wallets).
  • Return one validator summary document from the explicit-hotkey JSON path.
  • Add CLI regressions for single-coldkey and all-wallet root lists, human
    validator details, both root-list row shapes, and single-document JSON output.

Behavioral impact

Human root list output now works for both one coldkey and all wallets. JSON
output for explicit root show --hotkey is 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_version bump is required.

Verification

  • pytest sdk/python/tests/unit/test_cli.py: 37 passed
  • pytest sdk/python/tests: 1,075 passed, 1 skipped
  • Ruff lint and formatting checks pass for all changed files.
  • Coverage audit: 12/12 changed code paths and user flows covered.
  • Audited every Output.table() and Output.columns() call site: no other
    row/header width mismatches found.

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.
@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview Aug 4, 2026 12:45pm

Request Review

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🛡️ 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.

Findings

No findings.

Conclusion

The 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.

Findings

No findings.

Conclusion

The CLI-only fix is minimal, internally consistent, and adequately covered by focused regression tests. No merge-blocking domain issues found.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant