{"record":{"id":"4ab351cb6f7f9ace","repo":"Hmbown/CodeWhale","slug":"session-goal-schema-v-schema-version-is-newer-than-supported","errorCode":null,"errorMessage":"Session goal schema v{schema_version} is newer than supported v{CURRENT_SESSION_GOAL_SCHEMA_VERSION}","messagePattern":"Session goal schema v(.+?) is newer than supported v(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/session_manager.rs","lineNumber":811,"sourceCode":"            status,\n            token_budget: snapshot.token_budget,\n            tokens_used: snapshot.tokens_used,\n            time_used_seconds: snapshot.time_used_seconds,\n            continuation_count: snapshot.continuation_count,\n            elapsed_seconds: snapshot.elapsed_seconds.unwrap_or_default(),\n            pause_reason: snapshot.pause_reason,\n            goal_id: snapshot.goal_id.clone(),\n            last_gap_fingerprint: snapshot.last_gap_fingerprint.clone(),\n            repeated_gap_count: snapshot.repeated_gap_count,\n            last_gap_pass: snapshot.last_gap_pass,\n        };\n        state.validate()?;\n        Ok(Some(state))\n    }\n\n    pub fn validate(&self) -> io::Result<()> {\n        if self.schema_version > CURRENT_SESSION_GOAL_SCHEMA_VERSION {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                format!(\n                    \"Session goal schema v{} is newer than supported v{}\",\n                    self.schema_version, CURRENT_SESSION_GOAL_SCHEMA_VERSION\n                ),\n            ));\n        }\n        let objective = self.objective.trim();\n        if objective.is_empty() || objective.chars().count() > MAX_SESSION_GOAL_OBJECTIVE_CHARS {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                format!(\n                    \"Session goal objective must contain 1..={MAX_SESSION_GOAL_OBJECTIVE_CHARS} characters\"\n                ),\n            ));\n        }\n        if self\n            .goal_id","sourceCodeStart":793,"sourceCodeEnd":829,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/session_manager.rs#L793-L829","documentation":"Session goal files carry a schema_version; SessionGoalState::validate rejects snapshots whose schema version is greater than the CURRENT_SESSION_GOAL_SCHEMA_VERSION this build supports. This is a forward-compatibility guard: files written by a newer Codewhale must not be misread by older binaries.","triggerScenarios":"Loading a goal file written by a newer Codewhale release with a higher schema_version than the running binary supports.","commonSituations":"Downgrading Codewhale after using a newer version; syncing session state between machines with different versions; a beta/nightly wrote v2+ goals and stable now reads them.","solutions":["Upgrade Codewhale to a version supporting the file's schema version.","Delete or archive the newer goal file so the session loads without it.","Manually edit the file to the older schema (only if you know the format) — otherwise prefer deleting."],"exampleFix":"// before: running stable (supports v1) against a file from nightly\n{\"schema_version\": 2, ...}\n// after: upgrade codewhale, or remove the goal file\ncargo install codewhale --locked  # newer version","handlingStrategy":"try-catch","validationCode":"// compare versions before loading\n// if goal.schema_version > supported_version { upgrade codewhale first }","typeGuard":null,"tryCatchPattern":"match load_goal(path) {\n    Err(e) if e.to_string().contains(\"newer than supported\") => {\n        eprintln!(\"file written by a newer Codewhale; upgrade before loading\");\n    }\n    other => other?,\n}","preventionTips":["Keep Codewhale versions aligned across machines sharing session state.","Avoid downgrading after newer versions wrote session data.","Check release notes for goal schema bumps before switching versions."],"tags":["versioning","schema","goals"],"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"}