{"record":{"id":"3422ab56f2471ffa","repo":"nexu-io/open-design","slug":"job-job-get-id-is-missing-required-grounding","errorCode":null,"errorMessage":"job {job.get('id')} is missing required grounding image(s): {', '.join(missing)}","messagePattern":"job (.+?) is missing required grounding image\\(s\\): (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/record_imagegen_result.py","lineNumber":123,"sourceCode":"\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):\n            raise SystemExit(f\"job {job.get('id')} has an invalid input image entry\")\n        path = run_dir / item[\"path\"]\n        if not path.is_file():\n            missing.append(str(path))\n    if missing:\n        raise SystemExit(\n            f\"job {job.get('id')} is missing required grounding image(s): \"\n            + \", \".join(missing)\n        )\n\n\ndef update_base_canonical_reference(\n    *,\n    run_dir: Path,\n    output: Path,\n    manifest: dict[str, object],\n    job: dict[str, object],\n    metadata: dict[str, object],\n) -> None:\n    if job.get(\"id\") != \"base\":\n        return\n\n    canonical = run_dir / CANONICAL_BASE_PATH\n    canonical.parent.mkdir(parents=True, exist_ok=True)","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/record_imagegen_result.py#L105-L141","documentation":"Raised by validate_required_grounding() in record_imagegen_result.py when one or more input_images paths do not resolve to existing files under run_dir. Grounding references must be present on disk so the imagegen job can actually use them; missing files are collected and reported together.","triggerScenarios":"input_images points at references/canonical-base.png that was never created (base job not yet recorded); references were deleted after prepare; path is case-mismatched on a case-sensitive filesystem.","commonSituations":"Recording a row job before the 'base' job (which produces canonical-base.png) was recorded; partial cleanup of run_dir/references; cross-platform path casing.","solutions":["Record the 'base' job first so references/canonical-base.png exists.","Run prepare_pet_run.py --force to repopulate run_dir/references.","Verify each path: for p in $(jq -r '.jobs[].input_images[].path' imagegen-jobs.json); do ls run_dir/$p; done.","Fix casing/typos in the input_images paths to match the files on disk."],"exampleFix":"# before: base job not yet recorded, references/canonical-base.png missing\n# after\nrecord_imagegen_result.py --job-id base --source ~/.codex/generated_images/.../ig_base.png\nrecord_imagegen_result.py --job-id idle --source ~/.codex/generated_images/.../ig_001.png","handlingStrategy":"validation","validationCode":"missing = [str(run_dir / item[\"path\"]) for item in inputs\n          if isinstance(item, dict) and isinstance(item.get(\"path\"), str)\n          and not (run_dir / item[\"path\"]).is_file()]\nif missing:\n    raise SystemExit(f\"missing grounding images: {missing}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Record the 'base' job before any grounded row job.","Never delete run_dir/references between runs.","Re-prepare with --force if references look incomplete."],"tags":["filesystem","cli","hatch-pet","validation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}