{"record":{"id":"203837fd5c8db613","repo":"nexu-io/open-design","slug":"file-not-found-path","errorCode":null,"errorMessage":"file not found: {path}","messagePattern":"file not found: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/queue_pet_repairs.py","lineNumber":15,"sourceCode":"#!/usr/bin/env python3\n\"\"\"Reopen failed Codex pet row jobs after frame QA.\"\"\"\n\nfrom __future__ import annotations\n\nimport argparse\nimport json\nimport shutil\nfrom datetime import datetime, timezone\nfrom pathlib import Path\n\n\ndef load_json(path: Path) -> dict[str, object]:\n    if not path.exists():\n        raise SystemExit(f\"file not found: {path}\")\n    return json.loads(path.read_text(encoding=\"utf-8\"))\n\n\ndef rows_to_repair(\n    review: dict[str, object], *, repair_on_warnings: bool\n) -> list[dict[str, object]]:\n    rows = review.get(\"rows\")\n    if not isinstance(rows, list):\n        raise SystemExit(\"review does not contain row-level results\")\n\n    repairs: list[dict[str, object]] = []\n    for row in rows:\n        if not isinstance(row, dict) or not isinstance(row.get(\"state\"), str):\n            continue\n        errors = row.get(\"errors\") if isinstance(row.get(\"errors\"), list) else []\n        warnings = row.get(\"warnings\") if isinstance(row.get(\"warnings\"), list) else []\n        if errors or (repair_on_warnings and warnings):\n            repairs.append(","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/queue_pet_repairs.py#L1-L33","documentation":"Raised by load_json() in queue_pet_repairs.py when the resolved JSON path (the --review file or run_dir/imagegen-jobs.json) does not exist on disk. It is the generic 'input file missing' guard used for both the QA review and the job manifest before any parsing.","triggerScenarios":"Calling queue_pet_repairs.py against a run_dir that was never prepared by prepare_pet_run.py (no imagegen-jobs.json); passing --review pointing at a nonexistent review.json; running from the wrong cwd so the default run_dir/qa/review.json resolves elsewhere.","commonSituations":"Trying to repair before the QA review step produced review.json; pointing --run-dir at a typo'd path; the manifest was deleted or moved after generation.","solutions":["Run prepare_pet_run.py first so run_dir/imagegen-jobs.json exists.","Run the QA review step so run_dir/qa/review.json exists (or pass --review <existing-path>).","Double-check the --run-dir value resolves to the prepared run directory.","If the file was deleted, regenerate it rather than creating an empty stub."],"exampleFix":"# before\nqueue_pet_repairs.py --run-dir /tmp/fenrir\n# after (ensure inputs exist first)\nprepare_pet_run.py --pet-name Fenrir --reference fenrir.png\n# ... run imagegen + QA review ...\nqueue_pet_repairs.py --run-dir /tmp/fenrir","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfor p in [review_path, manifest_path]:\n    if not Path(p).exists():\n        raise SystemExit(f\"missing input: {p}; run prepare_pet_run.py / QA review first\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run prepare_pet_run.py and the QA review before queue_pet_repairs.py.","Pin --run-dir with an absolute path.","Add a pipeline orchestrator that checks both files exist before invoking the repair step."],"tags":["filesystem","cli","hatch-pet","validation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}