ADR-0011 — Discovered and overlay files
A machine-owned discovered file is regenerated from network sources; a human-owned overlay extends it by device ID. Re-importing preserves human edits.
Status: proposed
Marrow separates network discovery into two layers: a machine-owned base file (<name>.discovered.yaml) regenerated from hardware configs, and a human-owned overlay file (<name>.yaml) that extends it using extends:.
Why
Network diagrams decay under two distinct operational pressures:
- Manual diagrams rot: Engineers fail to update visual layouts following maintenance windows.
- Automated diagrams lose business context: Re-running automated discovery overwrites human annotations (
tier,zone, operational notes, and maintenance histories).
Import adapters (ADR-0010) exacerbate this loss: re-running discovery would overwrite every manual edit previously made to the topology.
Decision
marrow importwrites exclusively to<name>.discovered.yaml. This file is machine-owned and regenerated wholesale without manual preservation.- The schema supports an optional root key,
extends: <path>, allowing human-authored files to reference and layer over discovered files. - Merge rules evaluate by
idfor devices and zones, and by endpoint pairs pluslagfor links:- Overlays may append new devices, zones, and links.
- Overlays may override any discovered property (e.g., custom
tierorzone). - Discovered elements are hidden explicitly using
x-hide: true. - Overlay definitions that reference non-existent base IDs raise validation errors.
extendsoperates at a single depth: discovered files cannot extend other files.validate --jsonsurfaces all active overrides for auditing.
Consequences
- Positive: CI/CD pipelines can regenerate discovered topologies from config backups (RANCID, Oxidized) without destroying human documentation.
- Positive: Human-owned overlay files remain concise, containing only organizational context.
- Negative: Schema validation and error reporting must track source provenance across multiple physical files.
- Negative: Re-cabled ports change endpoint identities, requiring corresponding updates in overlay link references.
Considered and rejected
- Three-way in-place file merges. Rejected: merge conflicts corrupt YAML syntax and require manual conflict resolution.
- In-place round-tripping. Rejected: preserving comments, custom formatting, and deletions inside automated output introduces brittle state management.