{"record":{"id":"694dfa3fa2fbdcf1","repo":"Hmbown/CodeWhale","slug":"invalid-memory-workspace-id","errorCode":null,"errorMessage":"invalid memory workspace id","messagePattern":"invalid memory workspace id","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/native_memory.rs","lineNumber":911,"sourceCode":"    Ok(note.trim_start_matches('-').trim().to_string())\n}\n\nfn validate_query(query: &str) -> Result<&str> {\n    let query = query.trim();\n    if query.is_empty() || query.chars().count() > MAX_QUERY_CHARS {\n        bail!(\"memory search query is empty or too long\");\n    }\n    Ok(query)\n}\n\nfn safe_component(value: &str) -> Result<String> {\n    if value.is_empty()\n        || value == \".\"\n        || value == \"..\"\n        || value.contains('/')\n        || value.contains('\\\\')\n    {\n        bail!(\"invalid memory workspace id\");\n    }\n    Ok(value.to_string())\n}\n\nfn ensure_memory_file(path: &Path) -> Result<()> {\n    if let Some(parent) = path.parent() {\n        fs::create_dir_all(parent)?;\n    }\n    if !path.exists() {\n        File::create(path)?;\n    }\n    Ok(())\n}\n\nfn file_mtime(path: &Path) -> Result<i64> {\n    Ok(fs::metadata(path)?\n        .modified()?\n        .duration_since(UNIX_EPOCH)","sourceCodeStart":893,"sourceCodeEnd":929,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/native_memory.rs#L893-L929","documentation":"safe_component rejected a workspace id that would be unsafe as a path component: empty, `.`, `..`, or containing `/` or `\\`. Workspace ids become file names under the memory directory, so this is a path-traversal containment guard, not a format preference.","triggerScenarios":"Thrown at crates/tui/src/native_memory.rs:911 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a plain workspace id without separators or dot segments","Retry the memory operation"],"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"}