parlov-core 0.6.0

Shared types, error types, and oracle class definitions for parlov.
Documentation
//! Structured scoring breakdown for oracle results.
//!
//! Each `ScoringReason` records one contribution to the confidence or impact score, giving
//! operators a transparent audit trail of how a verdict was computed.

use serde::{Deserialize, Serialize};

/// One contribution to the confidence or impact score.
///
/// Reasons are accumulated during classification and attached to the `OracleResult` so the
/// operator can see exactly which signals drove the final verdict and severity.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ScoringReason {
    /// What was observed, e.g. `"Status differential 416 vs 404"`.
    pub description: String,
    /// Points contributed (positive or negative).
    pub points: i16,
    /// Which scoring axis this reason contributes to.
    pub dimension: ScoringDimension,
}

/// Which scoring axis a reason contributes to.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ScoringDimension {
    /// Contributes to the numeric confidence score (0-100).
    Confidence,
    /// Contributes to the impact classification.
    Impact,
}