Skip to main content

Module validation

Module validation 

Source
Expand description

Validation pipeline types for pack-contributed KG rules (ADR-034).

This module defines the trait surface and supporting types used by packs to contribute domain-specific validation rules. Rules are compiled into the pack binary and collected at boot time via the Pack::VALIDATION_RULES IDs plus runtime rule implementations registered through PackRuntime.

§Two rule shapes

ADR-034 §9a defines two complementary rule shapes:

  • CorpusCheck: whole-corpus rules that receive all entities and edges together. Right for rules that need cross-entity joins (referential integrity, remote resolution, min-edge-density).

  • StreamingRule: per-record rules that evaluate one record at a time. Cheaper for rules that check individual entities or edges without joins (required properties, naming conventions, no-self-loops).

Both shapes return Vec<Violation> per invocation. The validator aggregates them into a ValidationReport.

Structs§

GraphPatch
Opaque graph patch produced by a fix function (ADR-034 §7).
GraphSnapshot
Opaque snapshot of the KG corpus passed to CorpusCheck::check.
ValidationContext
Context passed to all rule implementations.
ValidationReport
Aggregated result of running the full rule pipeline (ADR-034 §5).
ValidationRule
A pack-contributed validation rule (ADR-034 §9).
Violation
A single rule violation produced by a rule implementation (ADR-034 §5).

Enums§

Severity
Severity of a validation finding (ADR-034 §1).

Type Aliases§

FixFn
Optional auto-fix function type (ADR-034 §7).
RuleFn
Whole-corpus check function type (ADR-034 §2, §9a).
RuleId
Stable rule identifier, namespaced by pack: "<pack>/<rule-id>".