{"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":"exception","errorClass":"anyhow::Error","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/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/continual_harness.rs#L241-L277","documentation":"Thrown by load_state when the harness state file's schema_version is greater than SCHEMA_VERSION (1) supported by this binary. Version 0 is silently upgraded to 1, but a newer version means the file was written by a newer Codewhale and may contain fields this build cannot interpret safely, so loading fails closed.","triggerScenarios":"Opening a workspace whose .codewhale harness state was written by a newer release, then running an older binary against it.","commonSituations":"Downgrading Codewhale; switching between stable and older builds on the same workspace; a teammate on a newer version committing workspace state.","solutions":["Upgrade Codewhale to at least the version that wrote the state file","If the ledger is disposable, archive or delete the state file so it regenerates at the current schema","Do not hand-edit schema_version down unless you have verified the payload is compatible"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Peek at the schema version before handing the workspace to this build:\nlet raw = std::fs::read_to_string(&state_path)?;\nlet version: u32 = serde_json::from_str::<serde_json::Value>(&raw)?\n    .get(\"schema_version\")\n    .and_then(|v| v.as_u64()).unwrap_or(0) as u32;\nif version > 1 {\n    return Err(anyhow::anyhow!(\"state written by a newer Codewhale (schema {version}); upgrade this binary\"));\n}","typeGuard":null,"tryCatchPattern":"match continual_harness::overview(&workspace) {\n    Ok(overview) => { /* ... */ }\n    Err(error) if error.to_string().contains(\"newer schema\") => {\n        // stop and tell the user to upgrade; do not rewrite the file\n    }\n    Err(error) => return Err(error),\n}","preventionTips":["Keep one Codewhale version per workspace to avoid writing state a downgrade cannot read","Upgrade before downgrade-prone workflows (testing an old release) and archive the state file first","Never hand-edit schema_version to silence the error; the payload may not be compatible"],"tags":["rust","tui","harness","schema-version","state","downgrade"],"backgroundTag":"schema-version-mismatch","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}