A Kotlin Multiplatform chess engine is used as a case study for building an autonomous AI-driven debugging system. The architecture uses two independent oracles — published perft node counts and Stockfish (a C++ chess engine) — to verify move generation correctness. A 'divide' localizer narrows failures to the exact board position and move where the engine diverges. A thin MCP server exposes Gradle tasks and Stockfish as structured tools so an AI coding agent (e.g., Claude Code, OpenCode) can run tests, read divergence reports, and fix bugs with a single-line prompt and no human in the loop. The post also covers CI pitfalls like silent empty test filters, and distills the approach into a five-step blueprint applicable to any deterministic logic module.