{"record":{"id":"11b0f2245d6a5aa1","repo":"nexu-io/open-design","slug":"pet-id-must-contain-at-least-one-letter-or-digit","errorCode":null,"errorMessage":"pet id must contain at least one letter or digit","messagePattern":"pet id must contain at least one letter or digit","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/prepare_pet_run.py","lineNumber":574,"sourceCode":"    parser.add_argument(\n        \"--chroma-key\",\n        default=\"auto\",\n        help=\"Chroma key as #RRGGBB, or auto to choose a safe key from reference colors.\",\n    )\n    parser.add_argument(\"--force\", action=\"store_true\")\n    args = parser.parse_args()\n\n    raw_reference_paths = [\n        Path(raw_path).expanduser().resolve() for raw_path in args.reference\n    ]\n\n    args.display_name = infer_name(args, raw_reference_paths)\n    args.pet_name = (args.pet_name or args.display_name).strip()\n    args.description = infer_description(args, raw_reference_paths)\n    args.pet_notes = infer_pet_notes(args, raw_reference_paths)\n    args.pet_id = slugify(args.pet_id or args.pet_name or args.display_name)\n    if not args.pet_id:\n        raise SystemExit(\"pet id must contain at least one letter or digit\")\n\n    run_dir = (\n        Path(args.output_dir).expanduser().resolve()\n        if args.output_dir\n        else default_output_dir(args.pet_id).resolve()\n    )\n    if run_dir.exists() and any(run_dir.iterdir()) and not args.force:\n        raise SystemExit(\n            f\"{run_dir} already exists and is not empty; pass --force to reuse it\"\n        )\n    run_dir.mkdir(parents=True, exist_ok=True)\n\n    ref_dir = run_dir / \"references\"\n    prompt_dir = run_dir / \"prompts\"\n    row_prompt_dir = prompt_dir / \"rows\"\n    for directory in [\n        ref_dir,\n        prompt_dir,","sourceCodeStart":556,"sourceCodeEnd":592,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/prepare_pet_run.py#L556-L592","documentation":"Raised by prepare_pet_run.py main() when args.pet_id slugifies to empty after combining --pet-id, --pet-name, and --display-name. slugify discards every character that is not [a-z0-9], so if all three names consist only of symbols/whitespace/emojis, no usable id remains and the run dir cannot be named.","triggerScenarios":"Passing --pet-name \"★★★\" and no --pet-id; passing --pet-id \"---\" and no usable name; all of --pet-id/--pet-name/--display-name empty or symbolic and no reference image filename that supplies a fallback name.","commonSituations":"Emoji-only or symbol-only pet names; empty shell variables expanded into all three flags; names in scripts whose only alphanumerics were stripped by slugify.","solutions":["Give the pet a name containing at least one ASCII letter or digit via --pet-id, --pet-name, or --display-name.","If using a reference image, ensure its filename has alphanumerics so infer_name can derive a fallback.","Avoid purely symbolic or emoji-only identifiers.","Re-run prepare_pet_run.py."],"exampleFix":"// before\npython prepare_pet_run.py --pet-name \"★\" --reference cat.png\n# SystemExit: pet id must contain at least one letter or digit\n\n// after\npython prepare_pet_run.py --pet-name \"Star\" --reference cat.png","handlingStrategy":"validation","validationCode":"import re\n\ndef slugify(value: str) -> str:\n    value = value.strip().lower()\n    value = re.sub(r\"[^a-z0-9]+\", \"-\", value)\n    value = re.sub(r\"-{2,}\", \"-\", value)\n    return value.strip(\"-\")\n\npet_id = slugify(args.pet_id or args.pet_name or args.display_name)\nif not pet_id:\n    raise SystemExit(\"pet id must contain at least one letter or digit\")","typeGuard":"def slug_is_valid(value: str) -> bool:\n    import re\n    s = re.sub(r\"[^a-z0-9]+\", \"-\", value.strip().lower()).strip(\"-\")\n    return bool(s)","tryCatchPattern":null,"preventionTips":["Supply a pet id/name with at least one ASCII letter or digit.","When relying on reference image filenames for fallback names, ensure they contain alphanumerics.","Avoid emoji-only or punctuation-only identifiers."],"tags":["cli","slugify","validation","system-exit"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}