parlov-core 0.5.0

Shared types, error types, and oracle class definitions for parlov.
Documentation
//! Paired HTTP exchanges for differential analysis.

use serde::{Deserialize, Serialize};

use crate::{ProbeDefinition, ResponseSurface, Technique};

/// A single HTTP exchange: request and response paired permanently.
///
/// Every response travels with the request that produced it. This ensures analyzers always have
/// access to what was sent (method, headers, body) alongside what came back.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProbeExchange {
    /// The request that was sent.
    pub request: ProbeDefinition,
    /// The response that came back.
    pub response: ResponseSurface,
}

/// Paired exchanges for differential analysis with full technique context.
///
/// Replaces the older `ProbeSet` which carried only `ResponseSurface` vectors without request
/// context or technique metadata. `DifferentialSet` gives the analyzer everything it needs:
/// what was sent, what came back, and why the probes were generated.
#[derive(Debug, Clone)]
pub struct DifferentialSet {
    /// Exchanges for the known-valid / control input.
    pub baseline: Vec<ProbeExchange>,
    /// Exchanges for the unknown / suspect input.
    pub probe: Vec<ProbeExchange>,
    /// Technique metadata explaining why these probes were generated.
    pub technique: Technique,
}