{"record":{"id":"8544d08e379e205f","repo":"nexu-io/open-design","slug":"job-job-id-uses-a-synthetic-test-source-rerun-w","errorCode":null,"errorMessage":"job {job_id} uses a synthetic test source; rerun with real $imagegen output","messagePattern":"job (.+?) uses a synthetic test source; rerun with real \\$imagegen output","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/finalize_pet_run.py","lineNumber":146,"sourceCode":") -> None:\n    job_id = str(job.get(\"id\") or \"\")\n    source = manifest_path(job.get(\"source_path\"), run_dir=run_dir, field=\"source_path\", job_id=job_id)\n    output = manifest_path(job.get(\"output_path\"), run_dir=run_dir, field=\"output_path\", job_id=job_id)\n\n    blocked_flags = [\n        flag\n        for flag in (\"deterministic_pet_row\", \"cute_raster_row\", \"local_raster_row\")\n        if job.get(flag)\n    ]\n    if blocked_flags:\n        raise SystemExit(\n            f\"job {job_id} was marked as a local/synthetic row ({', '.join(blocked_flags)}); \"\n            \"regenerate it with $imagegen\"\n        )\n\n    if job.get(\"synthetic_test_source\"):\n        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; \"","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/finalize_pet_run.py#L128-L164","documentation":"Raised when a job has synthetic_test_source truthy and the hidden --allow-synthetic-test-sources flag was not passed. The default behavior blocks synthetic test sources from shipping; the flag exists only for local tests and is suppressed in argparse help.","triggerScenarios":"job['synthetic_test_source'] is truthy AND finalize_pet_run.py was invoked without --allow-synthetic-test-sources.","commonSituations":"Running finalize against a manifest generated by a test harness that injects synthetic sources; forgetting to swap test sources for real $imagegen output before a real packaging run.","solutions":["For production: regenerate the job with real $imagegen output via record_imagegen_result.py so synthetic_test_source is cleared.","For local tests only: re-run finalize_pet_run.py --allow-synthetic-test-sources (the flag is intentionally hidden).","Audit the manifest to ensure no production job retains synthetic_test_source=true."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if job.get('synthetic_test_source') and not allow_synthetic:\n    raise RuntimeError(f'job {job[\"id\"]} uses a synthetic source; pass --allow-synthetic-test-sources for local tests only')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reserve --allow-synthetic-test-sources for local tests; never use it for packaged pets.","Regenerate synthetic-source jobs with real $imagegen output before packaging.","Strip synthetic_test_source from any manifest promoted to production."],"tags":["synthetic","test-mode","provenance","pet-pipeline"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}