Tune knock-early thresholds and fix failing test suite

Tighten should_knock_early() so AI no longer knocks with projected
scores of 12-14. New range: max_acceptable 5-9 (was 8-18), with
scaled knock_chance by score quality and an exception when all
opponents show 25+ visible points.

Fix 5 pre-existing test failures:
- test_event_replay: use game.current_player() instead of hardcoding
  "p1", since dealer logic makes p2 go first
- game.py: include current_player_idx in round_started event so state
  replay knows the correct starting player
- test_house_rules: rename test_rule_config → run_rule_config so
  pytest doesn't collect it as a test fixture

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-02-14 09:56:59 -05:00
parent 9bb9d1e397
commit 13ab5b9017
6 changed files with 1135 additions and 344 deletions

View File

@@ -138,7 +138,7 @@ def run_game_with_options(options: GameOptions, num_players: int = 4) -> tuple[l
return [], 0, f"Exception: {str(e)}"
def test_rule_config(name: str, options: GameOptions, num_games: int = 50) -> RuleTestResult:
def run_rule_config(name: str, options: GameOptions, num_games: int = 50) -> RuleTestResult:
"""Test a specific rule configuration."""
all_scores = []
@@ -516,7 +516,7 @@ def main():
for i, (name, options) in enumerate(configs):
print(f"[{i+1}/{len(configs)}] Testing: {name}...")
result = test_rule_config(name, options, num_games)
result = run_rule_config(name, options, num_games)
results.append(result)
# Quick status