{"record":{"id":"3f310eaa13e3e55e","repo":"Hmbown/CodeWhale","slug":"session-goal-store-must-be-a-real-directory","errorCode":null,"errorMessage":"Session goal store {} must be a real directory","messagePattern":"Session goal store (.+?) must be a real directory","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/session_manager.rs","lineNumber":956,"sourceCode":"    }\n\n    fn checkpoints_dir(&self) -> PathBuf {\n        self.sessions_dir.join(\"checkpoints\")\n    }\n\n    fn session_goals_dir(&self) -> PathBuf {\n        self.sessions_dir.join(SESSION_GOALS_DIR)\n    }\n\n    fn checked_existing_session_goals_dir(&self) -> std::io::Result<Option<PathBuf>> {\n        let dir = self.session_goals_dir();\n        let metadata = match fs::symlink_metadata(&dir) {\n            Ok(metadata) => metadata,\n            Err(error) if error.kind() == io::ErrorKind::NotFound => return Ok(None),\n            Err(error) => return Err(error),\n        };\n        if metadata.file_type().is_symlink() || !metadata.is_dir() {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidData,\n                format!(\n                    \"Session goal store {} must be a real directory\",\n                    dir.display()\n                ),\n            ));\n        }\n        Ok(Some(dir))\n    }\n\n    fn ensure_session_goals_dir(&self) -> std::io::Result<PathBuf> {\n        if let Some(dir) = self.checked_existing_session_goals_dir()? {\n            return Ok(dir);\n        }\n        let dir = self.session_goals_dir();\n        match fs::create_dir(&dir) {\n            Ok(()) => {}\n            Err(error) if error.kind() == io::ErrorKind::AlreadyExists => {}","sourceCodeStart":938,"sourceCodeEnd":974,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/session_manager.rs#L938-L974","documentation":"Directory-type guard in checked_existing_session_goals_dir: the session goals path exists but symlink_metadata shows it is not a real directory (symlink, file, or other), so the manager refuses to use it as the goal store.","triggerScenarios":"Thrown at crates/tui/src/session_manager.rs:956 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the symlink/file at the goals path and let the manager recreate a real directory.","Restore the `.goals` directory as a genuine directory from backup.","Check tooling that may have replaced the directory with a link."],"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"}