use serde::{Serialize, Deserialize};
use rttp::NeuralPulse;
use epoekie::AID;
pub const VERSION: &str = "1.2.1-Alpha";
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum PathogenType {
None,
SemanticDrift,
TensorInconsistency,
IdentitySpoofing,
MetabolicDrain,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RPKIVerdict {
pub is_secure: bool,
pub pathogen: PathogenType,
pub isolation_score: f32,
pub audit_timestamp: u64,
}
impl RPKIVerdict {
pub fn secure() -> Self {
Self {
is_secure: true,
pathogen: PathogenType::None,
isolation_score: 0.0,
audit_timestamp: 0,
}
}
}
pub trait ImmunityEngine {
fn audit_pulse(&self, pulse: &NeuralPulse) -> RPKIVerdict;
fn isolate_node(&self, aid: &AID) -> Result<(), ImmunityError>;
fn reset_window(&self, window_id: u64);
}
#[derive(Debug, thiserror::Error)]
pub enum ImmunityError {
#[error("Immunity Engine Exhaustion: Audit buffer overflow")]
EngineExhaustion,
#[error("Surgical Isolation Failure: Pathogen spread detected")]
IsolationFailure,
#[error("Tensor Watermark Desync [Protocol Violation]")]
WatermarkDesync,
}