feat(cli): use the wildcard cluster read in tree -L 4 - #97
Conversation
End-to-end verification (matter.js virtual device)Commissioned matter.js's Wall-clock (3 runs each, localhost — negligible RTT so this is a worst-case floor for the win):
~40–45% faster even with near-zero network latency, purely from cutting round-trips per cluster from Output correctness: diffed full
Completion cache write-through: after running |
Replace the per-attribute read loop in treePopulateAttributes with one wildcard read per cluster, collapsing tree -L 4 from 1+N round-trips per cluster to 1. Level 3 keeps the cheap AttributeList-only read since it only needs names. The AttributeList discovered in a level-4 wildcard read's reports still write-throughs into the completion cache; a transport failure fails the whole cluster (TreeCluster.ListErr) while a per-attribute status stays scoped to that attribute, same as before. Closes #89. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
f9e6477 to
ef411c1
Compare
Summary
treePopulateAttributeswith one wildcard attribute read per cluster, collapsingtree -L 4from1 + Nround-trips per cluster to1TreeCluster.ListErr), while a per-attribute status inside a successful wildcard read stays scoped to that one attribute (TreeAttribute.Err)tree -L 4, rather than being filtered to the advertised listCloses #89.
Test plan
mise run test— full suite passesmise run lint— cleancli/attribute_cache_test.gocover: level-3 AttributeList-read path unchanged, level-4 wildcard read populating attrs + caching AttributeList, a failed wildcard read keeping the stale cache and reportingListErr, a per-attribute status inside a successful wildcard read not failing the cluster, and a device omitting AttributeList from its wildcard response leaving the cache untouchedtree -L 4comparison before/after) — not yet run, flagging for manual follow-up