Hmbown/CodeWhale · error · anyhow::Error

audited skill path {} does not match owned package {}

Error message

audited skill path {} does not match owned package {}

What it means

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.

Source

Thrown at crates/tui/src/skills/mutation.rs:339

            skills_dir.display()
        );
    }
    Ok(true)
}

fn validate_owned_skill_path(
    ctx: &MutationContext<'_>,
    skill: &AuditedSkill,
    path: &Path,
) -> Result<PathBuf> {
    if skill.id.root_id != skill.root.id {
        bail!("audited skill root identity changed; refusing mutation");
    }
    let skills_dir = validate_owned_root_descriptor(ctx, &skill.root)?;
    let package_name = on_disk_package_name(&skill.id)?;
    let expected = skills_dir.join(package_name);
    if path != expected {
        bail!(
            "audited skill path {} does not match owned package {}",
            path.display(),
            expected.display()
        );
    }
    validate_owned_child(&skills_dir, path, true)?;
    Ok(skills_dir)
}

/// Resolve the on-disk CodeWhale-owned skills directory for a target scope.
pub fn resolve_owned_target(
    workspace: &Path,
    home: Option<&Path>,
    target: SkillTargetScope,
) -> Result<PathBuf> {
    let catalog = SkillRootCatalog::build(workspace, home, None);
    let kind = match target {
        SkillTargetScope::Project => SkillRootKind::CodeWhaleProject,

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Re-scan skills so the audit reflects the on-disk package name
  2. Restore the package directory name expected for the skill id
  3. Mutate by skill id/name so the correct path is derived rather than supplied
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/skills/mutation.rs:339 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/a3ffb7eac5770f68. Report an issue: GitHub.