{"record":{"id":"0ca00d5028b58930","repo":"nexu-io/open-design","slug":"running-left-mirrored-output-hash-does-not-match-i","errorCode":null,"errorMessage":"running-left mirrored output hash does not match imagegen-jobs.json; rerun derive_running_left_from_running_right.py","messagePattern":"running-left mirrored output hash does not match imagegen-jobs\\.json; rerun derive_running_left_from_running_right\\.py","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/finalize_pet_run.py","lineNumber":110,"sourceCode":"\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],\n    *,\n    run_dir: Path,\n    allow_synthetic_test_sources: bool,\n) -> None:","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/finalize_pet_run.py#L92-L128","documentation":"Raised by validate_mirror_hash when the SHA-256 of decoded/running-left.png (output) does not equal job['output_sha256']. The error message itself prescribes the fix: rerun the deterministic derive script so the recorded hash and the file agree.","triggerScenarios":"file_sha256(output) != job['output_sha256'] for the running-left mirror job. The output file was modified, partially rewritten, or the manifest's output_sha256 is stale relative to the current file.","commonSituations":"Manual edits to running-left.png in an image editor; an interrupted derive run that left a truncated PNG; re-running the derive script but failing to persist the new output_sha256 into imagegen-jobs.json.","solutions":["Run derive_running_left_from_running_right.py --run-dir <run_dir>; it recomputes and stores output_sha256.","Confirm no other process is writing to decoded/running-left.png concurrently.","Re-run finalize_pet_run.py once the recorded hash matches the file."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if sha256(output) != job['output_sha256']:\n    # re-derive instead of editing the hash by hand\n    raise RuntimeError('running-left.png hash stale; rerun derive_running_left_from_running_right.py')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always regenerate running-left via the derive script rather than editing output_sha256 by hand.","Ensure the derive script runs to completion (it writes both the file and the manifest).","Do not open/save decoded/running-left.png in an image editor."],"tags":["integrity","sha256","mirror","pet-pipeline"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}