{"record":{"id":"66b0a38fc93567e8","repo":"Hmbown/CodeWhale","slug":"task-schema-v-is-newer-than-supported-v","errorCode":null,"errorMessage":"Task schema v{} is newer than supported v{}","messagePattern":"Task schema v(.+?) is newer than supported v(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/task_manager.rs","lineNumber":3162,"sourceCode":"}\n\nfn load_state(tasks_dir: &Path, queue_path: &Path) -> Result<LoadedTaskState> {\n    let mut tasks = HashMap::new();\n    if tasks_dir.exists() {\n        for entry in fs::read_dir(tasks_dir)\n            .with_context(|| format!(\"Failed to read tasks dir {}\", tasks_dir.display()))?\n        {\n            let entry = entry?;\n            let path = entry.path();\n            if path.extension().is_none_or(|ext| ext != \"json\") {\n                continue;\n            }\n            let content = fs::read_to_string(&path)\n                .with_context(|| format!(\"Failed to read task file {}\", path.display()))?;\n            let task: TaskRecord = serde_json::from_str(&content)\n                .with_context(|| format!(\"Failed to parse task file {}\", path.display()))?;\n            if task.schema_version > CURRENT_TASK_SCHEMA_VERSION {\n                bail!(\n                    \"Task schema v{} is newer than supported v{}\",\n                    task.schema_version,\n                    CURRENT_TASK_SCHEMA_VERSION\n                );\n            }\n            ensure_safe_storage_id(\"task id\", &task.id)?;\n            if path.file_stem().and_then(|stem| stem.to_str()) != Some(task.id.as_str()) {\n                bail!(\"Task record identity differs from its path\");\n            }\n            if let Some(scope) = &task.execution_scope {\n                validate_execution_id(scope, 64)?;\n            }\n            if let Some(generation) = &task.execution_generation {\n                validate_execution_id(generation, 32)?;\n                if task.execution_scope.is_none() {\n                    bail!(\"Task generation has no execution scope\");\n                }\n            }","sourceCodeStart":3144,"sourceCodeEnd":3180,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/task_manager.rs#L3144-L3180","documentation":"While enumerating durable task files, each record's schema_version is compared with CURRENT_TASK_SCHEMA_VERSION. A record written by a newer version of the app cannot be safely decoded or migrated by this process, so it fails loudly per-file instead of silently dropping or misinterpreting fields.","triggerScenarios":"Scanning/loading the tasks directory after downgrading the app, or after another newer instance wrote task files with a higher schema_version.","commonSituations":"Downgrade after an upgrade; two installs of different versions sharing one task store; synced/roamed state directory carrying records from a newer machine.","solutions":["Upgrade this installation to a version supporting the record's schema_version","Move the newer-version task files out of this store's directory","Use a separate task-store directory per app version to avoid mixed-version state"],"exampleFix":"// before: old binary reading new store\n$ codewhale-1.2 --task-store ~/.codewhale/tasks  // schema v3 > supported v2\n// after\n$ codewhale-1.3 --task-store ~/.codewhale/tasks","handlingStrategy":"fallback","validationCode":"let record: TaskRecord = serde_json::from_str(&content)?;\nif record.schema_version > CURRENT_TASK_SCHEMA_VERSION {\n    eprintln!(\"skip {}: schema v{} > supported v{}\", path.display(), record.schema_version, CURRENT_TASK_SCHEMA_VERSION);\n}","typeGuard":"fn readable_version(record: &TaskRecord, supported: u32) -> bool { record.schema_version <= supported }","tryCatchPattern":"match manager.load_task_file(&path).await {\n    Err(e) if e.to_string().contains(\"newer than supported\") => {\n        eprintln!(\"upgrade required; skipping {path:?}\");\n        // fall back to a read-only inventory or an upgraded binary\n    }\n    other => other?,\n}","preventionTips":["Keep all installs sharing a store on the same or compatible versions","Check for a downgrade before switching binaries on a shared state dir","Run a version check on startup before opening the store"],"tags":["schema-version","version-skew","migration","task-manager"],"backgroundTag":"incompatible-source-type","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"}