nexu-io/open-design · error · SystemExit

running-left mirrored output hash does not match imagegen-jo

Error message

running-left mirrored output hash does not match imagegen-jobs.json; rerun derive_running_left_from_running_right.py

What it means

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.

Source

Thrown at skills/hatch-pet/scripts/finalize_pet_run.py:110

    expected_source_hash = job.get("source_sha256")
    expected_output_hash = job.get("output_sha256")
    if not isinstance(expected_source_hash, str) or not expected_source_hash:
        raise SystemExit("running-left mirror job is missing source_sha256")
    if not isinstance(expected_output_hash, str) or not expected_output_hash:
        raise SystemExit("running-left mirror job is missing output_sha256")
    if not source.is_file():
        raise SystemExit(f"running-left mirror source image no longer exists: {source}")
    if not output.is_file():
        raise SystemExit(f"running-left mirrored output is missing: {output}")
    if source.name != "running-right.png" or source.parent.name != "decoded":
        raise SystemExit("running-left mirror source must be decoded/running-right.png")
    if output.name != "running-left.png" or output.parent.name != "decoded":
        raise SystemExit("running-left mirror output must be decoded/running-left.png")
    if file_sha256(source) != expected_source_hash:
        raise SystemExit("running-left mirror source hash does not match imagegen-jobs.json")
    if file_sha256(output) != expected_output_hash:
        raise SystemExit(
            "running-left mirrored output hash does not match imagegen-jobs.json; "
            "rerun derive_running_left_from_running_right.py"
        )
    with Image.open(source) as source_image, Image.open(output) as output_image:
        expected = ImageOps.mirror(source_image.convert("RGBA"))
        actual = output_image.convert("RGBA")
        if expected.size != actual.size or expected.tobytes() != actual.tobytes():
            raise SystemExit(
                "running-left mirrored output is not an exact horizontal mirror of running-right"
            )


def validate_completed_job_source(
    job: dict[str, object],
    *,
    run_dir: Path,
    allow_synthetic_test_sources: bool,
) -> None:

View on GitHub (pinned to 5be4028344)

Solutions

  1. Run derive_running_left_from_running_right.py --run-dir <run_dir>; it recomputes and stores output_sha256.
  2. Confirm no other process is writing to decoded/running-left.png concurrently.
  3. Re-run finalize_pet_run.py once the recorded hash matches the file.
Defensive patterns

Strategy: validation

Validate before calling

if sha256(output) != job['output_sha256']:
    # re-derive instead of editing the hash by hand
    raise RuntimeError('running-left.png hash stale; rerun derive_running_left_from_running_right.py')

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/0ca00d5028b58930. Report an issue: GitHub.