{"record":{"id":"a3ffb7eac5770f68","repo":"Hmbown/CodeWhale","slug":"audited-skill-path-does-not-match-owned-package","errorCode":null,"errorMessage":"audited skill path {} does not match owned package {}","messagePattern":"audited skill path (.+?) does not match owned package (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/mutation.rs","lineNumber":339,"sourceCode":"            skills_dir.display()\n        );\n    }\n    Ok(true)\n}\n\nfn validate_owned_skill_path(\n    ctx: &MutationContext<'_>,\n    skill: &AuditedSkill,\n    path: &Path,\n) -> Result<PathBuf> {\n    if skill.id.root_id != skill.root.id {\n        bail!(\"audited skill root identity changed; refusing mutation\");\n    }\n    let skills_dir = validate_owned_root_descriptor(ctx, &skill.root)?;\n    let package_name = on_disk_package_name(&skill.id)?;\n    let expected = skills_dir.join(package_name);\n    if path != expected {\n        bail!(\n            \"audited skill path {} does not match owned package {}\",\n            path.display(),\n            expected.display()\n        );\n    }\n    validate_owned_child(&skills_dir, path, true)?;\n    Ok(skills_dir)\n}\n\n/// Resolve the on-disk CodeWhale-owned skills directory for a target scope.\npub fn resolve_owned_target(\n    workspace: &Path,\n    home: Option<&Path>,\n    target: SkillTargetScope,\n) -> Result<PathBuf> {\n    let catalog = SkillRootCatalog::build(workspace, home, None);\n    let kind = match target {\n        SkillTargetScope::Project => SkillRootKind::CodeWhaleProject,","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/skills/mutation.rs#L321-L357","documentation":"validate_owned_skill_path recomputes the expected on-disk package directory (skills_dir + on-disk package name derived from skill.id) and bails when the caller-supplied path differs. The audited skill's recorded path no longer matches the deterministic location for that skill id — the directory was renamed, moved, or the audit is stale. The mismatched path argument is the input at fault.","triggerScenarios":"Thrown at crates/tui/src/skills/mutation.rs:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-scan skills so the audit reflects the on-disk package name","Restore the package directory name expected for the skill id","Mutate by skill id/name so the correct path is derived rather than supplied"],"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-14T05:17:10.506Z"}