• Mahmoud Aglan's avatar
    fix: rated games now actually change ratings · 34f9459c
    Mahmoud Aglan authored
    No completed match in production has ever had white_rating_after or
    rating_change_white written, and 272 of the 290 profiles were still sitting on
    the default 1200. The complete_match database function does not touch the rating
    columns, and game.php had calculateElo() and getRatingColumn() helpers that
    nothing ever called.
    
    Elo is now computed in applyRatings(), called from finaliseMatch() after its
    conditional write has succeeded — so a game can never be rated twice. It writes
    both ratings before and after and the deltas onto the match, updates the correct
    per-time-control column on each profile along with the game/win/loss/draw and
    streak counters, and records a rating_history row per player.
    
    This matters beyond the leaderboard: Swiss seeding orders players by rating, so
    with every rating pinned at 1200 the top-half/bottom-half split in round 1 was
    arbitrary.
    
    Bot games and aborted games are never rated, and a match with the same player on
    both sides is refused outright.
    
    Covered by e2e sections 18 and 19.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    34f9459c
Name
Last commit
Last update
..
README.md Loading commit data...
authstub.php Loading commit data...
engine_shim.php Loading commit data...
gen_fens.mjs Loading commit data...
pgshim.php Loading commit data...
real_games.json Loading commit data...
router.php Loading commit data...
run.sh Loading commit data...
schema.sql Loading commit data...
test_auth.php Loading commit data...
test_e2e.mjs Loading commit data...
test_integration.php Loading commit data...
test_replay.php Loading commit data...
test_swiss.php Loading commit data...