Route tablebase lookups through a piece-count backend seam (#27)

Add a Backend behaviour, a Lichess implementation, and a Router that picks a backend by piece count: five or fewer to the local slot, six or seven to the remote slot, and eight or more short-circuited as not covered with no network call. Both slots point at Lichess for now; the local Syzygy backend replaces the local slot when it lands.

Map :not_covered to the existing 'not covered by the tablebase' message.
This commit is contained in:
2026-11-03 12:51:08 +01:00
parent ec657c3424
commit 515196857f
8 changed files with 151 additions and 1 deletions
@@ -572,6 +572,10 @@ defmodule ChesstrainerWeb.EndgameLive.Play do
"This position is not covered by the tablebase."
end
defp blocked_reason({:error, :not_covered}) do
"This position is not covered by the tablebase."
end
defp blocked_reason({:error, reason}) do
"The tablebase is unavailable (#{inspect(reason)})."
end