pub struct CanaryTrendObservation {
pub signature: String,
pub score: f64,
pub severity: TrendSeverity,
pub contributing_findings: usize,
pub skipped_findings: usize,
pub trap_count: usize,
pub confirmed_count: usize,
pub fired_probe_ids: Vec<String>,
pub captured_at_epoch_ms: u64,
}Expand description
Deterministic, JSON-stable trend observation built from an
IntegrityCanaryReport.
The signature field is the canonical trend key — two
observations with the same signature describe the same finding
set (same probe ids + outcomes + weights), so a future trend
aggregator can collapse identical signals without recomputing
them.
§Example
use stygian_browser::integrity_canary::{
CanaryTrendObservation, IntegrityCanaryReport, IntegrityProbe,
};
let finding = IntegrityProbe::confirmed_finding(
"webdriver_descriptor_native",
0.20,
"data property leak",
);
let report = IntegrityCanaryReport::from_findings(vec![finding]);
let obs = CanaryTrendObservation::from_report(&report);
assert!(obs.signature.starts_with("fnv64:"));
assert!(obs.score > 0.0);Fields§
§signature: StringStable fnv64:<hex> signature over (probe ids + outcomes +
weights). Two reports with the same findings produce the
same signature, so the trend aggregator can bucket by this
key directly.
score: f64Aggregate risk score in [0.0, 1.0].
severity: TrendSeverityCoarse severity band derived from the score.
contributing_findings: usizeNumber of findings that contributed to the score.
skipped_findings: usizeNumber of findings that were skipped.
trap_count: usizeNumber of trap findings (Suspected or Confirmed).
confirmed_count: usizeNumber of confirmed findings.
fired_probe_ids: Vec<String>Distinct probe ids that fired with a trap outcome, in evaluation order.
captured_at_epoch_ms: u64Captured observation timestamp (Unix epoch ms). Populated
via crate::freshness::unix_epoch_ms when the observation
is built; serialised as a u64 for downstream automation.
Implementations§
Source§impl CanaryTrendObservation
impl CanaryTrendObservation
Sourcepub fn from_report(report: &IntegrityCanaryReport) -> Self
pub fn from_report(report: &IntegrityCanaryReport) -> Self
Build a trend observation from an IntegrityCanaryReport.
The signature is computed over the probe ids, outcomes, and weights — two reports with identical findings produce identical signatures so the trend aggregator can dedupe without recomputing.
Sourcepub const fn has_trap_signal(&self) -> bool
pub const fn has_trap_signal(&self) -> bool
true when the observation carries a trap signal
(Suspected or Confirmed).
Sourcepub const fn is_confirmed(&self) -> bool
pub const fn is_confirmed(&self) -> bool
true when the observation is a Confirmed trend entry.
Trait Implementations§
Source§impl Clone for CanaryTrendObservation
impl Clone for CanaryTrendObservation
Source§fn clone(&self) -> CanaryTrendObservation
fn clone(&self) -> CanaryTrendObservation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more