Skip to main content

check_section_heading_roundtrip

Function check_section_heading_roundtrip 

Source
pub fn check_section_heading_roundtrip(
    schema: &Schema,
) -> Result<(), SchemaLoadError>
Expand description

Refuse a schema in which any declared section’s heading does not derive back to that section’s declared key. Collects every offending (type, key, heading, derived_key) tuple — a schema with one good and one bad section is refused whole, and the author sees the complete list in one round.

Installation-path gate only: callers are the schema-authoring surfaces (CLI schema validate / schema install, the engine’s install_schema primitive). Boot and sealed-schema loads must NOT call this — a schema already sealed on __MEMSTEAD that violates the rule keeps loading, and the violation surfaces as a health finding, never as a boot failure.