{"record":{"id":"4401d18c80aedabb","repo":"Hmbown/CodeWhale","slug":"only-codewhale-managed-skills-can-be-updated","errorCode":null,"errorMessage":"only CodeWhale managed skills can be updated","messagePattern":"only CodeWhale managed skills can be updated","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/skills/mutation.rs","lineNumber":867,"sourceCode":"                continue;\n            }\n            fs::copy(&path, &target)?;\n        }\n    }\n    Ok(())\n}\n\nasync fn update_skill(\n    skill_id: AuditedSkillId,\n    expected_digest: Option<String>,\n    ctx: &MutationContext<'_>,\n) -> Result<SkillMutationReceipt> {\n    let (skill, path) = find_audited_skill(ctx, &skill_id)?;\n    if !skill.root.is_writable_owned() {\n        bail!(\"refusing to update skill outside CodeWhale-owned roots\");\n    }\n    if skill.source_kind != SkillSourceKind::CodeWhaleManaged {\n        bail!(\"only CodeWhale managed skills can be updated\");\n    }\n    let skills_dir = validate_owned_skill_path(ctx, &skill, &path)?;\n    // Imported skills carry `import:…` provenance and must not hit the registry.\n    ensure_remote_updatable(&path)?;\n    let before = verify_expected_digest(&path, expected_digest.as_deref())?;\n    let scope = match skill.root.kind {\n        SkillRootKind::CodeWhaleProject => SkillScope::Project,\n        SkillRootKind::CodeWhaleGlobal => SkillScope::Global,\n        _ => SkillScope::Logical,\n    };\n\n    let package_name = on_disk_package_name(&skill_id)?;\n    validate_owned_skill_path(ctx, &skill, &path)?;\n    let outcome = install::update_with_registry(\n        package_name,\n        &skills_dir,\n        ctx.max_size,\n        ctx.network,","sourceCodeStart":849,"sourceCodeEnd":885,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/skills/mutation.rs#L849-L885","documentation":"Raised in update_skill when the skill's source_kind is not CodeWhaleManaged. The update path syncs skills that CodeWhale itself manages (installed/upgraded through its own machinery); externally sourced or user-provided skills are intentionally outside its update lifecycle.","triggerScenarios":"Thrown at crates/tui/src/skills/mutation.rs:867 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update the skill through its original distribution channel instead","Import an updated compatible external package to replace it","Verify you referenced the intended AuditedSkillId; managed and external copies can share a canonical name"],"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"}