Skip to main content

classify_canary

Function classify_canary 

Source
pub fn classify_canary(
    local: &BinaryHashResult,
    remote: &BinaryHashResult,
    marker_present: bool,
    toolchains_match: Option<bool>,
) -> CanaryVerdict
Expand description

Classify a self-test canary outcome (bd-784xt). Pure and total, so the verdict logic is unit-tested without a live daemon.

Inputs:

  • local / remote: the orchestrator and worker binary hashes,
  • marker_present: whether the remote binary contains the injected test marker (proving it is the build we asked for, not a stale/corrupt artifact),
  • toolchains_match: Some(true) if the worker’s rustc is confirmed equal to the orchestrator’s, Some(false) if confirmed different, None if parity could not be determined.

Verdict precedence:

  1. marker absent -> CanaryVerdict::MissingMarker (corruption — FAIL),
  2. byte-equivalent -> CanaryVerdict::Reproduced (PASS),
  3. byte mismatch + toolchains confirmed identical -> CanaryVerdict::Miscompile (FAIL),
  4. byte mismatch + toolchains differ/unknown -> CanaryVerdict::ToolchainDrift (advisory PASS).