{"record":{"id":"a836dd93159275f1","repo":"pbakaus/impeccable","slug":"embed-prompt-no-such-path","errorCode":null,"errorMessage":"embed-prompt: no such path {}\n","messagePattern":"embed-prompt: no such path (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/context/src/embed_prompt.rs","lineNumber":206,"sourceCode":"    let abs = |p: &str| -> String { jsp::resolve(&cwd, &[p]) };\n    let file = args.iter().find(|a| !a.starts_with(\"--\")).cloned();\n    let read_mode = args.iter().any(|a| a == \"--read\");\n    let scan_mode = args.iter().any(|a| a == \"--scan\");\n    let arg_of = |name: &str| -> Option<String> {\n        let i = args.iter().position(|a| a == name)?;\n        args.get(i + 1).cloned()\n    };\n\n    if scan_mode {\n        let targets: Vec<&String> = args.iter().filter(|a| !a.starts_with(\"--\")).collect();\n        if targets.is_empty() {\n            io.err(\"embed-prompt: --scan needs at least one directory\\n\");\n            return 1;\n        }\n        let mut rasters: Vec<String> = Vec::new();\n        for t in &targets {\n            if !exists(&abs(t)) {\n                io.err(&format!(\"embed-prompt: no such path {}\\n\", t));\n                return 1;\n            }\n            // JS walks with the path as given (relative to cwd); output uses that spelling.\n            let saved = std::env::current_dir().ok();\n            let _ = std::env::set_current_dir(&cwd);\n            let r = walk(t, true, &mut rasters);\n            if let Some(s) = saved {\n                let _ = std::env::set_current_dir(s);\n            }\n            if let Err(e) = r {\n                io.err(&format!(\"Error: {}\\n\", e));\n                return 1;\n            }\n        }\n        let mut missing = 0;\n        for r in &rasters {\n            if prompt_of(&abs(r)).is_none() {\n                io.out(&format!(\"MISSING: {}\\n\", r));","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/context/src/embed_prompt.rs#L188-L224","documentation":"The `impeccable embed-prompt --scan` command validates every directory passed via --scan before walking it for raster images. If any target path does not exist on disk, the CLI prints this message and exits with code 1 instead of silently skipping it.","triggerScenarios":"Running `impeccable embed-prompt --scan <dir>` (or positional targets) where one of the given paths was deleted, renamed, is on an unmounted volume, or is misspelled relative to the current working directory.","commonSituations":"Typoed directory names in scripts or CI, running from a different working directory than expected (relative paths resolve against cwd), or scanning a path removed between command composition and execution.","solutions":["Check the path exists relative to your current working directory (ls the exact spelling you passed).","Use absolute paths in scripts/CI to avoid cwd dependence.","Fix typos or re-create the missing directory before re-running."],"exampleFix":"// before\nimpeccable embed-prompt --scan ./dist/imgs\n// after\nls ./dist/imgs || echo 'missing'; impeccable embed-prompt --scan \"$PWD/dist/imgs\"","handlingStrategy":"validation","validationCode":"for p in \"$@\"; do [ -e \"$p\" ] || { echo \"no such path: $p\" >&2; exit 1; }; done","typeGuard":"const exists = (p) => { try { return fs.existsSync(p); } catch { return false; } };","tryCatchPattern":null,"preventionTips":["Use absolute paths in scripts and CI","Verify scan targets exist before composing the command","Keep scan targets under version-controlled, stable directories"],"tags":["cli","file-not-found","path-validation"],"backgroundTag":"file-not-found","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}