{"record":{"id":"9105993f2ac7bc60","repo":"nexu-io/open-design","slug":"decision-note-must-explain-why-mirroring-is-appr","errorCode":null,"errorMessage":"--decision-note must explain why mirroring is appropriate","messagePattern":"--decision-note must explain why mirroring is appropriate","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"skills/hatch-pet/scripts/derive_running_left_from_running_right.py","lineNumber":79,"sourceCode":"    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():\n        raise SystemExit(f\"running-right decoded strip not found: {source}\")\n    if output.exists() and not args.force:","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/skills/hatch-pet/scripts/derive_running_left_from_running_right.py#L61-L97","documentation":"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.","triggerScenarios":"Run derive_running_left_from_running_right.py --decision-note \"\" (or a string of only spaces/tabs).","commonSituations":"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.","solutions":["Provide a short, meaningful note explaining why this pet's running-right strip can be mirrored (e.g. 'bilaterally symmetric, no text or props').","If you cannot articulate a reason, do not mirror; generate running-left frames directly instead.","Treat the note as an audit record: write what you reviewed and what made mirroring safe."],"exampleFix":"# before\npython derive_running_left_from_running_right.py --run-dir ./run --confirm-appropriate-mirror --decision-note \" \"\n# after\npython 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\"","handlingStrategy":"validation","validationCode":"def assert_decision_note(note: str) -> None:\n    if not note or not note.strip():\n        raise SystemExit(\"--decision-note must explain why mirroring is appropriate\")","typeGuard":"def is_meaningful_note(note: str) -> bool:\n    return bool(note) and len(note.strip()) >= 5","tryCatchPattern":null,"preventionTips":["Write the review rationale into the note (what you checked, why mirroring is safe).","Treat the note as an audit record, not a placeholder."],"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"}