{"record":{"id":"6c1906b2cc720313","repo":"affaan-m/ECC","slug":"kind-references-exceed-bounded-limits","errorCode":null,"errorMessage":"{kind} references exceed bounded limits","messagePattern":"(.+?) references exceed bounded limits","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/harness_eval.rs","lineNumber":264,"sourceCode":"            self.evidence_refs.clone(),\n        )?\n        .id)\n    }\n}\n\n#[derive(Serialize)]\nstruct CanonicalCandidateArtifact<'a> {\n    config: Value,\n    trace_refs: &'a [String],\n    evidence_refs: &'a [String],\n}\n\nfn normalize_refs(kind: &str, refs: Vec<String>) -> Result<Vec<String>> {\n    if refs.is_empty() || refs.iter().any(|reference| reference.trim().is_empty()) {\n        bail!(\"at least one non-empty {kind} reference is required\");\n    }\n    if refs.len() > 100 || refs.iter().any(|reference| reference.len() > 4096) {\n        bail!(\"{kind} references exceed bounded limits\");\n    }\n    let mut normalized = refs\n        .into_iter()\n        .map(|reference| reference.trim().to_string())\n        .collect::<Vec<_>>();\n    normalized.sort();\n    normalized.dedup();\n    Ok(normalized)\n}\n\nfn sha256_hex(bytes: &[u8]) -> String {\n    Sha256::digest(bytes)\n        .iter()\n        .map(|byte| format!(\"{byte:02x}\"))\n        .collect()\n}\n\nfn canonicalize(value: Value) -> Value {","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/ecc2/src/harness_eval.rs#L246-L282","documentation":"normalize_refs enforces bounded sizes on candidate reference lists: at most 100 entries and each entry at most 4096 bytes. The error fires for trace/evidence refs that exceed either bound, preventing unbounded reference payloads in candidate specs.","triggerScenarios":"Thrown at ecc2/src/harness_eval.rs:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Trim the reference list to the documented bounded limit for that kind.","Split the evidence across multiple submissions if the reference count legitimately exceeds the bound."],"exampleFix":null,"handlingStrategy":"validation","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"}