{"record":{"id":"a40893a15a47f56f","repo":"pbakaus/impeccable","slug":"comp-spec-no-spec-at-spec-path-run-with-comp","errorCode":null,"errorMessage":"comp-spec: no spec at {spec_path}; run with --comp <png> --regions <json> first\n","messagePattern":"comp-spec: no spec at (.+?); run with --comp <png> --regions <json> first\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/comp-verbs/src/comp_spec.rs","lineNumber":813,"sourceCode":"    if path.is_absolute() {\n        path.to_path_buf()\n    } else {\n        io.cwd.join(path)\n    }\n}\n\n// ---- CLI -------------------------------------------------------------------\n\n/// `impeccable comp-spec ...`\npub fn run(argv: &[String], io: &mut Io) -> i32 {\n    let spec_path = arg_or(argv, \"spec\", SPEC_PATH).to_string();\n    if flag(argv, \"help\") || argv.is_empty() {\n        io.out(\"usage: comp-spec.mjs --comp <png> --grid            write .impeccable/build/comp-grid.png (10x10 labeled grid) + palette + bands\\n       comp-spec.mjs --comp <png> --regions <json>  measure regions -> .impeccable/build/spec.json\\n         regions json: { \\\"regions\\\": [ { \\\"id\\\": \\\"art\\\", \\\"kind\\\": \\\"plate|image|texture|text|control|chrome\\\", \\\"grid\\\": \\\"E0:J4\\\", \\\"note\\\": \\\"...\\\" } ] }\\n       comp-spec.mjs --comp <png> --auto            band regions when you have no regions file\\n       comp-spec.mjs --print                        the compact spec\\n       comp-spec.mjs --crop <id> [--out f] [--scale n]   reference crop of a region (never a shipping asset)\\n       comp-spec.mjs --plate-prompt <id> [--background transparent|opaque|auto]  the regeneration prompt for a raster region\\n\");\n        return 0;\n    }\n    if flag(argv, \"print\") {\n        let Some(spec) = load_spec(&resolve(io, &spec_path)) else {\n            io.err(&format!(\"comp-spec: no spec at {spec_path}; run with --comp <png> --regions <json> first\\n\"));\n            return 1;\n        };\n        io.out(&format!(\"{}\\n\", print_spec(&spec)));\n        return 0;\n    }\n    if let Some(id) = arg(argv, \"plate-prompt\") {\n        let background = arg(argv, \"background\");\n        if flag(argv, \"background\") && !matches!(background, Some(\"transparent\" | \"opaque\" | \"auto\")) {\n            io.err(\"comp-spec: --background must be transparent, opaque, or auto.\\n\");\n            return 1;\n        }\n        let Some(spec) = load_spec(&resolve(io, &spec_path)) else {\n            io.err(&format!(\"comp-spec: no spec at {spec_path}\\n\"));\n            return 1;\n        };\n        let region = spec.get(\"regions\").and_then(Value::as_array).and_then(|a| a.iter().find(|r| r.get(\"id\").and_then(Value::as_str) == Some(id)));\n        let Some(region) = region else {\n            io.err(&format!(\"comp-spec: no region {id}\\n\"));","sourceCodeStart":795,"sourceCodeEnd":831,"githubUrl":"https://github.com/pbakaus/impeccable/blob/f2c7051853848826aac2f4646581d62a732155ad/crates/comp-verbs/src/comp_spec.rs#L795-L831","documentation":"`comp-spec --print` loads the previously generated spec from spec_path and prints it compactly. If load_spec returns None (the spec file does not exist or is unreadable), it tells the user no spec exists at that path and to generate one first with `--comp <png> --regions <json>`. Exit code 1.","triggerScenarios":"Running `comp-spec --print` (and no other mode flags) before ever running the measuring mode; or with a custom spec path (spec_path set via --spec) where nothing was saved; or after the .impeccable/build directory was cleaned.","commonSituations":"Fresh clone / clean checkout where .impeccable/build was gitignored away; running --print from a different working directory so the default spec path doesn't resolve; a `clean` step removed build artifacts between measure and print.","solutions":["Generate the spec first: `impeccable comp-spec --comp <png> --regions <regions.json>`.","Then run `comp-spec --print` (optionally with the same --spec path used at generation).","Run from the same working directory used when the spec was created, or pass an explicit --spec path.","Check that .impeccable/build/spec.json survived any clean steps."],"exampleFix":"// before\n$ impeccable comp-spec --print\ncomp-spec: no spec at .impeccable/build/spec.json; run with --comp <png> --regions <json> first\n// after\n$ impeccable comp-spec --comp ./comp.png --regions ./regions.json\n$ impeccable comp-spec --print","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["cli","spec","missing-file","workflow-order"],"backgroundTag":"file-not-found","analyzedSha":"f2c7051853848826aac2f4646581d62a732155ad","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}