pub struct ChangeDeltaInput {
pub source: DeltaSource,
pub affected_target: String,
pub weight: f64,
pub severity: DeltaSeverity,
pub target_class: Option<TargetClass>,
pub vendor_hint: Option<VendorId>,
pub summary: String,
pub evidence: BTreeMap<String, String>,
}Expand description
A single regression delta consumed by the
ChangeDetector.
The delta is the boundary type between the
upstream sources (T92 / T84 / T86 / T87) and the
detector. The source crate converts its own report
into one or more ChangeDeltaInputs; the detector
does not reach into the source crates.
§Field semantics
source— which upstream family produced this delta.affected_target— domain the delta applies to (e.g."example.com").weight— unit-interval severity score (0.0= clean,1.0= worst-case). The detector quantises this through its configurable thresholds to derive the classification band.severity— coarse tier the source attached (clean / advisory / warning / critical). Preserved on the emitted event for downstream consumers.target_class— optionalTargetClassso the detector can attach a target-class-aware mitigation hint.vendor_hint— optionalVendorIdthe source recognised on this target; preserved on the event.summary— short human-readable description of the regression (one line). Used as thedelta_summary.headlinefield on the emitted event.evidence— optional structured evidence (e.g. probe IDs, score deltas). Preserved verbatim on the event payload.
§Example
use stygian_charon::change_feed::{ChangeDeltaInput, DeltaSeverity, DeltaSource};
use stygian_charon::vendor_classifier::VendorId;
let delta = ChangeDeltaInput::new(
DeltaSource::Canary,
"example.com",
0.55,
DeltaSeverity::Warning,
"integrity probe webdriver regressed 0.18",
);
assert_eq!(delta.source, DeltaSource::Canary);
assert_eq!(delta.affected_target, "example.com");
assert!(delta.vendor_hint.is_none());
let delta = delta.with_vendor(VendorId::Cloudflare);
assert_eq!(delta.vendor_hint, Some(VendorId::Cloudflare));Fields§
§source: DeltaSourceSource channel that produced this delta.
affected_target: StringAffected target (domain).
weight: f64Unit-interval severity (0.0 = clean,
1.0 = worst-case). Used by the detector
to derive the classification band.
severity: DeltaSeverityCoarse severity tier the source attached.
target_class: Option<TargetClass>Optional target class — when set, the detector uses it to choose the runbook mitigation hint.
vendor_hint: Option<VendorId>Optional vendor hint — when set, the detector surfaces it on the emitted event.
summary: StringShort human-readable summary of the
regression. Surfaced as the headline
field of the delta summary on the emitted
event.
evidence: BTreeMap<String, String>Optional structured evidence (probe IDs,
score deltas, etc.). Preserved verbatim on
the event payload under evidence.<key>.
Implementations§
Source§impl ChangeDeltaInput
impl ChangeDeltaInput
Sourcepub fn new(
source: DeltaSource,
affected_target: impl Into<String>,
weight: f64,
severity: DeltaSeverity,
summary: impl Into<String>,
) -> Self
pub fn new( source: DeltaSource, affected_target: impl Into<String>, weight: f64, severity: DeltaSeverity, summary: impl Into<String>, ) -> Self
Build a delta with the required fields. The
weight is clamped to [0.0, 1.0] and NaN is
treated as 0.0 so a single bad source
cannot poison the detector.
Sourcepub const fn with_target_class(self, target_class: TargetClass) -> Self
pub const fn with_target_class(self, target_class: TargetClass) -> Self
Attach a target class to the delta.
Sourcepub const fn with_vendor(self, vendor: VendorId) -> Self
pub const fn with_vendor(self, vendor: VendorId) -> Self
Attach a vendor hint to the delta.
Trait Implementations§
Source§impl Clone for ChangeDeltaInput
impl Clone for ChangeDeltaInput
Source§fn clone(&self) -> ChangeDeltaInput
fn clone(&self) -> ChangeDeltaInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more