Hmbown/CodeWhale · error · anyhow::Error
audited skill root identity changed; refusing mutation
Error message
audited skill root identity changed; refusing mutation
What it means
validate_owned_skill_path compares the root_id recorded on the audited skill with the root_id of its associated root descriptor; they differ. This means the audit snapshot became inconsistent between scan and mutation (root rescanned/re-indexed, ids regenerated) so the skill-to-root binding can no longer be trusted; a fresh audit is required. The stale audit data is the input at fault.
Source
Thrown at crates/tui/src/skills/mutation.rs:333
let canonical_child = fs::canonicalize(child)
.with_context(|| format!("failed to resolve owned skill path {}", child.display()))?;
if canonical_child.parent() != Some(canonical_root.as_path()) {
bail!(
"owned skill path {} escapes direct root {}",
child.display(),
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,View on GitHub (pinned to 0c42157ee5)
Solutions
- Re-run the skills audit/scan and retry the mutation with fresh ids
- Avoid holding skill references across scans or root re-indexing
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/tui/src/skills/mutation.rs:333 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/fa4cc8aae7238dfd.
Report an issue: GitHub.