Hmbown/CodeWhale · error

only Codewhale managed skills can be trusted

Error message

only Codewhale managed skills can be trusted

What it means

trust_skill() only trusts skills whose source_kind is SkillSourceKind::CodeWhaleManaged. Skills from other sources (user-authored, imported) cannot receive a managed trust v2 record, because the trust record's digest binding assumes Codewhale-managed lifecycle. The root-ownership check passes before this check fires.

Solutions

  1. Install the skill through a Codewhale-managed flow so it is registered with source_kind CodeWhaleManaged
  2. Add/repair the skill's managed-source metadata (registration entry) rather than trusting it as-is
  3. If the skill should remain external, use whatever external-skill trust path the product offers instead of trust_skill

Example fix

// before
ctx.trust_skill(hand_copied_skill_id, digest)?;
// after
let skill = ctx.find_audited_skill(&skill_id)?;
if skill.source_kind != SkillSourceKind::CodeWhaleManaged {
    ctx.install_skill(&skill.path)?; // register as managed first
}
ctx.trust_skill(skill_id, digest)?;
Defensive patterns

Strategy: validation

Validate before calling

ensure!(matches!(skill.source_kind, SkillSourceKind::CodeWhaleManaged), "install the skill through Codewhale before trusting");

Prevention

When it happens

Trigger: Calling trust_skill on a skill that resides in an owned writable root but was not created/installed by Codewhale (source_kind != CodeWhaleManaged), e.g. a hand-copied skill directory inside the managed skills folder.

Common situations: A developer manually copies a skill directory into the Codewhale skills directory and then tries to trust it programmatically; migration/import tools drop skills in place without setting the managed source flag.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/a1651b82e04976c1. Report an issue: GitHub.

Appendix: source

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

        scope,
        safe_target_path: safe_display_path(&path, Some(ctx.workspace), ctx.home),
        before_digest: before,
        after_digest: None,
        outcome: SkillMutationOutcome::Removed,
    })
}

fn trust_skill(
    skill_id: AuditedSkillId,
    expected_digest: String,
    ctx: &MutationContext<'_>,
) -> Result<SkillMutationReceipt> {
    let (skill, path) = find_audited_skill(ctx, &skill_id)?;
    if !skill.root.is_writable_owned() {
        bail!("refusing to trust skill outside Codewhale-owned roots");
    }
    if skill.source_kind != SkillSourceKind::CodeWhaleManaged {
        bail!("only Codewhale managed skills can be trusted");
    }
    validate_owned_skill_path(ctx, &skill, &path)?;
    let before = verify_expected_digest(&path, Some(&expected_digest))?;
    validate_owned_skill_path(ctx, &skill, &path)?;
    write_trust_v2(&path, &expected_digest)?;
    let scope = match skill.root.kind {
        SkillRootKind::CodeWhaleProject => SkillScope::Project,
        SkillRootKind::CodeWhaleGlobal => SkillScope::Global,
        _ => SkillScope::Logical,
    };
    Ok(SkillMutationReceipt {
        action: SkillActionKind::Trust,
        name: skill_id.canonical_name,
        scope,
        safe_target_path: safe_display_path(&path, Some(ctx.workspace), ctx.home),
        before_digest: before.clone(),
        after_digest: before,
        outcome: SkillMutationOutcome::Trusted,

View on GitHub (pinned to 73e0f67d83)