{"record":{"id":"6c8924608743a10e","repo":"Hmbown/CodeWhale","slug":"plugin-name-is-not-a-safe-directory-name-error","errorCode":null,"errorMessage":"plugin name is not a safe directory name: {error:#}","messagePattern":"plugin name is not a safe directory name: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/plugins/install/place.rs","lineNumber":125,"sourceCode":"        fs::remove_dir_all(&backup).ok();\n    }\n\n    Ok(PluginInstallOutcome::Installed(InstalledPlugin {\n        name: staged.name,\n        path: final_path,\n        content_hash: staged.content_hash,\n        installed_content_hash,\n        source_checksum: source_checksum.to_string(),\n    }))\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Path guards\n// ─────────────────────────────────────────────────────────────────────────────\n\npub(super) fn plugin_target_path(name: &str, user_plugins_dir: &Path) -> Result<PathBuf> {\n    let name = validate_skill_name_segment(name)\n        .map_err(|error| anyhow::anyhow!(\"plugin name is not a safe directory name: {error:#}\"))?;\n    Ok(user_plugins_dir.join(name))\n}\n\n/// The resolved bundle must be a direct child of the resolved plugins root,\n/// matching discovery's fail-closed containment rule.\npub(super) fn ensure_target_within_plugins_dir(\n    target: &Path,\n    user_plugins_dir: &Path,\n) -> Result<()> {\n    let root = fs::canonicalize(user_plugins_dir).with_context(|| {\n        format!(\n            \"failed to resolve plugins directory {}\",\n            user_plugins_dir.display()\n        )\n    })?;\n    let target = fs::canonicalize(target)\n        .with_context(|| format!(\"failed to resolve {}\", target.display()))?;\n    if target.parent() != Some(root.as_path()) {","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/plugins/install/place.rs#L107-L143","documentation":"Error \"plugin name is not a safe directory name: {error:#}\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/plugins/install/place.rs:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}