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

recorded evidence exceeds bounded score or candidate limits

Error message

recorded evidence exceeds bounded score or candidate limits

What it means

RecordedEvaluator::from_evidence bounds evidence size: at most 20,000 total score entries and every candidate key must be exactly 64 characters. The error fires when recorded evidence exceeds those limits, guarding against oversized or malformed evidence payloads.

Source

Thrown at ecc2/src/harness_eval.rs:380

impl RecordedEvaluator {
    #[cfg(test)]
    pub fn new(scores: BTreeMap<(String, u64), f64>, health_ok: bool) -> Self {
        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();

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Reduce the number of scores or candidates in the recorded evidence to the bounded limits.
  2. Split the evaluation run into smaller batches that each fit the limits.
Defensive patterns

Strategy: validation

When it happens

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