{"record":{"id":"3928c6bc3fa26aa1","repo":"pbakaus/impeccable","slug":"no-stable-slug-for-input","errorCode":null,"errorMessage":"no stable slug for input\n","messagePattern":"no stable slug for input\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/context/src/critique_storage.rs","lineNumber":455,"sourceCode":"    });\n    current.into_iter().chain(legacy).max_by(|a, b| a.path.cmp(&b.path))\n}\n\npub fn run(args: &[String], io: &mut Io) -> i32 {\n    let cwd = io.cwd.to_string_lossy().into_owned();\n    let env = io.env.clone();\n    let cmd = args.first().map(String::as_str).unwrap_or(\"\");\n    let rest = if args.is_empty() { &[][..] } else { &args[1..] };\n    match cmd {\n        \"slug\" => {\n            let slug = slug_from_target(rest.first().map(String::as_str), &cwd);\n            match slug {\n                Some(s) => {\n                    io.out(&format!(\"{}\\n\", s));\n                    0\n                }\n                None => {\n                    io.err(\"no stable slug for input\\n\");\n                    1\n                }\n            }\n        }\n        \"write\" => {\n            let slug_arg = rest.first().map(String::as_str).unwrap_or(\"\");\n            let slug = coerce_slug(rest.first().map(String::as_str), &cwd);\n            let body_file = rest.get(1).filter(|s| !s.is_empty());\n            let (Some(slug), Some(body_file)) = (slug, body_file) else {\n                io.err(\"usage: write <slug-or-target> <body-file>\\n\");\n                return 1;\n            };\n            let raw = match std::fs::read(body_file) {\n                Ok(b) => String::from_utf8_lossy(&b).into_owned(),\n                Err(e) => {\n                    // JS: uncaught exception -> stack trace on stderr, exit 1\n                    io.err(&format!(\"{}\\n\", uncaught(&node_read_error(body_file, &e))));\n                    return 1;","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/context/src/critique_storage.rs#L437-L473","documentation":"The critique-storage CLI's slug subcommand converts a target or input into a stable slug for storage lookups. When `coerce_slug` cannot derive any stable slug from the given input (no usable argument, or input that doesn't map to a known target/workspace), it prints this message and exits 1. Nothing is written or looked up.","triggerScenarios":"Running the slug subcommand with no argument (`rest.first()` is None so slug_arg is empty); passing a value that `coerce_slug` cannot normalize into a stable slug (empty string, unresolvable target path, or name with no canonical mapping in the current cwd).","commonSituations":"Forgetting the positional argument when scripting; running from a directory where the given target name doesn't resolve to a workspace; passing a path that no longer exists; expecting slug generation from free-form text rather than a target.","solutions":["Pass an explicit slug-or-target positional argument that resolves in your current working directory.","Use an existing target/workspace name that `coerce_slug` recognizes (check what targets the context CLI can resolve).","Run from the workspace root so relative targets resolve; try an absolute path.","If no stable slug is derivable for this input, choose a canonical target name and reuse it consistently."],"exampleFix":"// before\ncontext critique slug\n// no stable slug for input\n// after\ncontext critique slug my-app-web","handlingStrategy":"validation","validationCode":"const slugInput = process.argv[3];\nif (!slugInput || !slugInput.trim()) {\n  console.error('usage: context critique slug <slug-or-target>');\n  process.exit(2);\n}","typeGuard":"function hasSlugArg(rest) {\n  return typeof rest?.[0] === 'string' && rest[0].trim().length > 0;\n}","tryCatchPattern":"const res = spawnSync('context', ['critique', 'slug', target], { encoding: 'utf8' });\nif (res.status !== 0 && res.stderr.includes('no stable slug for input')) {\n  console.error(`Target \"${target}\" has no stable slug; use a resolvable workspace name.`);\n}","preventionTips":["Always pass an explicit, resolvable target name; avoid empty shell variables.","Reuse one canonical target name per workspace so slugs stay stable.","Verify the target resolves from your cwd before deriving slugs from it."],"tags":["cli","slug","missing-argument"],"backgroundTag":"missing-required-argument","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"}