{"record":{"id":"914e76649673a144","repo":"nexu-io/open-design","slug":"invalid-imagegen-jobs-json-jobs-must-be-a-list-914e76","errorCode":null,"errorMessage":"invalid imagegen-jobs.json: jobs must be a list","messagePattern":"invalid imagegen-jobs\\.json: jobs must be a list","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/queue_pet_repairs.py","lineNumber":66,"sourceCode":"    note = f\"\"\"\n\nRepair attempt {attempt}:\n- The previous `{state}` strip failed QA: {reason}\n- Regenerate the entire row, not just one pose.\n- Fill every requested frame slot with one complete centered full-body pet pose.\n- Keep large gaps of pure chroma key only between slots; do not leave a requested slot empty.\n- Avoid pose overlap, clipping, edge slivers, extra partial sprites, and detached fragments from neighboring poses.\n- Use the canonical base image and any original references listed in `imagegen-jobs.json` as grounding inputs.\n- Do not redesign the pet. Keep the exact same head shape, face design, markings, body proportions, palette, outline weight, materials, and props as the approved base pet.\n- If the contact sheet shows identity drift, repair only this row while preserving the canonical base identity.\n\"\"\"\n    prompt_path.write_text(existing.rstrip() + note.rstrip() + \"\\n\", encoding=\"utf-8\")\n\n\ndef job_list(manifest: dict[str, object]) -> list[dict[str, object]]:\n    jobs = manifest.get(\"jobs\")\n    if not isinstance(jobs, list):\n        raise SystemExit(\"invalid imagegen-jobs.json: jobs must be a list\")\n    return [job for job in jobs if isinstance(job, dict)]\n\n\ndef next_archive_path(archive_dir: Path, state: str, attempt: int, suffix: str) -> Path:\n    candidate = archive_dir / f\"{state}-attempt-{attempt}-previous{suffix}\"\n    if not candidate.exists():\n        return candidate\n    counter = 2\n    while True:\n        candidate = archive_dir / f\"{state}-attempt-{attempt}-previous-{counter}{suffix}\"\n        if not candidate.exists():\n            return candidate\n        counter += 1\n\n\ndef archive_decoded_output(run_dir: Path, job: dict[str, object], state: str, attempt: int) -> str | None:\n    output_raw = job.get(\"output_path\")\n    output = (","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/queue_pet_repairs.py#L48-L84","documentation":"Raised by job_list() in queue_pet_repairs.py when manifest.get('jobs') is not a list. The repair flow reads imagegen-jobs.json and expects jobs to be an array of job objects; any other shape (object, null, scalar) is treated as corruption rather than an empty job set.","triggerScenarios":"imagegen-jobs.json was hand-edited into an object keyed by id; a partial write left malformed JSON that still parsed but with the wrong top-level shape; a different tool wrote the manifest with a 'tasks' key instead of 'jobs'.","commonSituations":"Manual schema 'cleanup' that wrapped jobs in an object; downstream tool wrote the manifest with a 'tasks' key instead of 'jobs'; merge conflict resolved incorrectly.","solutions":["Re-run prepare_pet_run.py --force to regenerate a well-formed imagegen-jobs.json.","Validate the shape: jq '.jobs | type' imagegen-jobs.json must print 'array'.","If hand-editing, wrap the entries back into \"jobs\": [ ... ].","Restore imagegen-jobs.json from version control or the prepare step's output."],"exampleFix":"// before: {\"jobs\": {\"idle\": {...}}}\n// after:  {\"jobs\": [{\"id\": \"idle\", ...}]}","handlingStrategy":"type-guard","validationCode":"jobs = manifest.get(\"jobs\")\nif not isinstance(jobs, list):\n    raise SystemExit(\"imagegen-jobs.json 'jobs' must be an array; re-run prepare\")","typeGuard":"def has_array_jobs(manifest: object) -> bool:\n    return isinstance(manifest, dict) and isinstance(manifest.get(\"jobs\"), list)","tryCatchPattern":null,"preventionTips":["Never hand-wrap jobs as an object keyed by id; keep it an array.","Add a jsonschema check in CI for imagegen-jobs.json.","Version the manifest schema so producers stay aligned."],"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"}