{"record":{"id":"e718f2c2ff5fba80","repo":"nexu-io/open-design","slug":"refusing-to-mirror-without-confirm-appropriate-m","errorCode":null,"errorMessage":"refusing to mirror without --confirm-appropriate-mirror","messagePattern":"refusing to mirror without --confirm-appropriate-mirror","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/derive_running_left_from_running_right.py","lineNumber":77,"sourceCode":"\ndef main() -> None:\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument(\"--run-dir\", required=True)\n    parser.add_argument(\n        \"--confirm-appropriate-mirror\",\n        action=\"store_true\",\n        help=\"Required after visually confirming the rightward strip can be mirrored without identity/prop issues.\",\n    )\n    parser.add_argument(\n        \"--decision-note\",\n        required=True,\n        help=\"Short note explaining why mirroring is acceptable for this pet.\",\n    )\n    parser.add_argument(\"--force\", action=\"store_true\")\n    args = parser.parse_args()\n\n    if not args.confirm_appropriate_mirror:\n        raise SystemExit(\"refusing to mirror without --confirm-appropriate-mirror\")\n    if not args.decision_note.strip():\n        raise SystemExit(\"--decision-note must explain why mirroring is appropriate\")\n\n    run_dir = Path(args.run_dir).expanduser().resolve()\n    manifest_path = run_dir / \"imagegen-jobs.json\"\n    manifest = load_manifest(run_dir)\n    right_job = find_job(manifest, \"running-right\")\n    left_job = find_job(manifest, \"running-left\")\n\n    if right_job.get(\"status\") != \"complete\":\n        raise SystemExit(\"running-right must be complete before deriving running-left\")\n    mirror_policy = left_job.get(\"mirror_policy\")\n    if not isinstance(mirror_policy, dict) or mirror_policy.get(\"may_derive_from\") != \"running-right\":\n        raise SystemExit(\"running-left is not configured for conditional mirroring\")\n\n    source = run_dir / \"decoded\" / \"running-right.png\"\n    output = run_dir / \"decoded\" / \"running-left.png\"\n    if not source.is_file():","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/derive_running_left_from_running_right.py#L59-L95","documentation":"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.","triggerScenarios":"Run derive_running_left_from_running_right.py without the --confirm-appropriate-mirror flag.","commonSituations":"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.","solutions":["Visually inspect the running-right strip and confirm mirroring will not flip text, logos, or asymmetric identity features.","Re-run with --confirm-appropriate-mirror --decision-note \"<reason>\" once you have reviewed it.","If mirroring is not appropriate, generate running-left frames independently (do not use this derive script)."],"exampleFix":"# before\npython derive_running_left_from_running_right.py --run-dir ./run --decision-note \"symmetrical pet\"\n# after\npython derive_running_left_from_running_right.py --run-dir ./run --confirm-appropriate-mirror --decision-note \"pet is bilaterally symmetric, no text or asymmetrical props\"","handlingStrategy":"validation","validationCode":"def assert_mirror_confirmed(confirm_flag: bool, decision_note: str) -> None:\n    if not confirm_flag:\n        raise SystemExit(\"pass --confirm-appropriate-mirror after visual review\")\n    if not decision_note.strip():\n        raise SystemExit(\"--decision-note must be non-empty\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always visually review the running-right strip before mirroring.","If mirroring would flip text/asymmetric identity, generate running-left frames directly."],"tags":["safety-guard","hatch-pet","mirroring"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}