{"record":{"id":"8ccb99e43a7a744e","repo":"nexu-io/open-design","slug":"running-left-mirror-output-must-be-decoded-running","errorCode":null,"errorMessage":"running-left mirror output must be decoded/running-left.png","messagePattern":"running-left mirror output must be decoded/running-left\\.png","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/finalize_pet_run.py","lineNumber":106,"sourceCode":"        raise SystemExit(\n            \"running-left mirror job is missing an approved mirror_decision; \"\n            \"use derive_running_left_from_running_right.py after visual review\"\n        )\n\n    expected_source_hash = job.get(\"source_sha256\")\n    expected_output_hash = job.get(\"output_sha256\")\n    if not isinstance(expected_source_hash, str) or not expected_source_hash:\n        raise SystemExit(\"running-left mirror job is missing source_sha256\")\n    if not isinstance(expected_output_hash, str) or not expected_output_hash:\n        raise SystemExit(\"running-left mirror job is missing output_sha256\")\n    if not source.is_file():\n        raise SystemExit(f\"running-left mirror source image no longer exists: {source}\")\n    if not output.is_file():\n        raise SystemExit(f\"running-left mirrored output is missing: {output}\")\n    if source.name != \"running-right.png\" or source.parent.name != \"decoded\":\n        raise SystemExit(\"running-left mirror source must be decoded/running-right.png\")\n    if output.name != \"running-left.png\" or output.parent.name != \"decoded\":\n        raise SystemExit(\"running-left mirror output must be decoded/running-left.png\")\n    if file_sha256(source) != expected_source_hash:\n        raise SystemExit(\"running-left mirror source hash does not match imagegen-jobs.json\")\n    if file_sha256(output) != expected_output_hash:\n        raise SystemExit(\n            \"running-left mirrored output hash does not match imagegen-jobs.json; \"\n            \"rerun derive_running_left_from_running_right.py\"\n        )\n    with Image.open(source) as source_image, Image.open(output) as output_image:\n        expected = ImageOps.mirror(source_image.convert(\"RGBA\"))\n        actual = output_image.convert(\"RGBA\")\n        if expected.size != actual.size or expected.tobytes() != actual.tobytes():\n            raise SystemExit(\n                \"running-left mirrored output is not an exact horizontal mirror of running-right\"\n            )\n\n\ndef validate_completed_job_source(\n    job: dict[str, object],","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/finalize_pet_run.py#L88-L124","documentation":"Raised by validate_mirror_hash when the running-left job's output_path does not point at decoded/running-left.png. The finalize stage consumes the decoded/ sibling, so the manifest's output location is contract-locked to that exact filename and parent.","triggerScenarios":"job['output_path'] resolves to a path whose .name != 'running-left.png' or whose parent .name != 'decoded'. Caused by manifest edits or a derive script that wrote to the wrong directory.","commonSituations":"Manually correcting imagegen-jobs.json after moving files; output_path left pointing at raw/running-left.png from an intermediate step.","solutions":["Update the running-left job's output_path in imagegen-jobs.json to decoded/running-left.png.","Re-run derive_running_left_from_running_right.py so it writes the file and records the canonical output_path.","Verify the file actually exists at the corrected location before re-running finalize."],"exampleFix":"// before (imagegen-jobs.json)\n\"output_path\": \"raw/running-left.png\"\n// after\n\"output_path\": \"decoded/running-left.png\"","handlingStrategy":"validation","validationCode":"output = (run_dir / job['output_path']).resolve()\nif output.name != 'running-left.png' or output.parent.name != 'decoded':\n    raise ValueError('mirror output must be decoded/running-left.png')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate the mirror via derive_running_left_from_running_right.py to keep output_path canonical.","Do not relocate decoded artifacts between derive and finalize.","Lint every mirror job's output_path before running finalize."],"tags":["manifest","mirror","path-validation","pet-pipeline"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}