{"record":{"id":"85f6d9ec88cc6869","repo":"Hmbown/CodeWhale","slug":"automation-schema-v-is-newer-than-supported-v","errorCode":null,"errorMessage":"Automation schema v{} is newer than supported v{}","messagePattern":"Automation schema v(.+?) is newer than supported v(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":2750,"sourceCode":"        return false;\n    };\n    if !rest.starts_with('-') || rest.len() < 2 {\n        return false;\n    }\n    stamp.char_indices().all(|(idx, ch)| match idx {\n        8 => ch == 'T',\n        18 => ch == 'Z',\n        _ => ch.is_ascii_digit(),\n    })\n}\n\nfn read_automation_file(path: &Path) -> Result<AutomationRecord> {\n    let raw = fs::read_to_string(path)\n        .with_context(|| format!(\"Failed to read automation {}\", path.display()))?;\n    let record: AutomationRecord = serde_json::from_str(&raw)\n        .with_context(|| format!(\"Failed to parse automation {}\", path.display()))?;\n    if record.schema_version > CURRENT_AUTOMATION_SCHEMA_VERSION {\n        bail!(\n            \"Automation schema v{} is newer than supported v{}\",\n            record.schema_version,\n            CURRENT_AUTOMATION_SCHEMA_VERSION\n        );\n    }\n    Ok(record)\n}\n\nfn read_run_file(path: &Path) -> Result<AutomationRunRecord> {\n    let raw =\n        fs::read_to_string(path).with_context(|| format!(\"Failed to read {}\", path.display()))?;\n    let run: AutomationRunRecord = serde_json::from_str(&raw)\n        .with_context(|| format!(\"Failed to parse {}\", path.display()))?;\n    if run.schema_version > CURRENT_RUN_SCHEMA_VERSION {\n        bail!(\n            \"Automation run schema v{} is newer than supported v{}\",\n            run.schema_version,\n            CURRENT_RUN_SCHEMA_VERSION","sourceCodeStart":2732,"sourceCodeEnd":2768,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L2732-L2768","documentation":"read_automation_file refuses to load an AutomationRecord whose schema_version is greater than CURRENT_AUTOMATION_SCHEMA_VERSION. This is a forward-compatibility guard: the running binary predates the file's schema and silently parsing it could misinterpret fields, so loading fails loudly instead.","triggerScenarios":"Opening an automation JSON file written by a newer Codewhale build (higher automation schema version) with an older binary.","commonSituations":"Downgrading the app or switching to an older branch/release while keeping the data directory; syncing automation files from a machine running a newer version.","solutions":["Update Codewhale to a build whose CURRENT_AUTOMATION_SCHEMA_VERSION is >= the file's version.","If the downgrade is intentional, move the automation file aside and re-create the automations on the old version.","Hand-edit the file only if you fully understand the new schema, lowering schema_version after removing unsupported fields (risky)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let rec: AutomationRecord = serde_json::from_str(&raw)?;\nif rec.schema_version > CURRENT_AUTOMATION_SCHEMA_VERSION {\n    // too new: refuse or route to an up-to-date binary\n}","typeGuard":"fn load_supported(raw: &str) -> Option<AutomationRecord> {\n    let rec: AutomationRecord = serde_json::from_str(raw).ok()?;\n    (rec.schema_version <= CURRENT_AUTOMATION_SCHEMA_VERSION).then_some(rec)\n}","tryCatchPattern":"match read_automation_file(&path) {\n    Ok(r) => use(r),\n    Err(e) if e.to_string().contains(\"newer than supported\") => prompt_upgrade(),\n    Err(e) => return Err(e),\n}","preventionTips":["Keep the app version that wrote the data directory in sync across machines.","Pin or back up automation files before downgrading the binary.","Check schema_version in shared/exported files before importing them."],"tags":["automation","schema","versioning"],"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"}