Skip to main content

Crate corpora_rules

Crate corpora_rules 

Source
Expand description

Plugin seam #1 — self-validation. A Rule is pure &Graph -> diagnostics; RuleRunner fires the registered pack on every GraphBuilt.

Re-exports§

pub use e3::E3;
pub use gate_b::GateB;
pub use held::HeldDecision;
pub use positional::PositionalRef;
pub use schema::Schema;
pub use supersession::SupersessionIntegrity;

Modules§

e3
E3 — don’t depend on stale canon. With the schema-v0 refinement: a typed edge to a superseded atom is an error; a bare prose mention is only a warning.
gate_b
Gate B — every pinned code_revision must resolve in the repository. The git lookup is injected via a RevisionOracle, so the rule stays pure-testable. It distinguishes an intentional no-op and a repo-less corpus (skip) from a real misconfiguration such as a missing git binary, which is surfaced as a warning instead of failing open silently.
held
Held-detection — makes “forgotten” machine-detectable (schema-v0 §6). An accepted decision with no implementation and no realized_by is unscheduled debt.
positional
Flags brittle positional § references in normative records. The corpus favours stable ids over section numbers, which drift whenever a document is reorganised.
schema
Schema-table validator: kind↔authority for every record, and status↔lifecycle for decisions. Field presence/types are enforced earlier by the parser; this rule covers the cross-field semantic consistency that only makes sense on a built record.
supersession
Pairs each record’s declared lifecycle with the supersession state the graph resolved: a superseded lifecycle must actually have a successor, and a record that is superseded must declare it. Catches lifecycle drift the graph build can’t (it only sees edges, not the lifecycle field).

Structs§

RuleRunner

Traits§

Rule

Functions§

default_rules
The default rule pack. GateB needs a RevisionOracle (git); pass a NullOracle to run the pure rules without VCS context.