nexu-io/open-design · error · SystemExit

--decision-note must explain why mirroring is appropriate

Error message

--decision-note must explain why mirroring is appropriate

What it means

Thrown at the top of main() in derive_running_left_from_running_right.py when --decision-note is passed but contains only whitespace. The note is the audit-trail record of why mirroring was approved, so an empty note is treated as if the safety rationale was not provided. Note: --decision-note is a required argparse argument, so this fires when it is supplied but blank.

Source

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

    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():
        raise SystemExit(f"running-right decoded strip not found: {source}")
    if output.exists() and not args.force:

View on GitHub (pinned to 5be4028344)

Solutions

  1. Provide a short, meaningful note explaining why this pet's running-right strip can be mirrored (e.g. 'bilaterally symmetric, no text or props').
  2. If you cannot articulate a reason, do not mirror; generate running-left frames directly instead.
  3. Treat the note as an audit record: write what you reviewed and what made mirroring safe.

Example fix

# before
python derive_running_left_from_running_right.py --run-dir ./run --confirm-appropriate-mirror --decision-note " "
# after
python derive_running_left_from_running_right.py --run-dir ./run --confirm-appropriate-mirror --decision-note "pet is symmetric; no text or directional props on the strip"
Defensive patterns

Strategy: validation

Validate before calling

def assert_decision_note(note: str) -> None:
    if not note or not note.strip():
        raise SystemExit("--decision-note must explain why mirroring is appropriate")

Type guard

def is_meaningful_note(note: str) -> bool:
    return bool(note) and len(note.strip()) >= 5

Prevention

When it happens

Trigger: Run derive_running_left_from_running_right.py --decision-note "" (or a string of only spaces/tabs).

Common situations: Passing an empty quoted string to satisfy the required-argument check; a wrapper script that supplies a placeholder note; copying a command and clearing the note field.

Related errors


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