kitt_score 0.1.0

Decision engine at the core of Project KITT — in-memory stateful matching with pluggable scoring backends.
Documentation
//! Public result types for the three `ingest_*` methods.

use crate::errors::IngestErr;
use crate::scoring::ScoreResult;
use crate::ActionId;

/// Result type for ingest operations. Must be consumed — `NoWinner` and
/// `ReloadInProgress` are legitimate outcomes, not errors.
#[must_use = "ingest results must be consumed — NoWinner and ReloadInProgress are legitimate outcomes"]
#[derive(Debug)]
pub enum Ingested<T> {
    /// A state-update was applied successfully.
    Updated,
    /// An action-registration was accepted. The assigned id is echoed back.
    Registered(ActionId),
    /// A trigger produced a winning action. Payload has post-closure applied.
    Decided(Outcome<T>),
    /// A trigger found no eligible actions. Not an error.
    NoWinner,
    /// The event was discarded because a reload is in progress.
    ReloadInProgress,
    /// The event was rejected.
    Rejected(IngestErr),
}

/// Boxed result for a trigger event.
#[must_use]
#[derive(Debug)]
pub struct Outcome<T> {
    /// Action id assigned by the engine.
    pub action_id: ActionId,
    /// Final score.
    pub score: ScoreResult,
    /// Payload unboxed from the winning registration.
    pub payload: T,
}