Conversation
Establish bot package foundation with Engine interface, optional interfaces for advanced features, and comprehensive test coverage.
Factory infrastructure for creating engines with custom configuration. Includes placeholder factories and comprehensive validation tests.
First playable bot using random legal move selection. Includes comprehensive tests and validates bot infrastructure.
Weighted move selection gives Easy bot personality while remaining beatable. Includes comprehensive statistical tests.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This pull request establishes the foundation for the bot package by implementing core interfaces, factory patterns, and the first working bot opponent (Easy Bot). The implementation includes comprehensive test coverage for interface contracts, factory options, and bot behavior.
Changes:
- Defined Engine interface and optional interfaces (Configurable, Stateful, Inspectable) with supporting types
- Implemented factory pattern with functional options for flexible engine configuration
- Created Easy Bot with weighted random move selection (70% tactical bias towards captures and checks)
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/bot/engine.go | Core bot package with Engine interface, optional interfaces (Configurable, Stateful, Inspectable), EngineType and Difficulty enums with String methods |
| internal/bot/engine_test.go | Comprehensive interface contract tests using mock implementations to verify all interfaces work correctly |
| internal/bot/factory.go | Factory functions (NewRandomEngine, NewMinimaxEngine placeholder) and functional options (WithTimeLimit, WithSearchDepth, WithOptions) |
| internal/bot/factory_test.go | Tests for factory options validation, engine creation with various configurations, and option chaining/overrides |
| internal/bot/random.go | Easy Bot implementation with randomEngine struct, weighted move selection favoring captures (70%) and checks (50%), and helper functions for filtering moves |
| internal/bot/random_test.go | Extensive tests covering legal move selection, error cases, weighted selection bias, distribution tests, and edge cases |
| context/spec/004-bot-opponents/tasks.md | Documentation update marking Tasks 1-4 as completed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix en passant detection, add proper RNG seeding, use atomic operations for thread safety, standardize FEN parsing, and improve test error handling
Add ply distance parameter to alphaBeta to adjust mate scores (10000-ply), so mate-in-1 scores higher than mate-in-3. Fixes TestMinimaxEngine_FindsMateInOne.
Add piece-square tables (pawn advancement, knight centralization, rook 7th rank, etc.) and mobility evaluation. Medium/Hard bots now understand piece positioning. Easy bot unchanged (material-only).
Evaluate pawn shield (0.3/pawn), open files near king (0.25/file), and attackers in king zone (0.1/square). Hard bot now understands king safety. Medium/Easy bots unchanged.
Implement Configure() and Info() methods enabling runtime parameter tuning. Supports configuring search depth (1-20), time limits, and evaluation weights (material, piece-square, mobility, king safety). Includes validation and comprehensive test coverage with 7 new tests.
Replace map[string]any with pointer-based struct for engine configuration. Provides compile-time type safety and clearer API. Update all tests and documentation accordingly.
Expand go-cli-expert.md with detailed best practices, patterns, and common pitfalls. Remove config file examples, keep focus on coding standards.
Complete Task 11 of bot opponents spec. Add bot difficulty selection screen, async bot move execution with thinking messages, proper cleanup on all exit paths. All bot difficulty levels (Easy/Medium/Hard) now playable in UI.
Add color selection screen allowing users to play as White or Black. When user plays Black, bot makes the opening move immediately after setup. Includes full integration tests and navigation for color selection UI.
Owner
Author
|
@copilot review the code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Establish bot package foundation with Engine interface, optional interfaces for advanced features, and comprehensive test coverage.