Expand description
Level descriptors + the semantics dictionaries that let the core handle
unknown kinds/keys without hardcoding their names, and let the UI render any
language/metric set purely from data: edge kinds (EdgeKindSpec),
node/edge attributes (AttributeSpec, grouped via AttributeGroup),
node kinds (NodeKindSpec) and cycle kinds (CycleKindSpec).
The dictionaries are maps keyed by the kind/attribute/group name; the spec value holds only the remaining metadata.
Structs§
- Attribute
Group - A named group of attributes (UI section). Keyed by group name in
Level::attribute_groups; attributes reference it viaAttributeSpec::group. Metadata only — storage stays flat. - Attribute
Spec - Describes one attribute key (on a node or an edge). Everything the UI needs to label, explain, format, compute and threshold the metric — so the viewer hardcodes no metric by name.
- Cycle
Kind Spec - Label + description of one cycle kind (
"mutual"/"chain"). - Edge
Kind Spec - Semantics of one edge kind. Keyed by the edge
kindinLevel::edge_kinds.flowis the single source of truth for “is this information flow”: counted in coupling/cycles AND drawn whentrue; structural (e.g.contains) and excluded/hidden whenfalse. - Grouping
- How the viewer should cluster nodes in the diagram. Exactly one of
key(group by the value of a node attribute, e.g.crate) orfunction(a named grouper the viewer implements, e.g.dir— derive the folder from the path). Absent → the viewer falls back to its defaultdirgrouper. - Level
- An analysis level the plugin can produce, with the semantics needed to score
and draw it. The orchestrator merges in centrally-computed attribute specs
and the computed
uiblock before writing the snapshot. - Node
Kind Spec - Visual + label semantics of one node kind (
"file"/"external"/ …). Keyed by kind inLevel::node_kinds. - Thresholds
- Two-tier per-metric thresholds (at/under
infois fine; abovewarningis likely a problem). Carried on anAttributeSpec; produced by a plugin (language-calibrated), absent when a metric has no calibration.