Skip to content

export yaml descriptor as JSON graph - #20

Merged
raiden00pl merged 3 commits into
masterfrom
desc-graph
Jul 10, 2026
Merged

export yaml descriptor as JSON graph#20
raiden00pl merged 3 commits into
masterfrom
desc-graph

Conversation

@raiden00pl

Copy link
Copy Markdown
Member

No description provided.

Add a machine-readable descriptor graph report
(descriptor/reports/graph.py): nodes for IO/PROG/PROTO/SYSTEM objects
(type, dtype, flags, ObjectID, protocol allocation rows) and edges for
program inputs/outputs/reset, protocol bindings, and schema-declared
object references (targets, objid_ref, control/data/target fields via
ConfigField.value_type). Objects that fail typed decoding stay visible
as generic invalid nodes, and dangling references are flagged
unresolved, so consumers can always render the full graph. Multi
descriptor specs (descriptorN) are supported.

Expose it as the desc-graph CLI command and add a --json flag to
desc-valid for machine-readable validation output. This is the
foundation for the Dawn Workbench backend.
When an IO variant forces a dtype (e.g. sysinfo 'uptime' is always
uint64), the firmware's ObjectID uses that dtype regardless of what
the descriptor's 'dtype:' field declares. ClientIo previously exposed
the declared dtype, so a descriptor that declared a conflicting dtype
(e.g. uptime as float) made client tools decode device bytes with the
wrong format and produce garbage values.

Resolve the variant-forced dtype when building ClientIo so client
tools decode by the dtype the device actually uses. Scoped to the
client view; generation/encoding are untouched.
The nimble handler declared no bindings, so a nimble ProtocolObject
carried an empty bindings list: the descriptor graph drew no
protocol_binding edges (the protocol node floated unconnected) and the
allocation summary showed no bound IOs. Unlike modbus/can, nimble keeps
its IO references nested in config.services (bas.battery_level,
aios.groups[].{digital,analog}_{inputs,outputs}, ess/imds
characteristics, ots.objects, and custom services'
characteristics[].io) rather than a flat bindings list.

Add a module-level resolve_bindings that walks every service shape and
returns the referenced IO ids, ordered and de-duplicated, so
ProtocolObject.from_spec populates bindings and the existing
graph/summary machinery binds them like any other protocol.
@raiden00pl
raiden00pl merged commit 7b64175 into master Jul 10, 2026
3 checks passed
@raiden00pl
raiden00pl deleted the desc-graph branch July 10, 2026 15:10
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