nexu-io/open-design · warning · SystemExit

{output} already exists; pass --force to replace it

Error message

{output} already exists; pass --force to replace it

What it means

decoded/running-left.png already exists and --force was not passed. The guard prevents silently overwriting a previously derived and reviewed mirror, which would invalidate its recorded output_sha256 and lineage.

Source

Thrown at skills/hatch-pet/scripts/derive_running_left_from_running_right.py:98

    run_dir = Path(args.run_dir).expanduser().resolve()
    manifest_path = run_dir / "imagegen-jobs.json"
    manifest = load_manifest(run_dir)
    right_job = find_job(manifest, "running-right")
    left_job = find_job(manifest, "running-left")

    if right_job.get("status") != "complete":
        raise SystemExit("running-right must be complete before deriving running-left")
    mirror_policy = left_job.get("mirror_policy")
    if not isinstance(mirror_policy, dict) or mirror_policy.get("may_derive_from") != "running-right":
        raise SystemExit("running-left is not configured for conditional mirroring")

    source = run_dir / "decoded" / "running-right.png"
    output = run_dir / "decoded" / "running-left.png"
    if not source.is_file():
        raise SystemExit(f"running-right decoded strip not found: {source}")
    if output.exists() and not args.force:
        raise SystemExit(f"{output} already exists; pass --force to replace it")

    output.parent.mkdir(parents=True, exist_ok=True)
    with Image.open(source) as image:
        mirrored = ImageOps.mirror(image.convert("RGBA"))
        mirrored.save(output)

    left_job["status"] = "complete"
    left_job["source_path"] = manifest_relative(source, run_dir)
    left_job["source_provenance"] = "deterministic-mirror"
    left_job["derived_from"] = "running-right"
    left_job["source_sha256"] = file_sha256(source)
    left_job["output_sha256"] = file_sha256(output)
    left_job["completed_at"] = datetime.now(timezone.utc).isoformat()
    left_job["metadata"] = image_metadata(output)
    left_job["mirror_decision"] = {
        "approved": True,
        "approved_at": left_job["completed_at"],
        "note": args.decision_note.strip(),

View on GitHub (pinned to 5be4028344)

Solutions

  1. If the existing running-left.png is correct, do nothing — it is already derived.
  2. If you genuinely need to re-derive, add --force to overwrite the existing output and refresh its hashes.
  3. Before forcing, confirm the existing file is not a hand-edited PNG (it should be a byte-exact mirror of running-right).
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

output = Path("<run_dir>") / "decoded" / "running-left.png"
extra = ["--force"] if output.exists() else []
# then invoke derive_running_left_from_running_right.py with *extra

Prevention

When it happens

Trigger: Re-running derive_running_left_from_running_right.py after a prior successful derive, without --force, while decoded/running-left.png is still present.

Common situations: Iterating on the mirror; re-running the script in CI; a previous run left an output behind and the user re-invoked to refresh it.

Related errors


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