{"record":{"id":"25319bd131070a7a","repo":"affaan-m/ECC","slug":"output-already-exists-choose-a-new-out-destination-pipeline","errorCode":null,"errorMessage":"output already exists; choose a new --out: {destination}","messagePattern":"output already exists; choose a new --out: (.+?)","errorType":"exception","errorClass":"FileExistsError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/pipeline.py","lineNumber":93,"sourceCode":"\n    if a.fps is not None and (not math.isfinite(a.fps) or a.fps <= 0):\n        ap.error(\"--fps must be finite and positive\")\n    if a.takes and (a.prop or a.tier):\n        ap.error(\"--takes cannot be combined with --prop or --tier\")\n    if a.takes and a.dry_run:\n        print(\"[dry run] offline passthrough planned; no stages or files produced\")\n        return\n\n    pack_dir = Path(a.root) / a.genre\n    out = a.out or f\"out/FINAL_{a.genre}.mp4\"\n    # Catch handoff collisions before optional distillation or prop spending.\n    from forge import validate_output\n    validate_output(Path(out))\n    if not a.takes:\n        for destination in (Path(out).with_suffix(\".generation.json\"),\n                            Path(out).parent / f\"{Path(out).stem}_takes\"):\n            if destination.exists() or destination.is_symlink():\n                raise FileExistsError(f\"output already exists; choose a new --out: {destination}\")\n    dry = [\"--dry-run\"] if a.dry_run else []\n\n    # ---- 1. mint -------------------------------------------------------\n    if a.remint or not (pack_dir / \"grade.json\").exists():\n        if not a.refs:\n            raise SystemExit(\n                f\"no pack at {pack_dir} and no --refs given; nothing to measure\"\n            )\n        _run(\"mint\", [\"mint.py\", \"--genre\", a.genre, \"--root\", a.root,\n                      \"--refs\", *a.refs])\n    else:\n        print(f\"[mint] reusing existing pack at {pack_dir} (--remint to re-measure)\")\n\n    # ---- 2. distill ----------------------------------------------------\n    if not a.takes and not a.no_distill and (a.remint or not (pack_dir / \"spec.json\").exists()):\n        _run(\"distill\", [\"distill.py\", \"--genre\", a.genre, \"--root\", a.root, *dry])\n    elif a.takes:\n        print(\"[distill] skipped (offline passthrough)\")","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/pipeline.py#L75-L111","documentation":"pipeline.py's main validates the final output via validate_output and, when not resuming with --takes, guards against overwriting existing artifacts: the .generation.json sidecar and the <stem>_takes directory. If either exists (or is a symlink), it raises FileExistsError before running any stages.","triggerScenarios":"Re-running the pipeline with the same --out path after a prior complete or partial run left the generation JSON or takes directory in place, without passing --takes to resume.","commonSituations":"Iterating on the same output name after a previous run; leftover artifacts from a crashed run; symlinked output directories pointing at old results.","solutions":["Choose a new --out path for the new run","Delete or archive the reported .generation.json / <stem>_takes artifacts if the previous output is unwanted","Pass --takes if you intend to resume/extend the existing output rather than create a fresh one","Check both the output directory and its sidecar JSON for leftovers from failed runs before rerunning"],"exampleFix":"// before\npython pipeline.py --genre noir --out cut.mov   # FileExistsError: cut.generation.json\n// after\nrm cut.generation.json && rm -rf cut_takes\npython pipeline.py --genre noir --out cut.mov   # or pass --takes to resume","handlingStrategy":"validation","validationCode":"from pathlib import Path\nout = Path(out_path)\ncollisions = [out.with_suffix(\".generation.json\"), out.parent / f\"{out.stem}_takes\"]\nexisting = [d for d in collisions if d.exists() or d.is_symlink()]\nif existing and not resume_takes:\n    raise SystemExit(f\"choose new --out or clean: {existing}\")","typeGuard":null,"tryCatchPattern":"try:\n    pipeline.main()\nexcept FileExistsError as e:\n    print(e); pick_new_out_or_archive(existing)","preventionTips":["Check sidecar .generation.json and _takes dir before reruns","Pass --takes when you intend to resume rather than create fresh","Version your --out names (cut_v2.mov) during iteration"],"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"}