{"record":{"id":"443430687154bdbc","repo":"Hmbown/CodeWhale","slug":"owned-skill-anchor-does-not-exist","errorCode":null,"errorMessage":"owned skill anchor {} does not exist","messagePattern":"owned skill anchor (.+?) does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/mutation.rs","lineNumber":182,"sourceCode":"/// Validate the complete owned-root chain without following a symlink in the\n/// workspace/home anchor, `.codewhale`, or `skills` component.\nfn validate_owned_target_chain(\n    anchor: &Path,\n    skills_dir: &Path,\n    require_existing: bool,\n) -> Result<()> {\n    let expected = anchor.join(\".codewhale\").join(\"skills\");\n    if skills_dir != expected {\n        bail!(\n            \"refusing to mutate non-canonical Codewhale skills root {}\",\n            skills_dir.display()\n        );\n    }\n\n    let anchor_exists = checked_real_directory(anchor)?;\n    if !anchor_exists {\n        if require_existing {\n            bail!(\"owned skill anchor {} does not exist\", anchor.display());\n        }\n        return Ok(());\n    }\n\n    let codewhale_dir = anchor.join(\".codewhale\");\n    let codewhale_exists = checked_real_directory(&codewhale_dir)?;\n    if !codewhale_exists {\n        if require_existing {\n            bail!(\n                \"owned skill parent {} does not exist\",\n                codewhale_dir.display()\n            );\n        }\n        return Ok(());\n    }\n\n    let skills_exists = checked_real_directory(skills_dir)?;\n    if !skills_exists {","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/skills/mutation.rs#L164-L200","documentation":"When require_existing is set, validate_owned_target_chain demands that the owned anchor directory already exist; a missing anchor is an error rather than an implicit creation, so installs never silently bootstrap directories in unexpected places.","triggerScenarios":"Calling install_remote/import_external (or prepare_owned_target/resolve_owned_target with require_existing=true) when the anchor directory (e.g. the project or home root that should contain .codewhale) does not exist on disk.","commonSituations":"Running against a freshly cloned project before any CodeWhale setup; a deleted or moved home/project directory; pointing configuration at a nonexistent anchor path.","solutions":["Create the anchor directory first (e.g. mkdir -p <anchor>)","Verify the configured anchor path points at the intended existing directory","Run the initial CodeWhale setup/initialization so .codewhale scaffolding exists"],"exampleFix":"// before\ninstall_remote(\"/nonexistent/project\", \"some-skill\")\n// after\nfs::create_dir_all(\"/nonexistent/project\")?; // or use the real project root\ninstall_remote(\"/real/project\", \"some-skill\")","handlingStrategy":"validation","validationCode":"assert!(anchor.is_dir(), \"anchor {} must exist before install\", anchor.display());","typeGuard":"fn anchor_exists(p: &Path) -> bool {\n    std::fs::metadata(p).map(|m| m.is_dir()).unwrap_or(false)\n}","tryCatchPattern":"match install_remote(anchor, name) {\n    Err(e) if e.to_string().contains(\"anchor\") && e.to_string().contains(\"does not exist\") => eprintln!(\"create or correct the anchor directory first\"),\n    other => other?,\n}","preventionTips":["Verify the anchor path exists before invoking installs","Initialize CodeWhale scaffolding in new projects first","Correct stale configured anchor paths after moving projects"],"tags":["skills","filesystem","directory"],"backgroundTag":"directory-not-found","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}