{"record":{"id":"7084958dd2897f9a","repo":"Hmbown/CodeWhale","slug":"continual-harness-state-uses-newer-schema-t","errorCode":null,"errorMessage":"continual harness state {} uses newer schema {}; this Codewhale supports schema {}","messagePattern":"continual harness state (.+?) uses newer schema (.+?); this Codewhale supports schema (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/continual_harness.rs","lineNumber":259,"sourceCode":"        Ok(raw) => raw,\n        Err(error) if error.kind() == ErrorKind::NotFound => {\n            return Ok(HarnessState {\n                schema_version: SCHEMA_VERSION,\n                entries: Vec::new(),\n            });\n        }\n        Err(error) => {\n            return Err(error)\n                .with_context(|| format!(\"read continual harness state {}\", path.display()));\n        }\n    };\n    let mut state: HarnessState = serde_json::from_str(&raw)\n        .with_context(|| format!(\"parse continual harness state {}\", path.display()))?;\n    if state.schema_version == 0 {\n        state.schema_version = SCHEMA_VERSION;\n    }\n    if state.schema_version > SCHEMA_VERSION {\n        bail!(\n            \"continual harness state {} uses newer schema {}; this Codewhale supports schema {}\",\n            path.display(),\n            state.schema_version,\n            SCHEMA_VERSION\n        );\n    }\n    if state.entries.len() > MAX_ENTRIES {\n        bail!(\n            \"continual harness state {} has {} entries; maximum is {MAX_ENTRIES}\",\n            path.display(),\n            state.entries.len()\n        );\n    }\n    Ok(state)\n}\n\nfn save_state(path: &Path, state: &HarnessState) -> Result<()> {\n    let parent = path","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/continual_harness.rs#L241-L277","documentation":"load_state refuses to deserialize a continual-harness state file whose schema_version is higher than the SCHEMA_VERSION this build understands. The state was written by a newer Codewhale and this binary cannot interpret it safely, so it fails closed rather than guessing at unknown fields.","triggerScenarios":"Calling overview, refine, or remove while the state file at the given path was last written by a newer Codewhale version (schema_version > SCHEMA_VERSION).","commonSituations":"Downgrading the Codewhale binary (e.g. pinning an older release after running a newer one), switching between channels where the state file is shared, or restoring a state file from a newer machine.","solutions":["Upgrade Codewhale to a build whose SCHEMA_VERSION is >= the version in the state file","Delete or rename the state file at the reported path to let a new one be created (loses harness entries)","Check state.schema_version in the file and migrate it manually only if you know the schema difference"],"exampleFix":"// before: reading state with an old binary\noverview(...)\n// after: upgrade or clear state\nmv ~/.local/state/codewhale/continual_harness.json ~/.local/state/codewhale/continual_harness.json.bak","handlingStrategy":"validation","validationCode":"let v: serde_json::Value = serde_json::from_str(&raw)?;\nlet sv = v.get(\"schema_version\").and_then(|x| x.as_u64()).unwrap_or(0);\nif sv > SUPPORTED_SCHEMA_VERSION { /* upgrade binary or discard state */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the same Codewhale version across machines sharing the state file","Back up the state file before upgrading","Check release notes for schema bumps before downgrading"],"tags":["schema","state-file","version-skew"],"backgroundTag":"schema-validation-failed","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}