pub fn derive(
_memory: &Memory,
ctx: &DeriveContext,
) -> (f64, ConfidenceSignals, ConfidenceSource)Expand description
Deterministically derive a confidence value from row signals.
Returns (confidence, signals, source_marker):
-
confidence— value in[0.0, 1.0]. The formula is:base = 0.5 + 0.1 * is_atom + 0.05 * log10(1 + corroboration) - 0.02 * source_age_days * decay_rate value = clamp(base, 0.0, 1.0) * freshness_factor + (1 - freshness_factor) * baseline_per_sourcewhere
decay_rate = ln(2) / half_life_daysandfreshness_factor = exp(-age / half_life). The blend with the per-source baseline lets a well-calibrated source survive aging without collapsing to the freshness floor. -
signals— theConfidenceSignalsenvelope that produced the value. Stored alongside the row onmemories.confidence_signalsso the derivation is reproducible. -
source_marker— typed discriminator for thememories.confidence_sourcecolumn. AlwaysConfidenceSource::AutoDerivedhere; theshadowandcalibratepaths use the other variants.
§Audit honesty
This function is pure — it does not touch the substrate, fire a
hook, or read environment variables. The caller is responsible for
gating on auto_confidence_enabled and only persisting the
returned value when the opt-in is active. Tests can call it directly
with handcrafted DeriveContext values and get bit-identical
outputs across runs.