nexu-io/open-design · error · SystemExit

row prompt not found: {prompt_path}

Error message

row prompt not found: {prompt_path}

What it means

Raised by append_repair_note() in queue_pet_repairs.py when run_dir/prompts/rows/{state}.md does not exist. Repair queuing appends a structured 'Repair attempt N' brief to the row's prompt file, so a missing prompt file means the run was never fully prepared or the state id does not match any prompt.

Source

Thrown at skills/hatch-pet/scripts/queue_pet_repairs.py:46

        if not isinstance(row, dict) or not isinstance(row.get("state"), str):
            continue
        errors = row.get("errors") if isinstance(row.get("errors"), list) else []
        warnings = row.get("warnings") if isinstance(row.get("warnings"), list) else []
        if errors or (repair_on_warnings and warnings):
            repairs.append(
                {
                    "state": row["state"],
                    "reason": "; ".join(str(item) for item in [*errors, *warnings])
                    or "the row did not pass visual QA",
                }
            )
    return repairs


def append_repair_note(run_dir: Path, state: str, attempt: int, reason: str) -> None:
    prompt_path = run_dir / "prompts" / "rows" / f"{state}.md"
    if not prompt_path.exists():
        raise SystemExit(f"row prompt not found: {prompt_path}")
    existing = prompt_path.read_text(encoding="utf-8")
    note = f"""

Repair attempt {attempt}:
- The previous `{state}` strip failed QA: {reason}
- Regenerate the entire row, not just one pose.
- Fill every requested frame slot with one complete centered full-body pet pose.
- Keep large gaps of pure chroma key only between slots; do not leave a requested slot empty.
- Avoid pose overlap, clipping, edge slivers, extra partial sprites, and detached fragments from neighboring poses.
- Use the canonical base image and any original references listed in `imagegen-jobs.json` as grounding inputs.
- 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.
- If the contact sheet shows identity drift, repair only this row while preserving the canonical base identity.
"""
    prompt_path.write_text(existing.rstrip() + note.rstrip() + "\n", encoding="utf-8")


def job_list(manifest: dict[str, object]) -> list[dict[str, object]]:
    jobs = manifest.get("jobs")

View on GitHub (pinned to 5be4028344)

Solutions

  1. Re-run prepare_pet_run.py --force so every prompts/rows/<state>.md is regenerated.
  2. Check the exact state string in review.json matches a filename under run_dir/prompts/rows/.
  3. If only one prompt is missing, copy a sibling prompt and rename it to the missing state as a stopgap, then re-run prepare.
  4. Verify the row's state id in imagegen-jobs.json matches the review's state field.

Example fix

# before: review references state='leap' but file is run.png
# after: align review state to 'run' or regenerate the 'leap' prompt via prepare
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
prompt_path = run_dir / "prompts" / "rows" / f"{state}.md"
if not prompt_path.exists():
    raise SystemExit(f"missing {prompt_path}; re-run prepare_pet_run.py --force")

Prevention

When it happens

Trigger: The repair review references a state (e.g. 'jump') whose prompt file was not generated; someone deleted prompts/rows/; the state string casing/spelling differs from the generated filename.

Common situations: Prepare step was interrupted after writing the manifest but before writing row prompts; row set was edited in the manifest after prepare; cross-platform case-sensitivity mismatch on the state id.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/948110ae4ee6c7db. Report an issue: GitHub.