Skip to main content

Module schema

Module schema 

Source
Expand description

Schema metadata, relation registry, CI validator and ER export. Spec: docs/superpowers/specs/26-06-11-armdb-schema-metadata.md

Structs§

AmbiguousRef
BuiltRegistry
Registry after a successful consistency check.
CounterRepairStats
Per-counter repair counters — one row per declared (collection, field) counter target actually compared. A target declined because its source had undecodable rows (see RepairReport::undecodable_sources) contributes no row here — nothing was compared for it.
FkLabel
Display label for an FK edge in the graph/report (not extraction — closures do that).
IndexRepairStats
Per-index repair counters.
MermaidEr
NamespaceConflict
One namespace key repair_namespaces refused to write to, because more than one live claimant disagreed about who owns it — either two or more declared claimants, or one declared claimant against the row’s actual (foreign) owner. Mirrors Finding::UniqueConflict’s shape exactly.
NamespaceRepairStats
Per-namespace repair counters (T10 Task 10) — see the module doc for what drives each field. Mirrors super::IndexRepairStats in shape.
RepairOptions
Options for repair.
RepairReport
Aggregate result of repair.
SchemaRegistry
UndecodableSource
A source collection whose scan skipped rows it could not read or decode.
ValidationReport

Enums§

AmbiguityReason
CollectionKind
Re-exported so building a registry and matching on a finding need no direct armour_core dependency: CollectionKind / OnMissing are arguments of register / fk, and RowPart / PathSeg are payload of DanglingFk and AmbiguousRef.
Finding
OnMissing
Re-exported so building a registry and matching on a finding need no direct armour_core dependency: CollectionKind / OnMissing are arguments of register / fk, and RowPart / PathSeg are payload of DanglingFk and AmbiguousRef.
PathSeg
Re-exported so building a registry and matching on a finding need no direct armour_core dependency: CollectionKind / OnMissing are arguments of register / fk, and RowPart / PathSeg are payload of DanglingFk and AmbiguousRef. One segment of a field path inside a stored type.
RefDesc
RegistryBuildError
Registry consistency error reported by SchemaRegistry::finish.
RowPart
Re-exported so building a registry and matching on a finding need no direct armour_core dependency: CollectionKind / OnMissing are arguments of register / fk, and RowPart / PathSeg are payload of DanglingFk and AmbiguousRef. Which part of a row a composite reference targets.

Traits§

IndexTarget
Write/delete in an index collection from a generated hook.
SchemaCollection
Typed collection access for the schema registry and validator. Each impl knows how to scan and check key presence.
SchemaFormatter
Text formatter for a schema graph. Model → formatter architecture: DOT can be added as a second implementation without changing the model.

Functions§

repair
Apply the same scan as validate and fix index drift: put missing rows, rewrite mismatches, optionally delete orphans on complete targets. Also fixes counter drift (Decl::Counter targets): resolves each declared counter to its expected absolute value via [super::expected::build_counters] — the same shared pass validate reads — and applies the difference through [crate::counter::ErasedCounterTarget::apply_delta].
validate