nexu-io/open-design · error · SystemExit

refusing to mirror without --confirm-appropriate-mirror

Error message

refusing to mirror without --confirm-appropriate-mirror

What it means

Thrown at the top of main() in derive_running_left_from_running_right.py when --confirm-appropriate-mirror was not passed. Mirroring a running-right strip to produce running-left can flip identity/prop details (text, asymmetrical features), so the script requires an explicit human attestation that the mirror was visually reviewed and is acceptable.

Source

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

def main() -> None:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--run-dir", required=True)
    parser.add_argument(
        "--confirm-appropriate-mirror",
        action="store_true",
        help="Required after visually confirming the rightward strip can be mirrored without identity/prop issues.",
    )
    parser.add_argument(
        "--decision-note",
        required=True,
        help="Short note explaining why mirroring is acceptable for this pet.",
    )
    parser.add_argument("--force", action="store_true")
    args = parser.parse_args()

    if not args.confirm_appropriate_mirror:
        raise SystemExit("refusing to mirror without --confirm-appropriate-mirror")
    if not args.decision_note.strip():
        raise SystemExit("--decision-note must explain why mirroring is appropriate")

    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():

View on GitHub (pinned to 5be4028344)

Solutions

  1. Visually inspect the running-right strip and confirm mirroring will not flip text, logos, or asymmetric identity features.
  2. Re-run with --confirm-appropriate-mirror --decision-note "<reason>" once you have reviewed it.
  3. If mirroring is not appropriate, generate running-left frames independently (do not use this derive script).

Example fix

# before
python derive_running_left_from_running_right.py --run-dir ./run --decision-note "symmetrical pet"
# after
python derive_running_left_from_running_right.py --run-dir ./run --confirm-appropriate-mirror --decision-note "pet is bilaterally symmetric, no text or asymmetrical props"
Defensive patterns

Strategy: validation

Validate before calling

def assert_mirror_confirmed(confirm_flag: bool, decision_note: str) -> None:
    if not confirm_flag:
        raise SystemExit("pass --confirm-appropriate-mirror after visual review")
    if not decision_note.strip():
        raise SystemExit("--decision-note must be non-empty")

Prevention

When it happens

Trigger: Run derive_running_left_from_running_right.py without the --confirm-appropriate-mirror flag.

Common situations: First run of the derive step without reading the safety contract; an automated wrapper that omits the flag; treating the derive step as a free shortcut without reviewing the mirrored output.

Related errors


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