{"record":{"id":"c4b036426001aba1","repo":"nexu-io/open-design","slug":"job-job-id-decoded-output-is-missing-output","errorCode":null,"errorMessage":"job {job_id} decoded output is missing: {output}","messagePattern":"job (.+?) decoded output is missing: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/finalize_pet_run.py","lineNumber":69,"sourceCode":"    if not isinstance(raw, str) or not raw:\n        raise SystemExit(f\"job {job_id} has no {field}\")\n    path = Path(raw).expanduser()\n    if not path.is_absolute():\n        path = run_dir / path\n    return path.resolve()\n\n\ndef validate_hash(job: dict[str, object], *, source: Path, output: Path, job_id: str) -> None:\n    expected_hash = job.get(\"source_sha256\")\n    if not isinstance(expected_hash, str) or not expected_hash:\n        raise SystemExit(\n            f\"job {job_id} is missing source_sha256; ingest visual outputs with \"\n            \"record_imagegen_result.py instead of editing imagegen-jobs.json\"\n        )\n    if not source.is_file():\n        raise SystemExit(f\"job {job_id} source image no longer exists: {source}\")\n    if not output.is_file():\n        raise SystemExit(f\"job {job_id} decoded output is missing: {output}\")\n    source_hash = file_sha256(source)\n    output_hash = file_sha256(output)\n    if source_hash != expected_hash:\n        raise SystemExit(f\"job {job_id} source image hash does not match imagegen-jobs.json\")\n    if output_hash != expected_hash:\n        raise SystemExit(\n            f\"job {job_id} decoded output does not match its recorded source image; \"\n            \"do not rewrite decoded visual outputs locally\"\n        )\n\n\ndef validate_mirror_hash(job: dict[str, object], *, source: Path, output: Path, job_id: str) -> None:\n    if job_id != \"running-left\":\n        raise SystemExit(f\"job {job_id} may not use deterministic mirror provenance\")\n    if job.get(\"derived_from\") != \"running-right\":\n        raise SystemExit(\"running-left mirror job must derive from running-right\")\n    decision = job.get(\"mirror_decision\")\n    if not isinstance(decision, dict) or decision.get(\"approved\") is not True:","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/finalize_pet_run.py#L51-L87","documentation":"The decoded output (decoded/<state>.png) recorded in output_path no longer exists. finalize re-hashes the decoded output against the source, so a missing decoded file aborts the run.","triggerScenarios":"decoded/ was cleaned, moved, or partially regenerated between ingest and finalize.","commonSituations":"rm on decoded/; a re-decode that only rewrote some states; --run-dir pointing at a copied tree missing decoded outputs.","solutions":["Re-run the decode/ingest step (record_imagegen_result.py) that produces decoded/<state>.png from the source.","Verify --run-dir and that decoded/ is intact.","Re-run finalize_pet_run.py."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import json\nfrom pathlib import Path\n\nrun_dir = Path(\"<run_dir>\")\nmanifest = json.loads((run_dir / \"imagegen-jobs.json\").read_text())\nfor job in manifest[\"jobs\"]:\n    out = job.get(\"output_path\")\n    if isinstance(out, str) and not Path(out).is_absolute():\n        out = run_dir / out\n    if job.get(\"status\") == \"complete\":\n        assert Path(out).is_file(), f\"decoded output missing for {job.get('id')}: {out}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never delete decoded/ outputs after ingest.","If re-decoding, regenerate every state's output, not just some.","Run finalize in the same run tree where ingest wrote decoded/."],"tags":["hatch-pet","filesystem","decoded","missing-file"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}