nexu-io/open-design · error · SystemExit

job {job_id} decoded output is missing: {output}

Error message

job {job_id} decoded output is missing: {output}

What it means

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.

Source

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

    if not isinstance(raw, str) or not raw:
        raise SystemExit(f"job {job_id} has no {field}")
    path = Path(raw).expanduser()
    if not path.is_absolute():
        path = run_dir / path
    return path.resolve()


def validate_hash(job: dict[str, object], *, source: Path, output: Path, job_id: str) -> None:
    expected_hash = job.get("source_sha256")
    if not isinstance(expected_hash, str) or not expected_hash:
        raise SystemExit(
            f"job {job_id} is missing source_sha256; ingest visual outputs with "
            "record_imagegen_result.py instead of editing imagegen-jobs.json"
        )
    if not source.is_file():
        raise SystemExit(f"job {job_id} source image no longer exists: {source}")
    if not output.is_file():
        raise SystemExit(f"job {job_id} decoded output is missing: {output}")
    source_hash = file_sha256(source)
    output_hash = file_sha256(output)
    if source_hash != expected_hash:
        raise SystemExit(f"job {job_id} source image hash does not match imagegen-jobs.json")
    if output_hash != expected_hash:
        raise SystemExit(
            f"job {job_id} decoded output does not match its recorded source image; "
            "do not rewrite decoded visual outputs locally"
        )


def validate_mirror_hash(job: dict[str, object], *, source: Path, output: Path, job_id: str) -> None:
    if job_id != "running-left":
        raise SystemExit(f"job {job_id} may not use deterministic mirror provenance")
    if job.get("derived_from") != "running-right":
        raise SystemExit("running-left mirror job must derive from running-right")
    decision = job.get("mirror_decision")
    if not isinstance(decision, dict) or decision.get("approved") is not True:

View on GitHub (pinned to 5be4028344)

Solutions

  1. Re-run the decode/ingest step (record_imagegen_result.py) that produces decoded/<state>.png from the source.
  2. Verify --run-dir and that decoded/ is intact.
  3. Re-run finalize_pet_run.py.
Defensive patterns

Strategy: validation

Validate before calling

import json
from pathlib import Path

run_dir = Path("<run_dir>")
manifest = json.loads((run_dir / "imagegen-jobs.json").read_text())
for job in manifest["jobs"]:
    out = job.get("output_path")
    if isinstance(out, str) and not Path(out).is_absolute():
        out = run_dir / out
    if job.get("status") == "complete":
        assert Path(out).is_file(), f"decoded output missing for {job.get('id')}: {out}"

Prevention

When it happens

Trigger: decoded/ was cleaned, moved, or partially regenerated between ingest and finalize.

Common situations: rm on decoded/; a re-decode that only rewrote some states; --run-dir pointing at a copied tree missing decoded outputs.

Related errors


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