v0.8.0.9 — the bot plans its switching turn, stops wasting its draws, and the engine walks each route once

The developer bot, re-measured decision by decision against the bot before it,
goes from about -0.3 revenue a game to about 4.8:

- plans the whole switching turn before its first Move (sim/switch-planner.ts),
  +2.89 over 1600 paired seeds; closes TODO #53
- takes a face-up card only if it could play it, +1.52 over 1600 seeds
- stops running Second Sections by accident in the New Train phase, +0.32
- lays track by what the district can do afterwards, +0.12 over 6400 seeds,
  run-arounds in 22 of 60 districts against 9

The engine is 2.8x faster with play proven identical: a route cache scoped to
one unchanged position, applyIntent split into prepareIntent + commitEvents,
and less allocation in exploreMoves. npm test now leaves out the bot
simulations, which run as npm run test:sim.

No rule changed; games in progress resume. Rejected candidates and the
Second Section card question are in CHANGELOG.md and TODO.md (#104-#106).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017nnuCv8UodHucFfx3LWEoX
This commit is contained in:
Jesse.Markowitz
2026-09-15 15:30:42 -04:00
co-authored by Claude Opus 5
parent 072029b1f7
commit 76c6e103b3
13 changed files with 1550 additions and 112 deletions
+4 -2
View File
@@ -1,6 +1,6 @@
{
"name": "station-master",
"version": "0.8.0.8",
"version": "0.8.0.9",
"private": true,
"type": "module",
"description": "Station Master — a railroad operations game",
@@ -10,7 +10,9 @@
"scripts": {
"typecheck": "tsc --noEmit",
"pretest": "tsc --noEmit && node scripts/build-web.ts",
"test": "node --test test/*.test.ts test/**/*.test.ts",
"test": "node --test $(ls test/*.test.ts test/**/*.test.ts | grep -v '^test/sim.test.ts$')",
"pretest:sim": "tsc --noEmit",
"test:sim": "node --test test/sim.test.ts",
"build:web": "node scripts/build-web.ts",
"serve:web": "node scripts/build-web.ts && npx --yes http-server dist -p 8080 -c-1",
"deploy:web": "node scripts/deploy-web.ts",