{"record":{"id":"28465af1249aa025","repo":"affaan-m/ECC","slug":"asset-output-already-exists-choose-a-new-name-path","errorCode":null,"errorMessage":"asset output already exists; choose a new --name: {path}","messagePattern":"asset output already exists; choose a new --name: (.+?)","errorType":"exception","errorClass":"FileExistsError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/mint3d.py","lineNumber":84,"sourceCode":"    asset = name if name is not None else \"prop_\" + (words[0] if words else \"lifted\")\n    if (not asset or asset in {\".\", \"..\"} or len(asset) > 120\n            or any(not (c.isalnum() or c in \"_-. \") for c in asset)\n            or asset != asset.strip()):\n        raise ValueError(\"asset name must be a simple filename stem (letters, digits, spaces, _.-)\")\n    return asset\n\n\ndef _check_outputs(sp, asset: str) -> None:\n    \"\"\"Reject existing artifacts for this stem before any billable work.\"\"\"\n    props = sp.dir / \"props\"\n    candidates = [props / f\"{asset}{suffix}\" for suffix in\n                  (\".glb\", \".json\", \"_plate.png\", \"_retopo.glb\")]\n    candidates += list(props.glob(f\"{asset}_part*.glb\"))\n    candidates += [sp.dir / \"turntables\" / asset,\n                   sp.dir / \"turntables\" / f\"{asset}.mp4\"]\n    for path in candidates:\n        if path.exists() or path.is_symlink():\n            raise FileExistsError(f\"asset output already exists; choose a new --name: {path}\")\n\n\ndef mint3d(\n    genre: str,\n    root: str = \"stylepacks\",\n    from_stills: int = 0,\n    prompt: str = \"\",\n    plate: bool = False,\n    name: str | None = None,\n    pbr: bool = True,\n    retopo: bool = False,\n    split: bool = False,\n    render: bool = True,\n    frames: int = 48,\n    size: int = 768,\n    backend: str = \"auto\",\n    face_count: int | None = None,\n) -> dict:","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/mint3d.py#L66-L102","documentation":"mint3d.py's _check_outputs refuses to start any billable work if any candidate output artifact for the asset stem already exists - the .glb, .json, plate PNG, retopo glb, part*.glb files, or turntable directory/mp4. Existing paths (or symlinks) raise FileExistsError pointing at the first collision.","triggerScenarios":"Re-running mint3d for the same genre with the same asset --name after a previous successful (or partially successful) run left outputs in the stylepack's props/turntables directories.","commonSituations":"Re-running a failed pipeline after a partial crash left some artifacts; accidentally reusing a common name like 'prop_lamp'; turntable video from a prior render still present.","solutions":["Choose a new --name for the asset","Delete or move the reported existing path(s) under the stylepack's props/ and turntables/ directories if the old asset is no longer needed","Inspect the reported path: if it is a stale symlink from a crashed run, remove it","Automate cleanup of partial artifacts before retrying the same asset name"],"exampleFix":"// before\npython mint3d.py noir --prompt \"rusty lamp\" --name hero_lamp  # FileExistsError\n// after\nrm stylepacks/noir/props/hero_lamp.glb stylepacks/noir/turntables/hero_lamp.mp4\npython mint3d.py noir --prompt \"rusty lamp\" --name hero_lamp","handlingStrategy":"validation","validationCode":"from pathlib import Path\nsp = Path(root) / genre\nstale = [p for p in sp.glob(\"props/*\") ] + [p for p in sp.glob(\"turntables/*\") if asset in p.name]\nexisting = [p for p in stale if p.exists() or p.is_symlink()]\nif existing:\n    raise SystemExit(f\"clean up first: {existing}\")","typeGuard":null,"tryCatchPattern":"try:\n    mint3d(...)\nexcept FileExistsError as e:\n    print(e); prompt operator to pick a new --name or archive old outputs","preventionTips":["Use unique, descriptive asset names per run","Archive completed packs before rerunning the same asset","Clean partial artifacts after crashed runs"],"tags":["file-exists","idempotency","cli"],"backgroundTag":"file-already-exists","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}