affaan-m/ECC · error · anyhow::Error

health evidence does not match promoted candidate

Error message

health evidence does not match promoted candidate

What it means

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.

Source

Thrown at ecc2/src/harness_eval.rs:447

    fn evaluate(&mut self, candidate_id: &str, seed: u64) -> Result<f64> {
        self.calls.push((candidate_id.to_string(), seed));
        let score = *self
            .scores
            .get(&(candidate_id.to_string(), seed))
            .with_context(|| format!("missing recorded score for {candidate_id} seed {seed}"))?;
        if !score.is_finite() || !(0.0..=1.0).contains(&score) {
            bail!("score must be finite and between 0 and 1");
        }
        Ok(score)
    }

    fn health_check(&mut self, candidate_id: &str) -> Result<bool> {
        if self
            .health_candidate
            .as_deref()
            .is_some_and(|expected| expected != candidate_id)
        {
            bail!("health evidence does not match promoted candidate");
        }
        Ok(self.health_ok)
    }
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PairedSample {
    pub seed: u64,
    pub candidate_score: f64,
    pub baseline_score: f64,
}

pub fn evaluate_paired(
    evaluator: &mut dyn Evaluator,
    candidate_id: &str,
    baseline_id: &str,
    seeds: &[u64],
) -> Result<Vec<PairedSample>> {

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Ensure the health evidence was recorded against the same candidate that is being promoted.
  2. Re-run the health evaluation for the promoted candidate to regenerate matching evidence.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at ecc2/src/harness_eval.rs:447 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/157838a9b22a4a04. Report an issue: GitHub.