{"record":{"id":"79e3584ffd3ecccb","repo":"nexu-io/open-design","slug":"unknown-row-job-id-state","errorCode":null,"errorMessage":"unknown row job id: {state}","messagePattern":"unknown row job id: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/queue_pet_repairs.py","lineNumber":137,"sourceCode":"            )\n        for key in [\n            \"source_path\",\n            \"source_provenance\",\n            \"source_sha256\",\n            \"output_sha256\",\n            \"completed_at\",\n            \"metadata\",\n            \"synthetic_test_source\",\n            \"secondary_fallback\",\n            \"derived_from\",\n            \"mirror_decision\",\n        ]:\n            job.pop(key, None)\n        result: dict[str, object] = {\"attempt\": attempt}\n        if archived_output is not None:\n            result[\"archived_output\"] = archived_output\n        return result\n    raise SystemExit(f\"unknown row job id: {state}\")\n\n\ndef main() -> None:\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument(\"--run-dir\", required=True)\n    parser.add_argument(\"--review\", default=\"\")\n    parser.add_argument(\"--repair-on-warnings\", action=\"store_true\")\n    args = parser.parse_args()\n\n    run_dir = Path(args.run_dir).expanduser().resolve()\n    review_path = (\n        Path(args.review).expanduser().resolve()\n        if args.review\n        else run_dir / \"qa\" / \"review.json\"\n    )\n    manifest_path = run_dir / \"imagegen-jobs.json\"\n    review = load_json(review_path)\n    manifest = load_json(manifest_path)","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/queue_pet_repairs.py#L119-L155","documentation":"Raised at the end of queue_repair() in queue_pet_repairs.py when no job in imagegen-jobs.json has id == state. The review asked to repair a row whose id is not present in the manifest, so the repair cannot be queued. Rows in the review that lack a matching job are silently skipped in rows_to_repair only if they fail the dict/state check; an unknown but well-formed state reaches here.","triggerScenarios":"The QA review references a state id (e.g. 'attack-2') that was never defined in the manifest; the manifest was regenerated with a different row set after the review; state id was renamed (e.g. 'walk' -> 'walk-cycle') but the review still uses the old name.","commonSituations":"Iterating on the row set between generate and repair; two run_dirs mixed up; copy-paste of a review from a different pet whose rows differ.","solutions":["List the valid state ids: jq '.jobs[].id' run_dir/imagegen-jobs.json.","Edit review.json so each rows[].state matches an existing job id, or drop the stale row.","If the manifest is the stale one, re-run prepare_pet_run.py --force with the intended row set and regenerate the review.","Confirm --run-dir points at the same run that produced the review."],"exampleFix":"# before: review has {\"state\": \"attack-2\"} but manifest only has \"attack\"\n# after:  edit review.json state to \"attack\" (or add the 'attack-2' job to the manifest)","handlingStrategy":"validation","validationCode":"valid_ids = {j.get(\"id\") for j in job_list(manifest)}\nunknown = [r[\"state\"] for r in repairs if r[\"state\"] not in valid_ids]\nif unknown:\n    raise SystemExit(f\"review references unknown row states: {unknown}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate review.json from the same manifest that defines the rows.","Re-run QA review whenever the row set changes.","Keep one run_dir per pet to avoid cross-pet state collisions."],"tags":["data-validation","cli","hatch-pet","schema"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}