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

exactly one candidate-keyed health assertion is required

Error message

exactly one candidate-keyed health assertion is required

What it means

RecordedEvaluator::from_evidence requires the evidence to carry exactly one health assertion keyed by the promoted candidate id. It fires when health_candidate is absent, empty, or keyed to more/less than a single candidate, since the health check must unambiguously target one candidate.

Source

Thrown at ecc2/src/harness_eval.rs:383

        Self {
            name: "recorded-v1".into(),
            scores,
            health_ok,
            health_candidate: None,
            calls: Vec::new(),
        }
    }

    pub fn from_evidence(evidence: RecordedEvidence) -> Result<Self> {
        if evidence.evaluator != "recorded-v1" {
            bail!("CLI evidence evaluator must be recorded-v1");
        }
        let score_count = evidence.scores.values().map(BTreeMap::len).sum::<usize>();
        if score_count > 20_000 || evidence.scores.keys().any(|id| id.len() != 64) {
            bail!("recorded evidence exceeds bounded score or candidate limits");
        }
        if evidence.health.len() != 1 {
            bail!("exactly one candidate-keyed health assertion is required");
        }
        let (health_candidate, health_ok) = evidence
            .health
            .into_iter()
            .next()
            .context("candidate-keyed health evidence is required")?;
        let scores = evidence
            .scores
            .into_iter()
            .flat_map(|(id, values)| {
                values
                    .into_iter()
                    .map(move |(seed, score)| ((id.clone(), seed), score))
            })
            .collect();
        Ok(Self {
            name: evidence.evaluator,
            scores,

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Include exactly one health assertion keyed to the candidate under evaluation.
  2. Remove duplicate assertions or add the missing candidate key.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at ecc2/src/harness_eval.rs:383 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/81d0399a4f93bc13. Report an issue: GitHub.