{"record":{"id":"102b5ed9a9ad516d","repo":"nexu-io/open-design","slug":"source-image-does-not-look-like-a-built-in-imageg","errorCode":null,"errorMessage":"source image does not look like a built-in $imagegen output; expected {generated_root}/.../ig_*.png. Do not ingest locally drawn or post-processed row strips as visual job outputs.","messagePattern":"source image does not look like a built-in \\$imagegen output; expected (.+?)/\\.\\.\\./ig_\\*\\.png\\. Do not ingest locally drawn or post-processed row strips as visual job outputs\\.","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/record_imagegen_result.py","lineNumber":99,"sourceCode":"    return codex_home / \"generated_images\"\n\n\ndef validate_source_path(\n    *,\n    source: Path,\n    run_dir: Path,\n    allow_synthetic_test_source: bool,\n) -> str:\n    if allow_synthetic_test_source:\n        return \"synthetic-test\"\n    if is_relative_to(source, run_dir):\n        raise SystemExit(\n            \"source image is inside the pet run directory; record the original \"\n            \"$imagegen output from $CODEX_HOME/generated_images/.../ig_*.png instead\"\n        )\n    generated_root = default_generated_images_root()\n    if not is_relative_to(source, generated_root) or not source.name.startswith(\"ig_\"):\n        raise SystemExit(\n            \"source image does not look like a built-in $imagegen output; expected \"\n            f\"{generated_root}/.../ig_*.png. Do not ingest locally drawn or \"\n            \"post-processed row strips as visual job outputs.\"\n        )\n    return \"built-in-imagegen\"\n\n\ndef validate_required_grounding(job: dict[str, object], run_dir: Path) -> None:\n    if job.get(\"allow_prompt_only_generation\") is not False:\n        return\n    inputs = job.get(\"input_images\")\n    if not isinstance(inputs, list) or not inputs:\n        raise SystemExit(\n            f\"job {job.get('id')} does not list input_images; grounded row jobs must attach references\"\n        )\n    missing = []\n    for item in inputs:\n        if not isinstance(item, dict) or not isinstance(item.get(\"path\"), str):","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/record_imagegen_result.py#L81-L117","documentation":"Raised by validate_source_path() in record_imagegen_result.py when the --source is not inside $CODEX_HOME/generated_images or its filename does not start with 'ig_'. The recorder only accepts built-in $imagegen outputs (or explicit synthetic test sources) so locally drawn or post-processed strips cannot be ingested as job results.","triggerScenarios":"Passing a hand-drawn PNG from ~/Desktop; a re-saved/exported copy that lost the ig_ prefix; $CODEX_HOME is unset so default_generated_images_root() resolves to ~/.codex/generated_images while the real outputs live elsewhere.","commonSituations":"User edited the imagegen output in Photoshop and tries to record the edit; CODEX_HOME overridden in a container so the path check fails; file was renamed after generation.","solutions":["Locate the original ig_*.png under your generated_images root and pass that path.","Ensure $CODEX_HOME matches the environment $imagegen actually wrote to.","Do not rename the imagegen output before recording; keep the ig_ prefix.","For test fixtures only, use --allow-synthetic-test-source."],"exampleFix":"# before\n--source ~/Desktop/touched-up.png\n# after\nCODEX_HOME=~/.codex record_imagegen_result.py --source ~/.codex/generated_images/.../ig_001.png","handlingStrategy":"validation","validationCode":"from pathlib import Path, os\ngen_root = Path(os.environ.get(\"CODEX_HOME\") or \"~/.codex\").expanduser().resolve()\ntry:\n    source.resolve().relative_to(gen_root)\nexcept ValueError:\n    raise SystemExit(f\"source not under {gen_root}/generated_images/ig_*.png\")\nif not source.name.startswith(\"ig_\"):\n    raise SystemExit(\"source filename must start with ig_\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep $CODEX_HOME consistent between imagegen and record.","Never rename ig_*.png outputs before recording.","Do not post-process before recording; record the raw imagegen output."],"tags":["filesystem","cli","hatch-pet","provenance"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}