{"record":{"id":"e600f0e3f10a0f67","repo":"Hmbown/CodeWhale","slug":"goal-snapshot-has-no-objective","errorCode":null,"errorMessage":"goal snapshot has no objective","messagePattern":"goal snapshot has no objective","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/session_manager.rs","lineNumber":562,"sourceCode":"\nconst fn current_session_goal_schema_version() -> u32 {\n    CURRENT_SESSION_GOAL_SCHEMA_VERSION\n}\n\nimpl SessionGoalState {\n    /// Convert a runtime update into the durable, bounded session contract.\n    /// The canonical empty runtime snapshot removes the sidecar.\n    pub fn from_runtime(snapshot: &GoalSnapshot) -> io::Result<Option<Self>> {\n        if snapshot.objective.is_none() && snapshot.status.trim() == \"none\" {\n            return Ok(None);\n        }\n        let objective = snapshot\n            .objective\n            .as_deref()\n            .map(str::trim)\n            .filter(|objective| !objective.is_empty())\n            .ok_or_else(|| {\n                io::Error::new(io::ErrorKind::InvalidData, \"goal snapshot has no objective\")\n            })?;\n        let status = match snapshot.status.trim() {\n            \"active\" => SessionGoalStatus::Active,\n            \"paused\" => SessionGoalStatus::Paused,\n            \"complete\" => SessionGoalStatus::Complete,\n            \"blocked\" => SessionGoalStatus::Blocked,\n            other => {\n                return Err(io::Error::new(\n                    io::ErrorKind::InvalidData,\n                    format!(\"goal snapshot has unsupported status '{other}'\"),\n                ));\n            }\n        };\n        let state = Self {\n            schema_version: CURRENT_SESSION_GOAL_SCHEMA_VERSION,\n            objective: objective.to_string(),\n            status,\n            token_budget: snapshot.token_budget,","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/session_manager.rs#L544-L580","documentation":"Contract guard in SessionGoalState::from_runtime: the runtime goal snapshot neither qualifies as the canonical empty snapshot (no objective and status \"none\") nor carries a non-empty objective, so it cannot be converted into a durable session-goal record.","triggerScenarios":"Thrown at crates/tui/src/session_manager.rs:562 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty objective string with the goal snapshot.","If the goal is meant to be cleared, send the canonical empty snapshot: no objective and status \"none\".","Check the runtime component producing GoalSnapshot for fields left unset."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}