Hmbown/CodeWhale · error

refusing to mutate non-canonical CodeWhale skills root {}

Error message

refusing to mutate non-canonical CodeWhale skills root {}

What it means

validate_owned_target_chain compares the skills_dir under mutation against the canonical expected chain <anchor>/.codewhale/skills and refuses any other path. A non-canonical root means a caller (or a stale/rewritten descriptor) is asking to mutate a skills directory that is not the real CodeWhale-owned location for the given workspace/home anchor. The mismatched skills_dir path is the input at fault.

Source

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

            "refusing to mutate through non-directory CodeWhale skills path component {}",
            path.display()
        ),
        Ok(_) => Ok(true),
        Err(err) if err.kind() == ErrorKind::NotFound => Ok(false),
        Err(err) => Err(err).with_context(|| format!("failed to inspect {}", path.display())),
    }
}

/// Validate the complete owned-root chain without following a symlink in the
/// workspace/home anchor, `.codewhale`, or `skills` component.
fn validate_owned_target_chain(
    anchor: &Path,
    skills_dir: &Path,
    require_existing: bool,
) -> Result<()> {
    let expected = anchor.join(".codewhale").join("skills");
    if skills_dir != expected {
        bail!(
            "refusing to mutate non-canonical CodeWhale skills root {}",
            skills_dir.display()
        );
    }

    let anchor_exists = checked_real_directory(anchor)?;
    if !anchor_exists {
        if require_existing {
            bail!("owned skill anchor {} does not exist", anchor.display());
        }
        return Ok(());
    }

    let codewhale_dir = anchor.join(".codewhale");
    let codewhale_exists = checked_real_directory(&codewhale_dir)?;
    if !codewhale_exists {
        if require_existing {
            bail!(

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Use the canonical .codewhale/skills path under the workspace or home anchor
  2. Check for misconfigured skills_dir overrides pointing outside the anchor
  3. Refresh the skill root descriptor so it reflects the current owned root
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/tui/src/skills/mutation.rs:173 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/6e5ac8bb1313b9c0. Report an issue: GitHub.