Skip to content

fix(cli): render full-fidelity values for cluster read/subscribe/invoke - #104

Merged
p0fi merged 1 commit into
mainfrom
fix/issue-95-read-table-fidelity
Sep 16, 2026
Merged

p0fi merged 1 commit into
mainfrom
fix/issue-95-read-table-fidelity

Conversation

@p0fi

@p0fi p0fi commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • --format table output for cluster read, subscribe, and invoke now renders decoded TLV values at full fidelity: struct fields and array elements are never elided, and scalar leaves (long strings, byte-array hex dumps) are never middle-truncated.
  • Introduces tlvFidelity (fidelityCompact / fidelityFull), threaded explicitly through formatAttrValue → decodeTLVValue → formatTLVElement → formatTLVContainer → truncateMiddle and buildReadRecords, so the elision/truncation policy is an explicit per-consumer choice instead of one shared 40-character budget.
  • tree -L 4's per-attribute preview keeps today's compact, elided rendering unchanged — it's the one remaining consumer that opts into fidelityCompact.
  • --format json/--format yaml output is unaffected; it already rendered the untruncated native Value.

Test plan

  • TestDecodeTLVValue_Containers extended to run existing cases (short array, struct) under both fidelities, plus new cases: long array (compact truncates / full shows everything), array-of-structs (compact elides fields / full shows every field), wide struct >40 chars (compact elides / full shows every field), and long scalar leaves — string and byte-array (compact middle-truncates / full prints in full).
  • TestBuildReadRecords_TruncationIsDisplayOnly split into compact/full subtests; both still assert Value is always the untruncated native original.
  • mise run test — full suite passes.
  • mise run lint — clean.
  • Reviewed via /code-review (parallel Standards + Spec sub-agents against issue cluster read table output cuts fields out of long struct values #95): 0 hard standards violations, 0 spec discrepancies.

Fixes #95

🤖 Generated with Claude Code

formatTLVContainer applied the same first/last-element elision to struct
fields that it applied to array elements, so a named attribute the user
explicitly read (e.g. GeneralDiagnostics/NetworkInterfaces) could silently
drop fields like HardwareAddress in --format table output. Introduce a
tlvFidelity parameter (compact vs full) threaded through
formatAttrValue/decodeTLVValue/formatTLVElement/formatTLVContainer and
buildReadRecords: cluster read, subscribe, and invoke now render with no
elision or truncation at any level, while tree -L 4 keeps today's compact,
scannable rendering unchanged.

Fixes #95

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@p0fi p0fi self-assigned this Sep 16, 2026
@p0fi
p0fi requested a balanced review from Copilot September 16, 2026 21:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The fidelity policy is consistently applied, preserves existing tree behavior, and has focused regression coverage.

Pull request overview

Adds explicit TLV display fidelity so targeted CLI operations show complete values while tree previews remain compact.

Changes:

  • Threads compact/full fidelity through TLV formatting.
  • Uses full fidelity for read, subscribe, and invoke; compact fidelity for tree -L 4.
  • Expands tests for containers, nested structures, strings, bytes, and native values.
File summaries
File Description
cli/cluster.go Implements fidelity-aware TLV formatting and updates consumers.
cli/subscribe.go Enables full-fidelity subscription displays.
cli/tree.go Preserves compact tree previews.
cli/output/read.go Documents fidelity-dependent display behavior.
cli/cluster_test.go Tests compact and full TLV formatting.
cli/cluster_read_test.go Tests display fidelity without affecting native values.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@p0fi
p0fi merged commit db5ad61 into main Sep 16, 2026
5 checks passed
@p0fi
p0fi deleted the fix/issue-95-read-table-fidelity branch September 16, 2026 21:53
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.

cluster read table output cuts fields out of long struct values

2 participants