{"record":{"id":"94cb046fcf0c2c6e","repo":"affaan-m/ECC","slug":"cli-evidence-evaluator-must-be-recorded-v1","errorCode":null,"errorMessage":"CLI evidence evaluator must be recorded-v1","messagePattern":"CLI evidence evaluator must be recorded-v1","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"ecc2/src/harness_eval.rs","lineNumber":376,"sourceCode":"    health_candidate: Option<String>,\n    calls: Vec<(String, u64)>,\n}\n\nimpl RecordedEvaluator {\n    #[cfg(test)]\n    pub fn new(scores: BTreeMap<(String, u64), f64>, health_ok: bool) -> Self {\n        Self {\n            name: \"recorded-v1\".into(),\n            scores,\n            health_ok,\n            health_candidate: None,\n            calls: Vec::new(),\n        }\n    }\n\n    pub fn from_evidence(evidence: RecordedEvidence) -> Result<Self> {\n        if evidence.evaluator != \"recorded-v1\" {\n            bail!(\"CLI evidence evaluator must be recorded-v1\");\n        }\n        let score_count = evidence.scores.values().map(BTreeMap::len).sum::<usize>();\n        if score_count > 20_000 || evidence.scores.keys().any(|id| id.len() != 64) {\n            bail!(\"recorded evidence exceeds bounded score or candidate limits\");\n        }\n        if evidence.health.len() != 1 {\n            bail!(\"exactly one candidate-keyed health assertion is required\");\n        }\n        let (health_candidate, health_ok) = evidence\n            .health\n            .into_iter()\n            .next()\n            .context(\"candidate-keyed health evidence is required\")?;\n        let scores = evidence\n            .scores\n            .into_iter()\n            .flat_map(|(id, values)| {\n                values","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/harness_eval.rs#L358-L394","documentation":"RecordedEvaluator::from_evidence only accepts evidence files whose evaluator field is exactly \"recorded-v1\". Any other value means the evidence was produced by a different (or future) evaluator format that this CLI cannot interpret. This is a forward-compatibility guard: it fails fast instead of misreading an unknown schema.","triggerScenarios":"Calling from_evidence with a RecordedEvidence deserialized from a file where evaluator is missing (defaults to empty), renamed, hand-edited, or written by a newer version using \"recorded-v2\" or another format string.","commonSituations":"Upgrading the harness and trying to feed new-format evidence into an older CLI; hand-authoring evidence JSON for tests and omitting the evaluator field; a tooling change rewriting the field name (e.g. evaluator_version); mixing evidence files from different tools.","solutions":["Regenerate the evidence through the current CLI's record flow so evaluator is set to \"recorded-v1\".","If the evidence is from a newer version, upgrade the CLI/harness so it accepts that format instead of editing the field.","If hand-writing evidence for tests, set evaluator: \"recorded-v1\" explicitly.","Verify the evidence file was not truncated or partially written (a missing evaluator field also fails this check)."],"exampleFix":"// before (hand-authored test evidence)\nlet evidence = RecordedEvidence { scores, health, ..Default::default() }; // evaluator empty\n\n// after\nlet evidence = RecordedEvidence {\n    evaluator: \"recorded-v1\".to_string(),\n    scores,\n    health,\n    ..Default::default()\n};","handlingStrategy":"validation","validationCode":"fn is_recorded_v1(evidence: &RecordedEvidence) -> bool {\n    evidence.evaluator == \"recorded-v1\"\n}","typeGuard":"fn as_recorded_v1(evidence: RecordedEvidence) -> Option<RecordedEvidence> {\n    (evidence.evaluator == \"recorded-v1\").then_some(evidence)\n}","tryCatchPattern":"match RecordedEvaluator::from_evidence(evidence) {\n    Ok(ev) => proceed(ev),\n    Err(e) if e.to_string().contains(\"recorded-v1\") => bail!(\"evidence format unsupported; regenerate or upgrade the harness\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Always generate evidence via the CLI record flow rather than hand-authoring JSON.","Pin evidence producer and consumer to the same harness version.","Check the evaluator field immediately after deserializing an evidence file, before further processing."],"tags":["versioning","format","evidence"],"backgroundTag":"invalid-enum-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}