Skip to main content

wellfare_core/anatomy/
registry.rs

1//! The **body-system registry** — an extensible, provenance-tagged taxonomy of body systems.
2//!
3//! The 17 systems in [`super::systems::BODY_SYSTEMS`] are a *seed*, not a closed universe: a person, a
4//! jurisdiction/curation pack, or a linked-data ontology (e.g. a UBERON anatomical-system class) can
5//! **register more** — the fascial system, the interstitium, the microbiome — and have them evaluated
6//! and rendered as first-class systems, not silently dropped. This is the "software provides the MEANS,
7//! not the definitions" principle applied to the anatomy taxonomy: we ship a seed and the machinery;
8//! *what counts as a body system* is extensible by the person / their trusted sources.
9//!
10//! The accumulation engine ([`super::accumulate`]) is already generic over an arbitrary `system_id`;
11//! this registry is what makes a *new* system **first-class** — carrying a human label, an
12//! accessibility-first plain-language label, how it is rendered (discrete organs vs a distributed
13//! overlay), its overlay host systems, a default identity colour, and **where its definition came
14//! from** ([`SystemProvenance`]). Presentation, colour, and knowledge import resolve through the
15//! registry, so a registered extension is labelled, coloured, represented, and importable exactly like
16//! a seeded system.
17//!
18//! `default_registry()` is the built-in seed (the 17). An app that has extensions builds its own
19//! registry (seed + registered systems) — from a `.q42`/ontology pack once the disease↔organ source is
20//! chosen — and threads it where completeness matters (knowledge import, the UI system list).
21
22use std::sync::OnceLock;
23
24use serde::{Deserialize, Serialize};
25
26use super::model::{SystemRepresentation, overlay_host_systems, system_representation};
27use super::systems::BODY_SYSTEMS;
28
29/// The neutral render colour for a system with no seeded/registered colour (linear RGBA). A person's
30/// σ-derived burden colour overrides this at runtime; this is only the default identity swatch.
31pub const NEUTRAL_SYSTEM_RGBA: [f32; 4] = [0.62, 0.66, 0.72, 1.0];
32
33/// Where a body-system *definition* came from — so an auditor (and the person) can see whether a system
34/// is a built-in seed, curated, ontology-derived, or self-declared. Additions are transparent, never
35/// silent (the same honesty stance as the knowledge base's source provenance).
36#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
37#[serde(rename_all = "snake_case", tag = "kind")]
38pub enum SystemProvenance {
39    /// One of the built-in seeded systems (the 17 in [`BODY_SYSTEMS`]).
40    Seed,
41    /// Registered from a linked-data ontology — e.g. a UBERON anatomical-system class IRI. This is the
42    /// "graph-fed" path: the disease↔organ ontology defines additional systems.
43    Ontology { iri: String },
44    /// Registered from a curation / knowledge pack.
45    Pack { source_id: String },
46    /// Declared by the person themselves.
47    User,
48}
49
50/// Where a system sits in the anatomy hierarchy. The body is classically divided into **11 major organ
51/// systems**; finer/emerging systems are taught as sub-branches of a major, and some are body-wide
52/// networks that cut across majors. Marking this keeps the canonical framing honest while the registry
53/// stays open.
54#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
55#[serde(rename_all = "snake_case")]
56pub enum SystemTier {
57    /// One of the 11 canonical major organ systems.
58    CanonicalMajor,
59    /// A finer system taught as a sub-branch of a major (sensory / vestibular / ENS / glymphatic → nervous).
60    SubSystem,
61    /// A body-wide signalling / gland network that cuts across the majors (ECS, exocrine).
62    CrossCutting,
63}
64
65/// How one system functionally relates to another. **Structural context only — this does NOT propagate
66/// burden.** An adverse load on one system does not automatically imply load on a related one; the link
67/// explains *how the systems depend on / act upon each other*, for the person's understanding. (Timothy's
68/// call, 2026-07-11: structural links, no automatic propagation.)
69#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
70#[serde(rename_all = "snake_case")]
71pub enum SystemRelationKind {
72    /// This system requires another to function (muscular **depends on** nervous for the contraction signal).
73    DependsOn,
74    /// This system governs / modulates another (endocrine **regulates** reproductive via sex hormones).
75    Regulates,
76    /// This system provides a resource to another (respiratory **supplies** circulatory with oxygen).
77    Supplies,
78}
79
80/// A structural link from one system to another, with a plain-language reason. Curation-grade seed
81/// (well-established relationships), extensible via the same registry mechanism.
82#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
83pub struct SystemRelation {
84    pub kind: SystemRelationKind,
85    /// The target system id.
86    pub target: String,
87    /// Plain-language reason ("motor control — contraction is signalled by motor nerves").
88    pub note: String,
89}
90
91/// A first-class body system: identity, human + plain-language labels, how it renders, its overlay
92/// hosts (for a distributed system), a default colour, its place in the hierarchy, its structural links
93/// to other systems, and its provenance.
94#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
95pub struct SystemDef {
96    /// Stable id (e.g. `"circulatory"`, `"fascial"`). The join key across the engine, meshes, and data.
97    pub id: String,
98    /// Clinical / general human label (`"Circulatory (Cardiovascular) System"`).
99    pub label: String,
100    /// Accessibility-first, plain-language wording (`"heart and blood flow"`) — never diagnostic.
101    pub plain_label: String,
102    /// Whether the system has characteristic organ meshes to paint, or is a distributed network shown
103    /// as an overlay on its host structures.
104    pub representation: SystemRepresentation,
105    /// For a [`SystemRepresentation::DistributedOverlay`] system, the system ids whose organ meshes it is
106    /// highlighted over (empty = a whole-body cue). Empty for discrete-organ systems.
107    pub overlay_hosts: Vec<String>,
108    /// Default identity colour (linear RGBA); the person's burden σ overrides it at runtime.
109    pub color_rgba: [f32; 4],
110    /// The system's tier in the hierarchy (canonical major / sub-system / cross-cutting).
111    pub tier: SystemTier,
112    /// The parent (major) system this is a sub-branch of, if any (sensory → nervous). `None` for majors
113    /// and cross-cutting networks.
114    pub parent: Option<String>,
115    /// Structural links to other systems — how this system depends on / regulates / supplies them.
116    /// Context for understanding, **not** burden propagation.
117    pub relations: Vec<SystemRelation>,
118    /// Where this system definition came from.
119    pub provenance: SystemProvenance,
120}
121
122impl SystemDef {
123    /// Whether this system is rendered as a distributed overlay (no standalone organ mesh).
124    pub fn is_overlay(&self) -> bool {
125        self.representation == SystemRepresentation::DistributedOverlay
126    }
127
128    /// Whether this is one of the 11 canonical major organ systems.
129    pub fn is_canonical_major(&self) -> bool {
130        self.tier == SystemTier::CanonicalMajor
131    }
132}
133
134/// An extensible set of [`SystemDef`]s. Seeded with the 17 built-in systems; `register` adds/refines
135/// more. Lookups are by id (and by human label, for importing label-keyed knowledge files). Cloneable
136/// and serialisable so an app can persist / ship an extended taxonomy.
137#[derive(Debug, Clone, Default, Serialize, Deserialize)]
138pub struct SystemRegistry {
139    systems: Vec<SystemDef>,
140}
141
142impl SystemRegistry {
143    /// An empty registry (no systems). Use [`SystemRegistry::seed`] for the built-in 17.
144    pub fn new_empty() -> Self {
145        Self {
146            systems: Vec::new(),
147        }
148    }
149
150    /// The built-in seed: the 17 systems from [`BODY_SYSTEMS`], each enriched with its representation
151    /// and overlay hosts (from `super::model`) and a default identity colour. Provenance = `Seed`.
152    pub fn seed() -> Self {
153        let systems = BODY_SYSTEMS
154            .iter()
155            .map(|s| SystemDef {
156                id: s.id.to_string(),
157                label: s.label.to_string(),
158                plain_label: s.plain_label.to_string(),
159                representation: system_representation(s.id),
160                overlay_hosts: overlay_host_systems(s.id)
161                    .iter()
162                    .map(|h| h.to_string())
163                    .collect(),
164                color_rgba: seed_color_rgba(s.id),
165                tier: seed_tier(s.id),
166                parent: seed_parent(s.id).map(str::to_string),
167                relations: seed_relations(s.id),
168                provenance: SystemProvenance::Seed,
169            })
170            .collect();
171        Self { systems }
172    }
173
174    /// Register (or **refine**) a system. If a system with the same id already exists it is replaced —
175    /// a later, more-authoritative definition (e.g. an ontology pack) may correct a seed's label/colour.
176    /// Returns `&mut Self` for chaining.
177    pub fn register(&mut self, def: SystemDef) -> &mut Self {
178        if let Some(existing) = self.systems.iter_mut().find(|s| s.id == def.id) {
179            *existing = def;
180        } else {
181            self.systems.push(def);
182        }
183        self
184    }
185
186    /// Look up a system by id.
187    pub fn get(&self, id: &str) -> Option<&SystemDef> {
188        let want = id.trim();
189        self.systems.iter().find(|s| s.id == want)
190    }
191
192    /// Whether a system id is registered.
193    pub fn contains(&self, id: &str) -> bool {
194        self.get(id).is_some()
195    }
196
197    /// Look up a system by its human label (case-insensitive, trimmed) — for importing label-keyed
198    /// knowledge files (e.g. `condition-map.json` keys systems by `"Endocrine System"`).
199    pub fn get_by_label(&self, label: &str) -> Option<&SystemDef> {
200        let want = label.trim().to_ascii_lowercase();
201        self.systems
202            .iter()
203            .find(|s| s.label.to_ascii_lowercase() == want)
204    }
205
206    /// All registered systems, in registration order (the 17 seed order first).
207    pub fn all(&self) -> &[SystemDef] {
208        &self.systems
209    }
210
211    /// The registered ids, in order.
212    pub fn ids(&self) -> impl Iterator<Item = &str> {
213        self.systems.iter().map(|s| s.id.as_str())
214    }
215
216    /// Length.
217    pub fn len(&self) -> usize {
218        self.systems.len()
219    }
220
221    ///  when empty.
222    pub fn is_empty(&self) -> bool {
223        self.systems.is_empty()
224    }
225
226    /// The human label for a system id, or the id itself if unregistered (so nothing renders blank).
227    pub fn label_for(&self, id: &str) -> String {
228        self.get(id)
229            .map(|s| s.label.clone())
230            .unwrap_or_else(|| id.to_string())
231    }
232
233    /// The plain-language label for a system id, or the id itself if unregistered.
234    pub fn plain_label_for(&self, id: &str) -> String {
235        self.get(id)
236            .map(|s| s.plain_label.clone())
237            .unwrap_or_else(|| id.to_string())
238    }
239
240    /// How a system is rendered — defaults to [`SystemRepresentation::DiscreteOrgans`] for an
241    /// unregistered id (the safe default: try to paint an organ mesh if one turns up).
242    pub fn representation_of(&self, id: &str) -> SystemRepresentation {
243        self.get(id)
244            .map(|s| s.representation)
245            .unwrap_or(SystemRepresentation::DiscreteOrgans)
246    }
247
248    /// The overlay host system ids for a distributed system (empty for discrete or unregistered).
249    pub fn overlay_hosts_of(&self, id: &str) -> &[String] {
250        self.get(id)
251            .map(|s| s.overlay_hosts.as_slice())
252            .unwrap_or(&[])
253    }
254
255    /// The default identity colour for a system id, or [`NEUTRAL_SYSTEM_RGBA`] if unregistered.
256    pub fn color_of(&self, id: &str) -> [f32; 4] {
257        self.get(id)
258            .map(|s| s.color_rgba)
259            .unwrap_or(NEUTRAL_SYSTEM_RGBA)
260    }
261
262    /// The canonical major organ systems (the classic 11 in the seed).
263    pub fn canonical_majors(&self) -> impl Iterator<Item = &SystemDef> {
264        self.systems
265            .iter()
266            .filter(|s| s.tier == SystemTier::CanonicalMajor)
267    }
268
269    /// The direct sub-systems of `parent_id` (e.g. `nervous` → sensory / vestibular / ENS / glymphatic).
270    pub fn sub_systems_of(&self, parent_id: &str) -> impl Iterator<Item = &SystemDef> {
271        let want = parent_id.trim().to_string();
272        self.systems
273            .iter()
274            .filter(move |s| s.parent.as_deref() == Some(want.as_str()))
275    }
276
277    /// A system's structural links to other systems (empty for unregistered or unlinked systems).
278    pub fn relations_of(&self, id: &str) -> &[SystemRelation] {
279        self.get(id).map(|s| s.relations.as_slice()).unwrap_or(&[])
280    }
281}
282
283/// The built-in default registry — the 17 seeded systems. Callers with extensions build their own
284/// (`SystemRegistry::seed()` then `register(...)`, or loaded from a `.q42`/ontology pack).
285pub fn default_registry() -> &'static SystemRegistry {
286    static DEFAULT: OnceLock<SystemRegistry> = OnceLock::new();
287    DEFAULT.get_or_init(SystemRegistry::seed)
288}
289
290/// The seeded default identity colour for a built-in system id (linear RGBA). Distinct hues per family
291/// so systems read apart at a glance; the person's σ burden colour overrides this at runtime. Kept here
292/// as the single source of truth for the shipped palette (the asset-pack producer resolves through it).
293fn seed_color_rgba(id: &str) -> [f32; 4] {
294    match id {
295        "circulatory" => [0.80, 0.28, 0.28, 1.0],
296        "respiratory" => [0.58, 0.72, 0.90, 1.0],
297        "digestive" => [0.82, 0.62, 0.40, 1.0],
298        "urinary" => [0.78, 0.74, 0.42, 1.0],
299        "nervous" | "ens" | "glymphatic" => [0.90, 0.86, 0.72, 1.0],
300        "reproductive" => [0.82, 0.60, 0.70, 1.0],
301        "immune_lymphatic" => [0.60, 0.82, 0.70, 1.0],
302        "endocrine" | "exocrine" | "ecs" => [0.72, 0.60, 0.82, 1.0],
303        "muscular" => [0.80, 0.45, 0.40, 1.0],
304        "skeletal" => [0.90, 0.87, 0.80, 1.0],
305        "integumentary" => [0.90, 0.76, 0.66, 1.0],
306        "sensory" | "vestibular" => [0.55, 0.80, 0.82, 1.0],
307        _ => NEUTRAL_SYSTEM_RGBA,
308    }
309}
310
311/// The hierarchy tier of a seeded system: the classic 11 are canonical majors; sensory / vestibular /
312/// ENS / glymphatic are sub-branches of the nervous system; ECS + exocrine are body-wide cross-cutting
313/// networks.
314pub(crate) fn seed_tier(id: &str) -> SystemTier {
315    match id {
316        "sensory" | "vestibular" | "ens" | "glymphatic" => SystemTier::SubSystem,
317        "ecs" | "exocrine" => SystemTier::CrossCutting,
318        _ => SystemTier::CanonicalMajor, // the 11 classic majors
319    }
320}
321
322/// The parent major system for a seeded sub-system (the finer nervous sub-branches parent to `nervous`).
323fn seed_parent(id: &str) -> Option<&'static str> {
324    match id {
325        "sensory" | "vestibular" | "ens" | "glymphatic" => Some("nervous"),
326        _ => None,
327    }
328}
329
330/// The seeded structural links a system has to others — curation-grade, well-established relationships
331/// (the systems do not operate in isolation). Context only; NOT burden propagation.
332fn seed_relations(id: &str) -> Vec<SystemRelation> {
333    use SystemRelationKind::{DependsOn, Regulates, Supplies};
334    let rel = |kind, target: &str, note: &str| SystemRelation {
335        kind,
336        target: target.to_string(),
337        note: note.to_string(),
338    };
339    match id {
340        "muscular" => vec![rel(
341            DependsOn,
342            "nervous",
343            "motor control — contraction is signalled by motor nerves",
344        )],
345        "skeletal" => vec![rel(
346            DependsOn,
347            "circulatory",
348            "calcium/mineral exchange and red-marrow perfusion",
349        )],
350        "nervous" => vec![rel(
351            DependsOn,
352            "circulatory",
353            "highly perfusion-dependent — needs constant oxygen + glucose",
354        )],
355        "respiratory" => vec![rel(
356            Supplies,
357            "circulatory",
358            "oxygenates the blood and clears carbon dioxide",
359        )],
360        "endocrine" => vec![rel(
361            Regulates,
362            "reproductive",
363            "sex hormones drive reproductive function",
364        )],
365        "urinary" => vec![rel(
366            Regulates,
367            "circulatory",
368            "fluid/electrolyte balance and blood pressure (RAAS)",
369        )],
370        _ => Vec::new(),
371    }
372}
373
374#[cfg(test)]
375mod tests {
376    use super::*;
377
378    #[test]
379    fn seed_has_the_seventeen_first_class() {
380        let reg = SystemRegistry::seed();
381        assert_eq!(reg.len(), 17);
382        // Every seeded system resolves to a non-empty label + plain label, and carries Seed provenance.
383        for s in reg.all() {
384            assert!(
385                !s.label.is_empty() && !s.plain_label.is_empty(),
386                "{} labelled",
387                s.id
388            );
389            assert_eq!(s.provenance, SystemProvenance::Seed);
390        }
391        // Representation + overlay hosts agree with the model's free functions (single source: seeded
392        // from them).
393        let ecs = reg.get("ecs").unwrap();
394        assert!(ecs.is_overlay());
395        assert!(ecs.overlay_hosts.is_empty(), "ECS is a whole-body cue");
396        assert_eq!(
397            reg.get("ens").unwrap().overlay_hosts,
398            vec!["digestive".to_string()]
399        );
400        assert_eq!(
401            reg.representation_of("circulatory"),
402            SystemRepresentation::DiscreteOrgans
403        );
404    }
405
406    #[test]
407    fn hierarchy_and_structural_links_are_seeded() {
408        let reg = SystemRegistry::seed();
409        // The classic 11 canonical major organ systems.
410        assert_eq!(reg.canonical_majors().count(), 11);
411        assert!(reg.get("circulatory").unwrap().is_canonical_major());
412        assert!(!reg.get("sensory").unwrap().is_canonical_major());
413        // The finer systems parent to the nervous system (sub-branches).
414        let nervous_subs: Vec<&str> = reg
415            .sub_systems_of("nervous")
416            .map(|s| s.id.as_str())
417            .collect();
418        for s in ["sensory", "vestibular", "ens", "glymphatic"] {
419            assert!(
420                nervous_subs.contains(&s),
421                "{s} should be a sub-system of nervous: {nervous_subs:?}"
422            );
423        }
424        // ECS + exocrine are cross-cutting networks (no parent, not a major).
425        assert_eq!(reg.get("ecs").unwrap().tier, SystemTier::CrossCutting);
426        assert!(reg.get("ecs").unwrap().parent.is_none());
427        // Structural interdependence (context, not burden propagation): Timothy's two examples.
428        let mus = reg.relations_of("muscular");
429        assert_eq!(mus.len(), 1);
430        assert_eq!(mus[0].kind, SystemRelationKind::DependsOn);
431        assert_eq!(mus[0].target, "nervous");
432        assert!(
433            !mus[0].note.is_empty(),
434            "the link carries a plain-language reason"
435        );
436        assert!(
437            reg.relations_of("skeletal")
438                .iter()
439                .any(|r| r.target == "circulatory"),
440            "skeletal depends on circulatory (calcium)"
441        );
442    }
443
444    #[test]
445    fn default_registry_is_the_seed() {
446        assert_eq!(default_registry().len(), 17);
447        assert_eq!(
448            default_registry().label_for("digestive"),
449            "Digestive System"
450        );
451        assert_eq!(
452            default_registry().plain_label_for("nervous"),
453            "brain and nerves"
454        );
455        // An unregistered system does not render blank — it falls back to its id + safe defaults.
456        assert_eq!(default_registry().label_for("fascial"), "fascial");
457        assert_eq!(
458            default_registry().representation_of("fascial"),
459            SystemRepresentation::DiscreteOrgans
460        );
461        assert_eq!(default_registry().color_of("fascial"), NEUTRAL_SYSTEM_RGBA);
462    }
463
464    #[test]
465    fn colours_are_the_single_source_of_truth_for_the_palette() {
466        let reg = default_registry();
467        // The values the asset-pack producer's palette used to hardcode now live here.
468        assert_eq!(reg.color_of("circulatory"), [0.80, 0.28, 0.28, 1.0]);
469        assert_eq!(reg.color_of("immune_lymphatic"), [0.60, 0.82, 0.70, 1.0]);
470        // Every seeded system has a non-neutral identity colour.
471        for s in reg.all() {
472            assert_ne!(
473                reg.color_of(&s.id),
474                NEUTRAL_SYSTEM_RGBA,
475                "{} needs a colour",
476                s.id
477            );
478        }
479    }
480
481    #[test]
482    fn a_registered_extension_is_first_class() {
483        // "There should be more": register an 18th system (the fascial system) and confirm it is
484        // evaluated-ready and fully presentable — label, plain label, representation, overlay, colour —
485        // exactly like a seeded one.
486        let mut reg = SystemRegistry::seed();
487        reg.register(SystemDef {
488            id: "fascial".to_string(),
489            label: "Fascial System".to_string(),
490            plain_label: "connective tissue".to_string(),
491            representation: SystemRepresentation::DistributedOverlay,
492            overlay_hosts: vec!["muscular".to_string(), "skeletal".to_string()],
493            color_rgba: [0.70, 0.78, 0.66, 1.0],
494            tier: SystemTier::CrossCutting,
495            parent: None,
496            relations: vec![SystemRelation {
497                kind: SystemRelationKind::Supplies,
498                target: "muscular".to_string(),
499                note: "force transmission and structural continuity".to_string(),
500            }],
501            provenance: SystemProvenance::Ontology {
502                iri: "http://purl.obolibrary.org/obo/UBERON_0007795".to_string(),
503            },
504        });
505
506        assert_eq!(reg.len(), 18);
507        assert!(reg.contains("fascial"));
508        assert_eq!(reg.label_for("fascial"), "Fascial System");
509        assert_eq!(reg.plain_label_for("fascial"), "connective tissue");
510        assert_eq!(
511            reg.representation_of("fascial"),
512            SystemRepresentation::DistributedOverlay
513        );
514        assert_eq!(
515            reg.overlay_hosts_of("fascial"),
516            &["muscular".to_string(), "skeletal".to_string()]
517        );
518        assert_eq!(reg.color_of("fascial"), [0.70, 0.78, 0.66, 1.0]);
519        // The seeded systems are untouched.
520        assert_eq!(reg.label_for("digestive"), "Digestive System");
521        // Provenance records the ontology source, transparently.
522        assert!(matches!(
523            reg.get("fascial").unwrap().provenance,
524            SystemProvenance::Ontology { .. }
525        ));
526    }
527
528    #[test]
529    fn register_refines_an_existing_system_rather_than_duplicating() {
530        let mut reg = SystemRegistry::seed();
531        let before = reg.len();
532        // A pack refines the digestive system's colour — replaces, does not duplicate.
533        reg.register(SystemDef {
534            id: "digestive".to_string(),
535            label: "Digestive System".to_string(),
536            plain_label: "digestion".to_string(),
537            representation: SystemRepresentation::DiscreteOrgans,
538            overlay_hosts: Vec::new(),
539            color_rgba: [0.10, 0.20, 0.30, 1.0],
540            tier: SystemTier::CanonicalMajor,
541            parent: None,
542            relations: Vec::new(),
543            provenance: SystemProvenance::Pack {
544                source_id: "curator-x".to_string(),
545            },
546        });
547        assert_eq!(reg.len(), before, "refinement does not add a row");
548        assert_eq!(reg.color_of("digestive"), [0.10, 0.20, 0.30, 1.0]);
549        assert!(matches!(
550            reg.get("digestive").unwrap().provenance,
551            SystemProvenance::Pack { .. }
552        ));
553    }
554
555    #[test]
556    fn every_registered_system_is_accounted_for() {
557        // The generalised completeness guarantee: every registered system — seeded OR extension — is
558        // first-class (resolvable label, plain label, representation, colour). Nothing is half-defined.
559        let mut reg = SystemRegistry::seed();
560        reg.register(SystemDef {
561            id: "microbiome".to_string(),
562            label: "Microbiome".to_string(),
563            plain_label: "gut microbes".to_string(),
564            representation: SystemRepresentation::DistributedOverlay,
565            overlay_hosts: vec!["digestive".to_string()],
566            color_rgba: [0.66, 0.72, 0.50, 1.0],
567            tier: SystemTier::CrossCutting,
568            parent: None,
569            relations: Vec::new(),
570            provenance: SystemProvenance::User,
571        });
572        for s in reg.all() {
573            assert!(!reg.label_for(&s.id).is_empty());
574            assert!(!reg.plain_label_for(&s.id).is_empty());
575            // Overlay systems either name hosts or are an intentional whole-body cue (empty) — both valid.
576            let _ = reg.representation_of(&s.id);
577            let _ = reg.color_of(&s.id);
578        }
579    }
580}