ADR-0016 — Extensible metadata and inspector sections
Add custom fields and collapsible drawer sections for devices and links, enabling structured metadata display and interactive link inspection.
Status: accepted
Devices and links previously supported only a fixed set of metadata fields (role, status, mgmt_ip, interfaces, note, config), and links lacked dedicated inspection drawers. Marrow now provides extensible custom_fields and sections across devices and links, accompanied by clickable edge inspection in the SVG viewer.
Why
Enterprise topologies require domain-specific operational data such as serial numbers, asset tags, BGP peering tables, interface status matrices, and link metrics. Authors previously had to append unstructured text into the note field or use private x- annotations that were ignored by the runtime.
Adding first-class schema keys for every CMDB attribute (such as serial_number, model, firmware, bgp_as) was considered and rejected. Hardware attributes vary widely across network operating systems, and expanding the core schema creates endless schema churn.
Unstructured markdown inside note: was also rejected. Parsing structured facts or tabular data from free text proved brittle and made searching difficult.
The schema now defines custom_fields as a key-value record of primitive types (string, number, boolean) rendered as an inspector definition list (<dl class="m-facts">). sections accepts records mapping section names to key-value facts, arrays of row objects (rendered as auto-formatted HTML tables <table class="m-table">), or markdown strings. Furthermore, SVG edge elements are interactive and clickable, opening a dedicated link inspector drawer with endpoint ports, link mode, physical medium, custom fields, and sections.
Consequences
Structured domain data. Devices and links carry structured enterprise inventory facts and operational tables directly in the self-contained HTML artifact.
Interactive link inspection. Clicking any cable or aggregated bundle opens a dedicated drawer showing link facts, notes, custom fields, and sections without needing to navigate to adjacent device drawers.
Collapsible organization. Multiple operational sections organize neatly into native collapsible <details class="m-inspector-section" open> elements.
Considered and rejected
Proliferation of dedicated schema keys. Rejected because enterprise CMDB schemas diverge widely, and adding specialized keys bloats the core compiler schema.
Unstructured markdown blocks in note:. Rejected because unstructured text lacks reliable tabular rendering and definition list formatting in the inspector drawer.