{"record":{"id":"fb2274a9112f0819","repo":"astrid-runtime/astrid","slug":"invalid-durable-capsule-id-error","errorCode":null,"errorMessage":"invalid durable capsule id: {error}","messagePattern":"invalid durable capsule id: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-kernel/src/lib.rs","lineNumber":1538,"sourceCode":"    }\n\n    /// Bind activation to one principal's currently published package.\n    #[cfg(not(all(target_arch = \"wasm32\", target_os = \"unknown\")))]\n    fn published_capsule_snapshot(\n        &self,\n        principal: &PrincipalId,\n        manifest: &astrid_capsule_types::manifest::CapsuleManifest,\n    ) -> anyhow::Result<Option<astrid_storage::CapsulePackageSnapshot>> {\n        let Some(store) = self.principal_store.as_ref() else {\n            return Ok(None);\n        };\n        let uid = self\n            .principal_directory\n            .uid_for(principal)\n            .map_err(|error| anyhow::anyhow!(\"resolve capsule cache owner UID: {error}\"))?;\n        let owner = astrid_storage::StateOwner::Principal(uid);\n        let capsule_id = astrid_capsule_types::CapsuleId::new(manifest.package.name.clone())\n            .map_err(|error| anyhow::anyhow!(\"invalid durable capsule id: {error}\"))?;\n        store\n            .capsules()\n            .get_snapshot(&owner, capsule_id.as_str())\n            .map_err(|error| anyhow::anyhow!(\"read durable capsule registry: {error}\"))\n    }\n\n    /// Derive the only runtime projection path admitted by this snapshot.\n    #[cfg(not(all(target_arch = \"wasm32\", target_os = \"unknown\")))]\n    fn published_cache_target(\n        &self,\n        principal: &PrincipalId,\n        manifest: &astrid_capsule_types::manifest::CapsuleManifest,\n        snapshot: &astrid_storage::CapsulePackageSnapshot,\n    ) -> anyhow::Result<PathBuf> {\n        let uid = self\n            .principal_directory\n            .uid_for(principal)\n            .map_err(|error| anyhow::anyhow!(\"resolve capsule cache owner UID: {error}\"))?;","sourceCodeStart":1520,"sourceCodeEnd":1556,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-kernel/src/lib.rs#L1520-L1556","documentation":"Wraps `CapsuleId::new(manifest.package.name)` failing: the manifest's package name is not a valid durable capsule identifier. CapsuleId enforces charset/length rules because the id becomes a filesystem path component in the durable registry.","triggerScenarios":"Resolving a durable capsule snapshot where manifest.package.name contains characters outside the allowed set (or is empty / too long), so CapsuleId::new rejects it.","commonSituations":"Hand-edited manifest with spaces, uppercase, or slashes in package name; package name copied from a Cargo/npm-style name with characters the kernel disallows; manifests authored for an older relaxed naming scheme.","solutions":["Rename the capsule in manifest.package.name to a valid identifier (lowercase, [a-z0-9-], reasonable length)","Reinstall the capsule from a manifest that follows the current CapsuleId rules","Check the CapsuleId::new validation rules in astrid-capsule-types and adjust the name accordingly"],"exampleFix":"// before (manifest.toml)\n[package]\nname = \"My Capsule v1!\"\n// after\n[package]\nname = \"my-capsule-v1\"","handlingStrategy":"validation","validationCode":"fn is_valid_capsule_name(name: &str) -> bool {\n    !name.is_empty()\n        && name.len() <= 64\n        && name.chars().all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '-')\n}","typeGuard":"fn valid_name(manifest: &CapsuleManifest) -> Option<&str> {\n    match CapsuleId::new(manifest.package.name.clone()) {\n        Ok(_) => Some(manifest.package.name.as_str()),\n        Err(_) => None,\n    }\n}","tryCatchPattern":null,"preventionTips":["Enforce lowercase [a-z0-9-] capsule names in manifest CI checks","Never hand-edit package.name in manifests","Run CapsuleId::new as a pre-publish lint"],"tags":["validation","identifier","manifest","capsule"],"backgroundTag":"invalid-identifier-format","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}