Skip to main content

MatchConfidence

Struct MatchConfidence 

Source
pub struct MatchConfidence {
    pub disposition: SemanticDisposition,
    pub top_score: f64,
    pub runner_up_score: f64,
    pub runner_up_motif: Option<MotifClass>,
    pub margin: f64,
    pub tier_consensus_factor: f64,
    pub confuser_motif: Option<MotifClass>,
    pub confuser_score: f64,
    pub margin_vs_confuser: f64,
}
Expand description

Confidence-bearing motif match result.

Returned by HeuristicsBank::match_episode_with_confidence. The margin field is (top_score - runner_up_score) / top_score, clamped to [0.0, 1.0]. Operators reading the margin can calibrate trust:

  • margin > 0.5 → top motif clearly dominates; act on it
  • margin in (0.2, 0.5] → moderate confidence; surface runner-up
  • margin <= 0.2 → top and runner-up are competitive; surface both
  • top_score == 0.0 → no motif matched (disposition == Unknown)

Fields§

§disposition: SemanticDisposition§top_score: f64§runner_up_score: f64§runner_up_motif: Option<MotifClass>§margin: f64§tier_consensus_factor: f64

Phase 3 — fraction of the matched motif’s affinity tiers that actually fired in the episode range, in [0, 1]. Populated only by match_episode_with_tier_affinity; the legacy match_episode_with_consensus leaves this at 0.0. Used by the adaptive margin gate (Path 3): when tier_consensus_factor > 0.5, the gate is halved — strong tier evidence justifies lower margin requirement.

§confuser_motif: Option<MotifClass>

Phase 5.6 — explicit confuser motif declared by the matched motif’s HeuristicEntry. May differ from runner_up_motif if the score-based runner-up is not the declared confuser. None when no confuser is declared.

§confuser_score: f64

Phase 5.6 — score of the declared confuser computed in the same scoring pass as the matched motif. 0.0 if no confuser is declared.

§margin_vs_confuser: f64

Phase 5.6 — margin of top motif over its declared confuser: (top_score - confuser_score) / top_score, clamped to [0, 1]. Used by fusion’s confuser-aware typed-confirmation gate. 0.0 if no confuser is declared.

Trait Implementations§

Source§

impl Clone for MatchConfidence

Source§

fn clone(&self) -> MatchConfidence

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MatchConfidence

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MatchConfidence

Source§

fn eq(&self, other: &MatchConfidence) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for MatchConfidence

Source§

impl StructuralPartialEq for MatchConfidence

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.