{"record":{"id":"e1da2ef1ff93c61c","repo":"astrid-runtime/astrid","slug":"no-capsule-toml-found-in","errorCode":null,"errorMessage":"No Capsule.toml found in {}","messagePattern":"No Capsule\\.toml found in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-capsule-install/src/local.rs","lineNumber":569,"sourceCode":"             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\");\n    if !manifest_path.exists() {\n        bail!(\"No Capsule.toml found in {}\", source_dir.display());\n    }\n    let manifest = load_manifest(&manifest_path).context(\"failed to load Capsule manifest\")?;\n    let id = CapsuleId::new(manifest.package.name.clone())?;\n    if let Some(expected) = expected\n        && id != *expected.id\n    {\n        bail!(\n            \"capsule identity mismatch: expected '{}', manifest declares '{id}'\",\n            expected.id\n        );\n    }\n    let installed_version = manifest.package.version.clone();\n    if let Some(expected_version) = expected.and_then(|expected| expected.version)\n        && installed_version != expected_version\n    {\n        bail!(\n            \"capsule version mismatch for '{id}': expected '{expected_version}', manifest declares '{installed_version}'\"\n        );","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-capsule-install/src/local.rs#L551-L587","documentation":"install_from_local_path_internal expects the source directory to be a capsule source tree containing a Capsule.toml manifest at its root. When manifest_path.exists() fails, the install cannot determine the capsule identity, version, or contents, so it bails immediately. This is the library's guard against being handed an arbitrary directory instead of a capsule package.","triggerScenarios":"Calling any install_from_local_path_* wrapper with a source_dir that lacks a Capsule.toml file at its root (typo in directory, pointed at repo root instead of the crate dir, unpacked archive missing the manifest, wrong path separator handling).","commonSituations":"Pointing the installer at a parent/child directory of the capsule; a fresh clone where the manifest is gitignored or not yet created; extracting a capsule archive into a nested folder (e.g. pkg-1.0.0/Capsule.toml) and passing the wrong level; forgetting `cargo capsule init` scaffolding.","solutions":["Run `ls <source_dir>/Capsule.toml` to confirm the manifest exists at exactly that path","Pass the directory that directly contains Capsule.toml, not an ancestor or extracted wrapper folder","If the capsule was never scaffolded, create a Capsule.toml (e.g. via the capsule init tooling)","Fix any path/typos or extraction issues so the manifest sits at source_dir/Capsule.toml"],"exampleFix":"// before\ninstall_from_local_path_for_principal_in_workspace(\"./target/extracted\", ...)?;\n// after\nlet dir = std::path::Path::new(\"./target/extracted/app-core\");\nassert!(dir.join(\"Capsule.toml\").exists(), \"Capsule.toml missing\");\ninstall_from_local_path_for_principal_in_workspace(dir, ...)?;","handlingStrategy":"validation","validationCode":"fn assert_capsule_source(dir: &Path) -> anyhow::Result<()> {\n    let p = dir.join(\"Capsule.toml\");\n    anyhow::ensure!(p.is_file(), \"{} does not contain Capsule.toml\", dir.display());\n    Ok(())\n}","typeGuard":"fn is_capsule_source_dir(dir: &Path) -> bool {\n    dir.join(\"Capsule.toml\").is_file()\n}","tryCatchPattern":"match install_result {\n    Err(e) if e.to_string().starts_with(\"No Capsule.toml found\") => {\n        eprintln!(\"check source_dir: {}\", e);\n    }\n    other => other?,\n}","preventionTips":["Resolve the capsule directory by locating Capsule.toml (e.g. walk up/down) instead of hardcoding paths","After extracting archives, enter the inner directory that holds the manifest","Ensure Capsule.toml is committed and not gitignored","Validate source paths in config files at startup"],"tags":["capsule-install","file-not-found","manifest"],"backgroundTag":"file-not-found","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"}