docs(bot): clarify when scoreMove early-return fires

This commit is contained in:
claude (blind_chess)
2026-04-28 13:52:22 -04:00
parent aa7bc30ee1
commit ebd1463b0a
+5 -1
View File
@@ -82,7 +82,11 @@ export class CasualBrain implements Brain {
if (!destPiece) score += 50; if (!destPiece) score += 50;
const piece = view.pieces[move.from]; const piece = view.pieces[move.from];
if (!piece) return score; // shouldn't happen, but safe. // Reachable when scoring tests pass minimal fixture views. In real play
// the candidate's `from` is always one of our pieces (since candidates
// came from `legalCandidates` over our own squares), but the early
// return keeps unit tests from needing full board fixtures.
if (!piece) return score;
const ownStartingRank = this.color === 'w' ? '1' : '8'; const ownStartingRank = this.color === 'w' ? '1' : '8';
const ownPawnStartingRank = this.color === 'w' ? '2' : '7'; const ownPawnStartingRank = this.color === 'w' ? '2' : '7';