{"record":{"id":"3a26e327d34ec71b","repo":"nexu-io/open-design","slug":"running-right-decoded-strip-not-found-source","errorCode":null,"errorMessage":"running-right decoded strip not found: {source}","messagePattern":"running-right decoded strip not found: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/derive_running_left_from_running_right.py","lineNumber":96,"sourceCode":"    if not args.decision_note.strip():\n        raise SystemExit(\"--decision-note must explain why mirroring is appropriate\")\n\n    run_dir = Path(args.run_dir).expanduser().resolve()\n    manifest_path = run_dir / \"imagegen-jobs.json\"\n    manifest = load_manifest(run_dir)\n    right_job = find_job(manifest, \"running-right\")\n    left_job = find_job(manifest, \"running-left\")\n\n    if right_job.get(\"status\") != \"complete\":\n        raise SystemExit(\"running-right must be complete before deriving running-left\")\n    mirror_policy = left_job.get(\"mirror_policy\")\n    if not isinstance(mirror_policy, dict) or mirror_policy.get(\"may_derive_from\") != \"running-right\":\n        raise SystemExit(\"running-left is not configured for conditional mirroring\")\n\n    source = run_dir / \"decoded\" / \"running-right.png\"\n    output = run_dir / \"decoded\" / \"running-left.png\"\n    if not source.is_file():\n        raise SystemExit(f\"running-right decoded strip not found: {source}\")\n    if output.exists() and not args.force:\n        raise SystemExit(f\"{output} already exists; pass --force to replace it\")\n\n    output.parent.mkdir(parents=True, exist_ok=True)\n    with Image.open(source) as image:\n        mirrored = ImageOps.mirror(image.convert(\"RGBA\"))\n        mirrored.save(output)\n\n    left_job[\"status\"] = \"complete\"\n    left_job[\"source_path\"] = manifest_relative(source, run_dir)\n    left_job[\"source_provenance\"] = \"deterministic-mirror\"\n    left_job[\"derived_from\"] = \"running-right\"\n    left_job[\"source_sha256\"] = file_sha256(source)\n    left_job[\"output_sha256\"] = file_sha256(output)\n    left_job[\"completed_at\"] = datetime.now(timezone.utc).isoformat()\n    left_job[\"metadata\"] = image_metadata(output)\n    left_job[\"mirror_decision\"] = {\n        \"approved\": True,","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/derive_running_left_from_running_right.py#L78-L114","documentation":"The manifest says running-right is complete, but the file <run_dir>/decoded/running-right.png does not exist on disk. The derive step needs the actual decoded PNG to mirror it, so a complete status with a missing file is treated as a corrupted/interrupted run.","triggerScenarios":"Calling the derive script when <run_dir>/decoded/running-right.png is absent — deleted, never decoded, or --run-dir points at the wrong directory.","commonSituations":"Someone cleaned the decoded/ folder between ingest and derive; the decode step that writes decoded/*.png failed or was skipped; --run-dir points at a stale or copied run tree.","solutions":["Verify the path: ls <run_dir>/decoded/running-right.png.","If missing, re-run the decode/ingest step (record_imagegen_result.py) that writes decoded/running-right.png from the source ig_*.png.","Confirm --run-dir resolves to the correct run directory.","Re-run the derive script."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nrun_dir = Path(\"<run_dir>\")\nsource = run_dir / \"decoded\" / \"running-right.png\"\nif not source.is_file():\n    raise FileNotFoundError(f\"decode/ingest did not produce {source}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm decoded/running-right.png exists before invoking the derive script.","Do not delete decoded/ between ingest and derive.","Always pass the absolute --run-dir to avoid resolving against the wrong cwd."],"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"}