{"record":{"id":"094fc0c969e0ad2a","repo":"astrid-runtime/astrid","slug":"directory-does-not-exist","errorCode":null,"errorMessage":"Directory does not exist: {}","messagePattern":"Directory does not exist: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/build.rs","lineNumber":20,"sourceCode":"\nuse anyhow::{Result, bail};\nuse std::path::Path;\nuse tracing::info;\n\n/// Main entrypoint for the `astrid build` Universal Packager command.\npub(crate) fn run_build(\n    path: Option<&str>,\n    output: Option<&str>,\n    project_type: Option<&str>,\n    from_mcp_json: Option<&str>,\n) -> Result<()> {\n    let target_dir = match path {\n        Some(p) => Path::new(p).to_path_buf(),\n        None => std::env::current_dir()?,\n    };\n\n    if !target_dir.exists() {\n        bail!(\"Directory does not exist: {}\", target_dir.display());\n    }\n\n    // Early exit for legacy `mcp.json` or `gemini-extension.json` quick convert\n    if let Some(json_path_str) = from_mcp_json {\n        let json_path = Path::new(json_path_str);\n        let dir = json_path.parent().unwrap_or(Path::new(\"\"));\n        let file_name = json_path.file_name().unwrap_or_default().to_string_lossy();\n        return crate::mcp::convert(dir, &file_name, output);\n    }\n\n    // Detect the project type if not explicitly provided\n    let detected_type = if let Some(explicit) = project_type {\n        explicit.to_string()\n    } else {\n        detect_project_type(&target_dir)?\n    };\n\n    info!(\"Detected project type: {detected_type}\");","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/build.rs#L2-L38","documentation":"Early validation guard at the top of run_build: the user-supplied target directory (positional path argument) does not exist on disk, so building cannot proceed. Fires when the path argument is misspelled or points to a deleted directory; when no path is given the current directory is used and is assumed to exist. A generic input-validation bail, not a systemic failure.","triggerScenarios":"Thrown at crates/astrid-build/src/build.rs:20 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the path for typos and rerun from the project directory","Create/restore the missing directory","Run `astrid build` with no path argument to use the current directory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}