{"record":{"id":"4b5f4e393b6fe84d","repo":"pbakaus/impeccable","slug":"surface-brief-path-requires-a-concrete-target-4b5f4e","errorCode":null,"errorMessage":"surface brief path requires a concrete target\n","messagePattern":"surface brief path requires a concrete target\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/context/src/surface_brief_cli.rs","lineNumber":40,"sourceCode":"    let env = io.env.clone();\n    let command = args.first().map(String::as_str);\n    let target = args.get(1).map(String::as_str).filter(|s| !s.is_empty());\n    let body_file = args.get(2).map(String::as_str).filter(|s| !s.is_empty());\n    let related: Vec<String> = if args.len() > 3 { args[3..].to_vec() } else { vec![] };\n    let opts = TargetOptions { target_path: target.map(|t| t.to_string()) };\n    let project_root = resolve_project_root(&cwd, &opts, &env);\n    let rel_out = |p: &str| -> String {\n        let r = jsp::relative(&cwd, &cwd, p);\n        if r.is_empty() {\n            p.to_string()\n        } else {\n            r\n        }\n    };\n    match command {\n        Some(\"path\") => {\n            let Some(fp) = surface_brief_path_for_target(target, &project_root) else {\n                io.err(\"surface brief path requires a concrete target\\n\");\n                return 1;\n            };\n            io.out(&format!(\"{}\\n\", rel_out(&fp)));\n            0\n        }\n        Some(\"list\") => {\n            let rows: Vec<Value> = list_surface_briefs(&project_root).iter().map(|b| summary(b, &project_root)).collect();\n            io.out(&format!(\"{}\\n\", json_pretty(&Value::Array(rows))));\n            0\n        }\n        Some(\"read\") => {\n            let result = resolve_surface_brief(&project_root, target);\n            if let Some(b) = result.brief {\n                io.out(&b.text);\n                return 0;\n            }\n            if !result.candidates.is_empty() {\n                let rows: Vec<Value> = result.candidates.iter().map(|b| summary(b, &project_root)).collect();","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/context/src/surface_brief_cli.rs#L22-L58","documentation":"`impeccable surface-brief path` requires a concrete target; when no target resolves to an actual brief file, the command prints this usage error and exits 1. `surface_brief_path_for_target` returned None, so there is no file path to print.","triggerScenarios":"Running `surface-brief path` with no target argument, or with a target for which no surface brief file exists in the project (surface_brief_path_for_target fails).","commonSituations":"Forgetting the target argument, misspelling a target name, or asking for a path before any brief has been generated for that target.","solutions":["Pass a concrete target: `impeccable surface-brief path <target>`.","Run `impeccable surface-brief list` to see targets that have briefs.","Generate a brief first via `surface-brief write` before asking for its path.","Check target spelling/case against the project's known targets."],"exampleFix":"// before\nimpeccable surface-brief path\n// after\nimpeccable surface-brief path src/components/App.tsx","handlingStrategy":"validation","validationCode":"if (!process.argv[3]) {\n  console.error('surface-brief path requires a concrete target');\n  process.exit(2);\n}","typeGuard":null,"tryCatchPattern":"const r = run('impeccable surface-brief path ' + target);\nif (r.code === 1 && /requires a concrete target/.test(r.stderr)) {\n  run('impeccable surface-brief list'); // pick a valid target\n}","preventionTips":["Always pass an explicit target to `surface-brief path`.","Confirm the brief exists with `surface-brief list` first.","Run `surface-brief write` before querying its path.","Quote target paths to avoid shell splitting."],"tags":["cli","usage","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"}