ADR-0010 — Importers may infer; the compiler may not
Import adapters derive tier, mode, and links from source artifacts and emit them as explicit, provenance-tagged declarations. The compiler keeps the never-infer rule.
Status: proposed
Import adapters (packages/ingest) may derive topology attributes from source artifacts, but must emit them as explicit declarations. The compiler continues to classify layout strictly from declared structure without inference.
Why
ADR-0001 bans inferring meaning from names. The compiler classifies layout only from declared tier, zone, and ha_pair_with.
Import adapters (Cisco IOS CLI output, .pcapng, NetBox, containerlab, GNS3, draw.io) must parse configuration evidence into topology semantics:
switchport mode trunkandswitchport trunk allowed vlan 10,20map tomode: trunkandvlans: "10,20".- Inter-switch links sharing a common
/30or/31subnet map tomode: routed.
These derivations come from configuration state rather than name guessing. However, some assignments remain heuristic (such as inferring tier: core from high-density routed trunks). Moving inference into the compiler would violate ADR-0001 and make layout errors untraceable in source YAML.
Decision
- Import adapters derive schema attributes from source files.
- Every derived value is written to YAML as an explicit declaration (
tier: core). - Derived values carry provenance via
x-sourceannotations indicating the source file, line number, and parser rule. - Derivations are classified into two categories:
- Evidence-based: Direct configuration readings (
channel-group, switchport modes, LLDP TLVs). Emitted without diagnostics. - Heuristic: Structural assumptions (inferred tier). Emitted with an advisory diagnostic (
MRW-Irange) requesting review.
- Evidence-based: Direct configuration readings (
- Name-based guessing (
core-*prefix) remains prohibited in both importers and the compiler.
Consequences
- Positive: Imported topologies compile into valid archetypes on first build without manual intervention.
- Positive: Incorrect values point to exact source configuration lines and are easily overridden in overlay files.
- Positive: Compiler determinism and ADR-0001 remain intact.
- Negative: Discovered YAML files include
x-sourcemetadata. - Negative: Importer heuristic rules require formal test fixtures to prevent parsing regressions.
Considered and rejected
- Inference in the compiler core. Rejected: violates ADR-0001 and breaks byte-level build reproducibility.
- Zero importer inference. Rejected: imported files would produce unranked layered layouts until every device is manually annotated.