{"record":{"id":"1522ca75ddceff1c","repo":"Hmbown/CodeWhale","slug":"managed-directory-path-cannot-be-empty","errorCode":null,"errorMessage":"managed directory path cannot be empty","messagePattern":"managed directory path cannot be empty","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/session_manager.rs","lineNumber":53,"sourceCode":"const WORK_GRAPH_IMPORT_ARCHIVE_DIR: &str = \".work-graph-import-archive\";\nconst SESSION_GOALS_DIR: &str = \".goals\";\nconst CURRENT_SESSION_GOAL_SCHEMA_VERSION: u32 = 1;\nconst MAX_SESSION_GOAL_OBJECTIVE_CHARS: usize = 8_192;\nconst MAX_SESSION_GOAL_FILE_BYTES: u64 = 64 * 1_024;\nconst CURRENT_SESSION_SCHEMA_VERSION: u32 = 1;\nconst CURRENT_QUEUE_SCHEMA_VERSION: u32 = 1;\n\nconst fn default_session_schema_version() -> u32 {\n    CURRENT_SESSION_SCHEMA_VERSION\n}\n\nconst fn default_queue_schema_version() -> u32 {\n    CURRENT_QUEUE_SCHEMA_VERSION\n}\n\nfn normalize_managed_dir(path: PathBuf) -> std::io::Result<PathBuf> {\n    if path.as_os_str().is_empty() {\n        return Err(std::io::Error::new(\n            std::io::ErrorKind::InvalidInput,\n            \"managed directory path cannot be empty\",\n        ));\n    }\n    if path.components().any(|component| {\n        matches!(\n            component,\n            Component::ParentDir | Component::Prefix(_) | Component::RootDir\n        )\n    }) && path.is_relative()\n    {\n        return Err(std::io::Error::new(\n            std::io::ErrorKind::InvalidInput,\n            \"managed directory path cannot contain traversal components\",\n        ));\n    }\n    if path.is_absolute() {\n        return Ok(path);","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/session_manager.rs#L35-L71","documentation":"Validation in normalize_managed_dir (called from the session manager constructor): the managed directory path was empty. Session goals, queue, and receipt stores all live under this root; an empty path would resolve relative paths against the process CWD, so construction fails immediately with InvalidInput.","triggerScenarios":"Thrown at crates/tui/src/session_manager.rs:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure a valid sessions directory path before constructing the session manager.","Check that config resolution actually populated the directory setting rather than leaving it empty."],"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"}