{"record":{"id":"3c20b814080ad804","repo":"affaan-m/ECC","slug":"invalid-canonical-health-evidence-snapshot","errorCode":null,"errorMessage":"invalid canonical health evidence snapshot","messagePattern":"invalid canonical health evidence snapshot","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/harness_eval.rs","lineNumber":348,"sourceCode":"    pub fn canonical_json(&self) -> Result<String> {\n        self.verify()?;\n        Ok(serde_json::to_string(self)?)\n    }\n\n    pub fn digest(&self) -> Result<String> {\n        Ok(sha256_hex(self.canonical_json()?.as_bytes()))\n    }\n\n    pub fn verify(&self) -> Result<()> {\n        if self.schema_version != 1\n            || self.evaluator != \"recorded-v1\"\n            || self.candidate_id.len() != 64\n            || !self\n                .candidate_id\n                .bytes()\n                .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte))\n        {\n            bail!(\"invalid canonical health evidence snapshot\");\n        }\n        Ok(())\n    }\n}\n\npub struct RecordedEvaluator {\n    name: String,\n    scores: BTreeMap<(String, u64), f64>,\n    health_ok: bool,\n    health_candidate: Option<String>,\n    calls: Vec<(String, u64)>,\n}\n\nimpl RecordedEvaluator {\n    #[cfg(test)]\n    pub fn new(scores: BTreeMap<(String, u64), f64>, health_ok: bool) -> Self {\n        Self {\n            name: \"recorded-v1\".into(),","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/ecc2/src/harness_eval.rs#L330-L366","documentation":"HealthEvidenceSnapshot::verify rejects snapshots whose schema_version is not 1, whose evaluator is not \"recorded-v1\", or whose candidate_id is not exactly 64 lowercase-hex characters. It is the structural integrity gate for recorded health evidence before it is digested or trusted.","triggerScenarios":"Thrown at ecc2/src/harness_eval.rs:348 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-serialize the health evidence snapshot using the canonical encoder before submission.","Ensure the snapshot was produced by the expected recorder version and not hand-edited."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}