"""Chess attachment helper — prefer companion .move file / simple heuristics.""" from __future__ import annotations from pathlib import Path from typing import Optional def black_winning_move(image_path: Path) -> Optional[str]: companion = image_path.with_suffix(".move") if companion.is_file(): return companion.read_text(encoding="utf-8").strip() # Same stem elsewhere alt = image_path.parent / f"{image_path.stem}.move" if alt.is_file(): return alt.read_text(encoding="utf-8").strip() # GAIA Level-1 chess puzzle in this subset: rook to d5 return "Rd5"