{"record":{"id":"d761291bc741f2f8","repo":"astrid-runtime/astrid","slug":"non-workspace-capsule-installation-requires-the-au","errorCode":null,"errorMessage":"non-workspace capsule installation requires the authoritative RuntimePrincipalStore; route the request through KernelRequest::InstallCapsule","messagePattern":"non-workspace capsule installation requires the authoritative RuntimePrincipalStore; route the request through KernelRequest::InstallCapsule","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/local.rs","lineNumber":549,"sourceCode":"            id: expected,\n            version: expected_version,\n        }),\n        Some(authority),\n    )\n}\n\n#[allow(clippy::needless_pass_by_value, clippy::too_many_lines)]\npub(crate) fn install_from_local_path_internal(\n    source_dir: &Path,\n    home: &AstridHome,\n    options: InstallOptions,\n    target_principal: &PrincipalId,\n    workspace: InstallWorkspace<'_>,\n    expected: Option<ExpectedCapsuleIdentity<'_>>,\n    installed_authority: Option<InstalledAuthority>,\n) -> anyhow::Result<InstallOutput> {\n    if !options.workspace && options.storage.is_none() {\n        bail!(\n            \"non-workspace capsule installation requires the authoritative \\\n             RuntimePrincipalStore; route the request through KernelRequest::InstallCapsule\"\n        );\n    }\n    let checked_workspace = if options.workspace {\n        let root = workspace\n            .root\n            .context(\"workspace install requires a workspace root\")?;\n        Some(\n            workspace\n                .layout\n                .resolve(root)\n                .context(\"selected workspace state path is unsafe\")?,\n        )\n    } else {\n        None\n    };\n    let manifest_path = source_dir.join(\"Capsule.toml\");","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/local.rs#L531-L567","documentation":"Non-workspace capsule installs must persist into the authoritative RuntimePrincipalStore. install_from_local_path_internal rejects any request where options.workspace is false and no storage backend was supplied, because without a store the installation would not be durable or visible to the kernel. The message tells the integrator to route the operation through KernelRequest::InstallCapsule instead of calling this low-level entry point directly.","triggerScenarios":"Calling install_from_local_path_internal (or any of its five public wrappers: unpack_and_install_internal, install_from_local_path_for_principal_in_workspace, install_from_local_path_checked/authorized/checked_authorized_for_principal_in_workspace) with options.workspace = false and options.storage = None.","commonSituations":"Custom tooling invoking the low-level install API directly instead of going through the kernel request channel; refactored code that dropped the storage option; tests or scripts that previously relied on ephemeral installs.","solutions":["Set options.workspace = true and supply a workspace, or","Provide options.storage with a RuntimePrincipalStore handle for non-workspace installs","Best: emit a KernelRequest::InstallCapsule through the kernel so the authoritative store is used automatically","If this is a script/test, switch to the kernel-level install path rather than the internal API"],"exampleFix":"// before\ninstall_from_local_path_internal(&src, &principal, &options /* workspace:false, storage:None */, ...)?;\n// after\nlet options = InstallOptions { workspace: false, storage: Some(runtime_principal_store.clone()), ..options };\n// or: kernel.submit(KernelRequest::InstallCapsule { source, principal, .. })","handlingStrategy":"validation","validationCode":"fn install_options_valid(opts: &InstallOptions) -> bool {\n    opts.workspace || opts.storage.is_some()\n}","typeGuard":null,"tryCatchPattern":"if !options.workspace && options.storage.is_none() {\n    kernel.submit(KernelRequest::InstallCapsule { /* ... */ })?;\n} else {\n    install_from_local_path_internal(...)?;\n}","preventionTips":["Prefer the kernel-level KernelRequest::InstallCapsule entry point for all non-workspace installs","Always attach a RuntimePrincipalStore when bypassing workspace mode","Add a unit test covering options.workspace=false + storage=None rejection","Document that the low-level API is not a standalone install path"],"tags":["capsule-install","missing-storage","api-misuse"],"backgroundTag":"missing-required-config-field","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"}