{"record":{"id":"157838a9b22a4a04","repo":"affaan-m/ECC","slug":"health-evidence-does-not-match-promoted-candidate","errorCode":null,"errorMessage":"health evidence does not match promoted candidate","messagePattern":"health evidence does not match promoted candidate","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/harness_eval.rs","lineNumber":447,"sourceCode":"    fn evaluate(&mut self, candidate_id: &str, seed: u64) -> Result<f64> {\n        self.calls.push((candidate_id.to_string(), seed));\n        let score = *self\n            .scores\n            .get(&(candidate_id.to_string(), seed))\n            .with_context(|| format!(\"missing recorded score for {candidate_id} seed {seed}\"))?;\n        if !score.is_finite() || !(0.0..=1.0).contains(&score) {\n            bail!(\"score must be finite and between 0 and 1\");\n        }\n        Ok(score)\n    }\n\n    fn health_check(&mut self, candidate_id: &str) -> Result<bool> {\n        if self\n            .health_candidate\n            .as_deref()\n            .is_some_and(|expected| expected != candidate_id)\n        {\n            bail!(\"health evidence does not match promoted candidate\");\n        }\n        Ok(self.health_ok)\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]\npub struct PairedSample {\n    pub seed: u64,\n    pub candidate_score: f64,\n    pub baseline_score: f64,\n}\n\npub fn evaluate_paired(\n    evaluator: &mut dyn Evaluator,\n    candidate_id: &str,\n    baseline_id: &str,\n    seeds: &[u64],\n) -> Result<Vec<PairedSample>> {","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/ecc2/src/harness_eval.rs#L429-L465","documentation":"RecordedEvaluator::health_check compares the candidate id being health-checked against the single candidate id asserted in the recorded evidence. The error fires when a caller asks for a health verdict for a candidate other than the one the evidence was recorded for.","triggerScenarios":"Thrown at ecc2/src/harness_eval.rs:447 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the health evidence was recorded against the same candidate that is being promoted.","Re-run the health evaluation for the promoted candidate to regenerate matching evidence."],"exampleFix":null,"handlingStrategy":"try-catch","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"}