nexu-io/open-design · error · SystemExit

job {job_id} was not recorded as a built-in $imagegen output

Error message

job {job_id} was not recorded as a built-in $imagegen output; use record_imagegen_result.py with the selected $CODEX_HOME/generated_images/.../ig_*.png file

What it means

Raised by validate_completed_job_source when a job's source_provenance is none of the recognized values (synthetic_test_source, secondary_fallback, deterministic-mirror). The only remaining accepted value is 'built-in-imagegen', meaning the source was ingested from Codex's $CODEX_HOME/generated_images via record_imagegen_result.py.

Source

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

        if not allow_synthetic_test_sources:
            raise SystemExit(
                f"job {job_id} uses a synthetic test source; rerun with real $imagegen output"
            )
        validate_hash(job, source=source, output=output, job_id=job_id)
        return

    if job.get("secondary_fallback"):
        if job.get("source_provenance") != "secondary-fallback-image-api":
            raise SystemExit(f"job {job_id} has invalid secondary fallback provenance")
        validate_hash(job, source=source, output=output, job_id=job_id)
        return

    if job.get("source_provenance") == "deterministic-mirror":
        validate_mirror_hash(job, source=source, output=output, job_id=job_id)
        return

    if job.get("source_provenance") != "built-in-imagegen":
        raise SystemExit(
            f"job {job_id} was not recorded as a built-in $imagegen output; "
            "use record_imagegen_result.py with the selected $CODEX_HOME/generated_images/.../ig_*.png file"
        )
    if is_relative_to(source, run_dir):
        raise SystemExit(
            f"job {job_id} source image is inside the pet run directory; "
            "do not use locally generated row artifacts as visual sources"
        )
    generated_root = default_generated_images_root()
    if not is_relative_to(source, generated_root) or not source.name.startswith("ig_"):
        raise SystemExit(
            f"job {job_id} source image is not a built-in $imagegen output under "
            f"{generated_root}/.../ig_*.png"
        )
    validate_hash(job, source=source, output=output, job_id=job_id)


def require_complete_jobs(run_dir: Path, *, allow_synthetic_test_sources: bool) -> None:

View on GitHub (pinned to 5be4028344)

Solutions

  1. Run record_imagegen_result.py with the selected $CODEX_HOME/generated_images/.../ig_*.png file to set source_provenance='built-in-imagegen' and the source hashes.
  2. If the row genuinely used the fallback, run generate_pet_images.py so provenance becomes secondary-fallback-image-api.
  3. If the row is the running-left mirror, set source_provenance='deterministic-mirror' via the derive script.
Defensive patterns

Strategy: validation

Validate before calling

allowed = {None: False}  # must be one of the recognized provenances
if job.get('source_provenance') not in ('built-in-imagegen','secondary-fallback-image-api','deterministic-mirror') and not job.get('synthetic_test_source'):
    raise RuntimeError(f'job {job["id"]} has no recognized source_provenance')

Prevention

When it happens

Trigger: job['source_provenance'] is missing, misspelled, or set to an unrecognized string, and none of the synthetic/secondary/mirror branches fired.

Common situations: Hand-editing imagegen-jobs.json and forgetting source_provenance; a record_imagegen_result.py run that failed to set provenance; mixing an older manifest schema with the current finalize.

Related errors


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