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

candidate configuration exceeds 1 MiB

Error message

candidate configuration exceeds 1 MiB

What it means

CandidateSpec::new rejects candidate configurations whose canonical JSON serialization exceeds 1 MiB. This is a bounded-input guard so a single candidate config cannot bloat the evidence store; it fires on oversized `config` values passed to the constructor.

Source

Thrown at ecc2/src/harness_eval.rs:198

use serde_json::Value;
use sha2::{Digest, Sha256};
use std::collections::{BTreeMap, BTreeSet};

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CandidateSpec {
    pub id: String,
    pub canonical_config: String,
    pub trace_refs: Vec<String>,
    pub evidence_refs: Vec<String>,
}

impl CandidateSpec {
    pub fn new(config: Value, trace_refs: Vec<String>, evidence_refs: Vec<String>) -> Result<Self> {
        let trace_refs = normalize_refs("trace", trace_refs)?;
        let evidence_refs = normalize_refs("evidence", evidence_refs)?;
        let canonical_config = serde_json::to_string(&canonicalize(config))?;
        if canonical_config.len() > 1024 * 1024 {
            bail!("candidate configuration exceeds 1 MiB");
        }
        let artifact = serde_json::to_string(&CanonicalCandidateArtifact {
            config: serde_json::from_str(&canonical_config)?,
            trace_refs: &trace_refs,
            evidence_refs: &evidence_refs,
        })?;
        let id = sha256_hex(artifact.as_bytes());
        Ok(Self {
            id,
            canonical_config,
            trace_refs,
            evidence_refs,
        })
    }

    pub fn verify_integrity(&self) -> Result<()> {
        self.verify_persisted_id(&self.id)?;
        if self.id != self.id_for_v2()? {

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Reduce the candidate configuration below 1 MiB by removing embedded blobs or trimming redundant entries.
  2. Move large payloads out of the configuration and reference them by address instead.
Defensive patterns

Strategy: validation

When it happens

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