{"record":{"id":"9520e0b5568505cd","repo":"astrid-runtime/astrid","slug":"source-path-does-not-exist-source","errorCode":null,"errorMessage":"Source path does not exist: {source}","messagePattern":"Source path does not exist: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/capsule/install.rs","lineNumber":658,"sourceCode":"            context.prompt,\n        );\n    }\n\n    bail!(\"astrid-build produced no .capsule archive.\");\n}\n\nasync fn install_from_local(\n    source: &str,\n    workspace: bool,\n    home: &AstridHome,\n    original_source: Option<&str>,\n    principal: &astrid_core::PrincipalId,\n    expected: Option<ExpectedCapsule<'_>>,\n    prompt: &ManualInstallOptions,\n) -> anyhow::Result<Vec<InstalledCapsuleOutcome>> {\n    let source_path = Path::new(source);\n    if !source_path.exists() {\n        bail!(\"Source path does not exist: {source}\");\n    }\n\n    // Unpack `.capsule` archive when source is a file.\n    if source_path.is_file() && source.ends_with(\".capsule\") {\n        if !workspace {\n            let installed = super::install_daemon::install_local_via_daemon_outcome(\n                source,\n                prompt,\n                daemon_install_authority(source, principal, prompt)?,\n            )\n            .await?;\n            return Ok(vec![installed]);\n        }\n        return unpack_via_lib(\n            source_path,\n            workspace,\n            home,\n            original_source,","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/capsule/install.rs#L640-L676","documentation":"install_from_local is given a source path (a .capsule archive or a project directory) and refuses to proceed when that path does not exist on disk. It is a fail-fast guard at the very top of the local-install flow, since nothing downstream (daemon install, unpack, auto-build) can work without a real file or directory. The message echoes the exact source string so the user can see which path was rejected.","triggerScenarios":"Calling `astrid capsule install <source>` (or install_from_local directly) where <source> is a path that does not exist: a typo'd filename, a .capsule archive deleted after download, a relative path evaluated from a different working directory, or a remote/registry identifier mistakenly passed to local install.","commonSituations":"Typing `astrid capsule install ./my-capsule.capsule` from the wrong directory; a CI script downloads the artifact to a temp dir but passes a stale path; shell variable expansion yields an empty path; confusing a capsule registry name with a local file path.","solutions":["Verify the path exists: run `ls -la <source>` (or `test -e <source> && echo ok`) from the same working directory the CLI runs in.","Fix typos or use an absolute path so the command works regardless of cwd: `astrid capsule install /abs/path/to/capsule.capsule`.","If the artifact should have been downloaded/built first, produce it before installing (e.g. `astrid-build <dir> --output dist --type rust`).","If you meant to install from the registry rather than a local file, use the registry install command instead of passing a local path.","Check that the path ends with `.capsule` (file) or contains Cargo.toml/Capsule.toml (directory) so it is routed to the right install branch."],"exampleFix":"// before\nastrid capsule install ./dist/my-capsle.capsule   // typo, file not found\n// after\nastrid capsule install ./dist/my-capsule.capsule  // verified with ls first","handlingStrategy":"validation","validationCode":"let p = std::path::Path::new(source);\nif !p.exists() {\n    eprintln!(\"source path {} does not exist (cwd: {:?})\", source, std::env::current_dir()?);\n    std::process::exit(1);\n}","typeGuard":"fn source_exists(source: &str) -> bool { std::path::Path::new(source).exists() }","tryCatchPattern":null,"preventionTips":["Use absolute paths in scripts so the install command is cwd-independent.","Run `test -e \"$ARTIFACT\"` immediately before invoking capsule install in CI.","Check download/build steps completed (artifact present and non-empty) before installing.","Don't pass registry identifiers to local install; use the matching registry command."],"tags":["cli","filesystem","path","install"],"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"}