{"record":{"id":"6f2f2ad958b15d50","repo":"affaan-m/ECC","slug":"candidate-content-address-or-canonical-configurati","errorCode":null,"errorMessage":"candidate content address or canonical configuration is invalid","messagePattern":"candidate content address or canonical configuration is invalid","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/harness_eval.rs","lineNumber":217,"sourceCode":"        }\n        let artifact = serde_json::to_string(&CanonicalCandidateArtifact {\n            config: serde_json::from_str(&canonical_config)?,\n            trace_refs: &trace_refs,\n            evidence_refs: &evidence_refs,\n        })?;\n        let id = sha256_hex(artifact.as_bytes());\n        Ok(Self {\n            id,\n            canonical_config,\n            trace_refs,\n            evidence_refs,\n        })\n    }\n\n    pub fn verify_integrity(&self) -> Result<()> {\n        self.verify_persisted_id(&self.id)?;\n        if self.id != self.id_for_v2()? {\n            bail!(\"candidate content address or canonical configuration is invalid\");\n        }\n        Ok(())\n    }\n\n    pub fn legacy_id(&self) -> String {\n        sha256_hex(self.canonical_config.as_bytes())\n    }\n\n    pub fn verify_persisted_id(&self, persisted_id: &str) -> Result<()> {\n        let value: Value = serde_json::from_str(&self.canonical_config)?;\n        let rebuilt = Self::new(value, self.trace_refs.clone(), self.evidence_refs.clone())?;\n        let is_v1 = persisted_id == self.legacy_id();\n        let is_v2 = persisted_id == rebuilt.id;\n        if rebuilt.canonical_config != self.canonical_config\n            || (!is_v1 && !is_v2)\n            || (is_v2\n                && (rebuilt.trace_refs != self.trace_refs\n                    || rebuilt.evidence_refs != self.evidence_refs))","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/ecc2/src/harness_eval.rs#L199-L235","documentation":"CandidateSpec::verify_integrity re-derives the v2 content address from the stored canonical config and refs and compares it to the persisted id. The error means the persisted id no longer matches the immutable content (id_for_v2 mismatch after verify_persisted_id passed), i.e. the record was tampered with or written by a legacy hashing scheme.","triggerScenarios":"Thrown at ecc2/src/harness_eval.rs:217 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Recompute the content address from the canonical configuration bytes and ensure they match.","Verify the canonicalization function is applied consistently before hashing the candidate."],"exampleFix":null,"handlingStrategy":"try-catch","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-14T05:17:10.506Z"}