Files
threshing-atlas/planner
cc86343668 Core: the route model in Python, built from a declarative game.yaml (#10)
Step 2 of the Python-first, declarative core.

- core/spec/game.yaml: the game as data: every decision and its options, every roll and the
  earlier steps its odds may depend on, every bonding encounter, and the flow of a run from the
  entrance to the dragons (set / keep / drop / go / end / encounter). Also how the form's coded
  answers map onto the game.
- core/atlas/model.py: what each coded run reveals about each step, count tables, empirical-Bayes
  shrinkage, and the posterior draws (same random numbers as before, reproducible from the seed).
- core/atlas/solver.py: one interpreter of game.yaml used three ways (solve, evaluate a fixed
  policy, export the published tree) instead of the tree written out five times. Vectorised
  over the 200 posterior draws: the build takes about 2 minutes instead of 4, with no memory flag.
- planner/build_policy.py and policy_report.py replace the JS build and report.

Checked against the JavaScript model: every number in policy.json agrees to within 4e-12
(last-digit differences in log/cos). Three "still best" shares differ by one draw in 200, at
near-ties under the "eventually" objective. POLICY.md is otherwise identical.
tests/parity/compare_solver.py keeps checking JS against Python in CI until the site's JS advisor
replaces solver.js; tests/core/test_game.py checks game.yaml is complete and consistent.


Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:04:21 +00:00
..

planner

The route planner: the best route to every dragon, and what goes back to Ken's bot.

File What it does
build_policy.py Solves the route model (core/atlas/solver.py, built from the game in core/spec/game.yaml) for every colour and both goals ("this attempt" and "eventually"), with 200 posterior draws and a cross-fit check. Writes data/public/policy.json, which has a content id so each bot run can record which policy it followed. About 2 minutes.
policy_report.py Writes the readable version, analysis/reports/POLICY.md.

Run both with npm run policy. The site's valley map and The Odds read policy.json; the bot downloads it with solver.js and graph.js (see docs/BOT_INTEGRATION.md).

The loop with the bot. The planner's routes go out to the bot; the bot's runs come back through collection/bot/. Experiments the bot should run to fill gaps the community form cannot (for example the answers at each bonding encounter) belong here; experiments.json is on the roadmap.