{"record":{"id":"ef175f00a23f4e0e","repo":"pbakaus/impeccable","slug":"comp-spec-no-region-id","errorCode":null,"errorMessage":"comp-spec: no region {id}\n","messagePattern":"comp-spec: no region (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/comp-verbs/src/comp_spec.rs","lineNumber":814,"sourceCode":"        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>            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 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\"));\n            return 1;\n        };\n        io.out(&format!(\"{}\\n\", plate_prompt(&spec, region)));\n        return 0;\n    }\n    if let Some(id) = arg(argv, \"crop\") {\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))).cloned();\n        let Some(region) = region else {\n            let ids = spec.get(\"regions\").and_then(Value::as_array).map(|a| a.iter().filter_map(|r| r.get(\"id\").and_then(Value::as_str)).collect::<Vec<_>>().join(\", \")).unwrap_or_default();\n            io.err(&format!(\"comp-spec: no region {id}; ids: {ids}\\n\"));\n            return 1;\n        };\n        let comp_file = spec.get(\"comp\").and_then(Value::as_str).unwrap_or(\"\");\n        let comp = match png_io::load_raster(&resolve(io, comp_file)) {","sourceCodeStart":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/pbakaus/impeccable/blob/2bc2879276c1f321a53c4ca99d3371e411329b52/crates/comp-verbs/src/comp_spec.rs#L796-L832","documentation":"With a successfully loaded spec, `comp-spec --plate-prompt <id>` searches spec.regions for a region whose id matches. If no region has that id, it reports the unknown id and exits 1. The spec exists; the requested region identifier does not.","triggerScenarios":"`--plate-prompt <id>` (or similarly --crop <id>) with an id string that is not present in the spec's regions array — typo, case mismatch, or a region defined in the regions JSON but dropped during measurement.","commonSituations":"Region ids renamed in regions.json after the spec was generated (stale spec); typos like 'Art' vs 'art'; asking for a region from a different project's spec.","solutions":["Run `comp-spec --print` to list the region ids actually in the current spec.","Correct the id spelling/case to match an existing region.","If the region is new, update regions.json and regenerate: `comp-spec --comp <png> --regions <json>`.","Regenerate the spec if regions.json changed but spec.json did not."],"exampleFix":"// before\n$ impeccable comp-spec --plate-prompt Art\ncomp-spec: no region Art\n// after\n$ impeccable comp-spec --plate-prompt art   // id matches regions.json","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["cli","spec","region-id","lookup-failed"],"backgroundTag":"record-not-found","analyzedSha":"2bc2879276c1f321a53c4ca99d3371e411329b52","analyzedAt":"2026-09-08T04:51:14.109Z","contentChangedAt":"2026-09-08T04:51:14.109Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}