pub struct IntegrityProbe {
pub id: IntegrityProbeId,
pub weight: f64,
pub description: &'static str,
pub script: &'static str,
pub mitigation_hint: &'static str,
}Expand description
Single integrity probe definition: stable id, weight, JS evaluation script, description, and mitigation hint.
The catalogue lives in all_probes. The struct is Clone so
callers can build modified copies for testing.
Fields§
§id: IntegrityProbeIdStable probe identifier.
weight: f64Weight in [0.0, 1.0] used by the aggregate score.
description: &'static strHuman-readable description (one short paragraph).
script: &'static strJavaScript evaluation script (verbatim). Returns a JSON
string with shape
'{"outcome":"clean|trap_suspected|trap_confirmed|skipped","evidence":"..."}'.
mitigation_hint: &'static strActionable mitigation hint emitted in the diagnostic payload when the probe fires.
Implementations§
Source§impl IntegrityProbe
impl IntegrityProbe
Sourcepub fn confirmed_finding(
id: impl Into<String>,
weight: f64,
evidence: impl Into<String>,
) -> ProbeFinding
pub fn confirmed_finding( id: impl Into<String>, weight: f64, evidence: impl Into<String>, ) -> ProbeFinding
Build a finding representing a confirmed trap (test helper).
Sourcepub fn parse_output(&self, json: &str) -> ProbeFinding
pub fn parse_output(&self, json: &str) -> ProbeFinding
Parse the JSON string returned by the probe’s script.
Returns a ProbeFinding with the recorded outcome and
evidence. When JSON parsing fails, the result is mapped to a
IntegrityProbeOutcome::Skipped finding carrying the raw
output as evidence — this is the conservative fallback that
keeps the report deterministic under parse failures.
Trait Implementations§
Source§impl Clone for IntegrityProbe
impl Clone for IntegrityProbe
Source§fn clone(&self) -> IntegrityProbe
fn clone(&self) -> IntegrityProbe
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more