{"record":{"id":"8aca431d0af67075","repo":"nexu-io/open-design","slug":"job-manifest-not-found-path-8aca43","errorCode":null,"errorMessage":"job manifest not found: {path}","messagePattern":"job manifest not found: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/record_imagegen_result.py","lineNumber":21,"sourceCode":"\nfrom __future__ import annotations\n\nimport argparse\nimport hashlib\nimport json\nimport os\nimport shutil\nfrom datetime import datetime, timezone\nfrom pathlib import Path\n\nfrom PIL import Image\n\nCANONICAL_BASE_PATH = \"references/canonical-base.png\"\n\n\ndef load_jobs(path: Path) -> dict[str, object]:\n    if not path.exists():\n        raise SystemExit(f\"job manifest not found: {path}\")\n    return json.loads(path.read_text(encoding=\"utf-8\"))\n\n\ndef job_list(manifest: dict[str, object]) -> list[dict[str, object]]:\n    jobs = manifest.get(\"jobs\")\n    if not isinstance(jobs, list):\n        raise SystemExit(\"invalid imagegen-jobs.json: jobs must be a list\")\n    return [job for job in jobs if isinstance(job, dict)]\n\n\ndef find_job(manifest: dict[str, object], job_id: str) -> dict[str, object]:\n    for job in job_list(manifest):\n        if job.get(\"id\") == job_id:\n            return job\n    raise SystemExit(f\"unknown job id: {job_id}\")\n\n\ndef image_metadata(path: Path) -> dict[str, object]:","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/record_imagegen_result.py#L3-L39","documentation":"Raised by load_jobs() in record_imagegen_result.py when run_dir/imagegen-jobs.json does not exist. The recorder needs the manifest to find the job by --job-id, validate dependencies and grounding, and write the completion back, so a missing manifest is fatal before --source is even examined.","triggerScenarios":"Calling record_imagegen_result.py against a run_dir that was never prepared; --run-dir typo; the manifest was deleted or moved after generation.","commonSituations":"Trying to record an imagegen output before prepare_pet_run.py created the run; pointing at an old/renamed run_dir; clean checkout missing the generated artifacts.","solutions":["Run prepare_pet_run.py first so run_dir/imagegen-jobs.json exists.","Verify the path: ls run_dir/imagegen-jobs.json.","Confirm --run-dir resolves to the intended prepared run directory.","Restore the manifest from version control or re-run prepare with --force if the run is disposable."],"exampleFix":"# before\nrecord_imagegen_result.py --run-dir /tmp/fenrir --job-id idle --source ig_001.png\n# after (prepare first)\nprepare_pet_run.py --pet-name Fenrir --reference fenrir.png --output-dir /tmp/fenrir\nrecord_imagegen_result.py --run-dir /tmp/fenrir --job-id idle --source ig_001.png","handlingStrategy":"validation","validationCode":"from pathlib import Path\nmanifest_path = run_dir / \"imagegen-jobs.json\"\nif not manifest_path.exists():\n    raise SystemExit(f\"{manifest_path} missing; run prepare_pet_run.py first\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Establish a strict pipeline order: prepare -> imagegen -> record -> QA -> repair.","Wrap the recorder in a script that asserts the manifest exists before invoking.","Never move or delete imagegen-jobs.json mid-run."],"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"}