pub struct Rule {
pub text: String,
pub enabled: bool,
pub confidence: Option<f64>,
pub based_on_count: Option<u32>,
pub id: Option<String>,
pub sources: Vec<String>,
pub created_at: Option<String>,
pub retired_at: Option<String>,
pub retired_reason: Option<String>,
}Expand description
One rule in a domain’s TOML file.
A rule outlives the pass that wrote it, so it carries its own lineage:
id is what the validation ledger keys on, sources closes the
provenance chain from a live rule back to the reflections it was argued
from (batch-level — the learner’s per-rule attributions would be its own
unverifiable testimony), and created_at is the staleness signal. Every
new field defaults, so rule files written before they existed load
unchanged — the same trick as Reflexion::origin, minus the fail-closed
semantics, because absent lineage on an already-accepted rule is history,
not a threat.
Fields§
§text: String§enabled: bool§confidence: Option<f64>§based_on_count: Option<u32>§id: Option<String>Minted when the rule first enters the store; stable across consolidations that keep the text.
sources: Vec<String>Reflexion ids of the batch that produced (or last rewrote) this rule.
created_at: Option<String>§retired_at: Option<String>Set instead of deleting: a retired rule is evidence — the learner is told it was tried and measured harmful, which a deleted line cannot say — and the invalidation is reversible where erasure is not.
retired_reason: Option<String>