{"record":{"id":"f9886cdff072c2ca","repo":"nexu-io/open-design","slug":"job-job-id-was-not-recorded-as-a-built-in-image","errorCode":null,"errorMessage":"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","messagePattern":"job (.+?) was not recorded as a built-in \\$imagegen output; use record_imagegen_result\\.py with the selected \\$CODEX_HOME/generated_images/\\.\\.\\./ig_\\*\\.png file","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/finalize_pet_run.py","lineNumber":163,"sourceCode":"        if not allow_synthetic_test_sources:\n            raise SystemExit(\n                f\"job {job_id} uses a synthetic test source; rerun with real $imagegen output\"\n            )\n        validate_hash(job, source=source, output=output, job_id=job_id)\n        return\n\n    if job.get(\"secondary_fallback\"):\n        if job.get(\"source_provenance\") != \"secondary-fallback-image-api\":\n            raise SystemExit(f\"job {job_id} has invalid secondary fallback provenance\")\n        validate_hash(job, source=source, output=output, job_id=job_id)\n        return\n\n    if job.get(\"source_provenance\") == \"deterministic-mirror\":\n        validate_mirror_hash(job, source=source, output=output, job_id=job_id)\n        return\n\n    if job.get(\"source_provenance\") != \"built-in-imagegen\":\n        raise SystemExit(\n            f\"job {job_id} was not recorded as a built-in $imagegen output; \"\n            \"use record_imagegen_result.py with the selected $CODEX_HOME/generated_images/.../ig_*.png file\"\n        )\n    if is_relative_to(source, run_dir):\n        raise SystemExit(\n            f\"job {job_id} source image is inside the pet run directory; \"\n            \"do not use locally generated row artifacts as visual sources\"\n        )\n    generated_root = default_generated_images_root()\n    if not is_relative_to(source, generated_root) or not source.name.startswith(\"ig_\"):\n        raise SystemExit(\n            f\"job {job_id} source image is not a built-in $imagegen output under \"\n            f\"{generated_root}/.../ig_*.png\"\n        )\n    validate_hash(job, source=source, output=output, job_id=job_id)\n\n\ndef require_complete_jobs(run_dir: Path, *, allow_synthetic_test_sources: bool) -> None:","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/finalize_pet_run.py#L145-L181","documentation":"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.","triggerScenarios":"job['source_provenance'] is missing, misspelled, or set to an unrecognized string, and none of the synthetic/secondary/mirror branches fired.","commonSituations":"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.","solutions":["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.","If the row genuinely used the fallback, run generate_pet_images.py so provenance becomes secondary-fallback-image-api.","If the row is the running-left mirror, set source_provenance='deterministic-mirror' via the derive script."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"allowed = {None: False}  # must be one of the recognized provenances\nif job.get('source_provenance') not in ('built-in-imagegen','secondary-fallback-image-api','deterministic-mirror') and not job.get('synthetic_test_source'):\n    raise RuntimeError(f'job {job[\"id\"]} has no recognized source_provenance')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always ingest sources through record_imagegen_result.py so provenance is set correctly.","Treat source_provenance as a required field in any manifest lint.","Do not rename provenance values when refactoring the schema."],"tags":["manifest","provenance","imagegen","pet-pipeline"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}