Step 4b of the Python-first core. - core/solver.js is now a 250-line advisor (was 900 lines): it reads the game (core/spec/game.yaml, published inside policy.json as model.game) and the count tables, and re-solves from any point in a run with the same interpreter as the Python model. Same API for the site and Ken's bot (advisor, recommendOption, solverHistory). The bot's on-screen text for each option moves to game.yaml (bot_text); the deadly rolls carry their risk labels there too. - tests/core/advisor.test.js: the advisor gives exactly the Python model's values and choices for every colour and goal (to 1e-12, every decision on every published route), walks a run in the game's order, and maps advice onto the bot's screen. - Removed core/engine.js and everything that only compared it with Python (tests/parity/run_engine, compare_runs, compare_results, compare_routes, compare_solver, compare_stats, analysis/stats/ analyze.py). In their place: tests/core/test_stats.py checks the statistics against known answers, test_solver.py checks the route model on a synthetic world (tests/fixtures/synthetic_policy.py). - analysis/network/build-graph.js reads the Python-coded runs; graph.json is byte-identical. - docs/BOT_INTEGRATION.md: what changed for the bot (history keys, new choices, re-sync all three files). Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
3.2 KiB
Markdown
42 lines
3.2 KiB
Markdown
# Roadmap
|
|
|
|
The aim is to move from summary statistics to path finding: for each dragon colour, the decision
|
|
policy that maximises the chance of bonding it, with honest uncertainty.
|
|
|
|
1. **Repo and packaging** (done): monorepo, CI, GitHub Pages, JS/Python parity tests.
|
|
2. **Graph format** (`core/`, first version done): typed scene, chance and terminal nodes; history-context keys;
|
|
per-source counts (bot, form, PDF, Discord); fingerprints and short labels only, no game prose.
|
|
Importers in `collection/bot` for the bot's `knowledge.json`, `runs.jsonl` and `encounters.jsonl`
|
|
(done), the form (done, via the crosswalk in `graph.js`), and a PDF scene crosswalk (to do).
|
|
Daily source checks for the form, the register and the PDF (done).
|
|
3. **Context learning** (`analysis/`): tests of history dependence (G-tests, BH); variable-order
|
|
Markov / context tree with BIC; temporal-tiered DAG structure learning (BDeu/BIC); latent
|
|
"character" model vs specific triggers vs memoryless baseline, compared on held-out likelihood;
|
|
hierarchical Dirichlet back-off pooling.
|
|
4. **Solver** (first version done: `core/solver.js`, `analysis/reports/POLICY.md`; still to do: richer history models from step 3): backward induction on the augmented state (scene, history summary), i.e. an influence
|
|
diagram with perfect recall. Two objectives side by side per colour:
|
|
- P(target colour on this attempt);
|
|
- eventual success when deliberate deaths are free: maximise p_X / (p_X + p_other bond),
|
|
solved by Dinkelbach iteration.
|
|
Monte Carlo credible intervals, top-k routes, required steps and bottlenecks.
|
|
5. **Valley graph UI**: every option at every point, with P(survive) and P(bond) per colour, the
|
|
policy overlay for a chosen colour, and untested branches marked.
|
|
6. **Bot loop** (advisor and sync published, see `docs/BOT_INTEGRATION.md`; experiments.json to do): the atlas publishes `policy.json` and `experiments.json` (ranked by value of
|
|
information); the private DragonKind bot consumes them and returns anonymised runs.
|
|
|
|
## Python first, declarative rules (November 2026)
|
|
|
|
The repo is moving to Python, with the rules and the game written as declarative spec files. JavaScript stays
|
|
only where it has to run: the site's drawing and interaction, and a small route advisor the site and Ken's bot
|
|
share.
|
|
|
|
1. Coding rules: `core/spec/form.yaml` + `core/atlas/coding.py`, with rule tests. **Done.**
|
|
2. Route model in Python, built from `core/spec/game.yaml`. **Done** (the bot's text, `core/spec/crosswalk.yaml`, moves with the bot importer and the JS advisor in step 4).
|
|
3. **Done.** Fix the coding bugs found in the core review (letting the Red pass, "left your squadmates" before the
|
|
redesigned form, missing bot text), each with a rule test.
|
|
4. **Done.** The site shows precomputed statistics with fixed filter presets (`analysis/stats/site_stats.py`,
|
|
`measures.yaml`, `data/public/stats.json`); the upload button and the click-to-select route map are gone; a
|
|
small JS advisor (`core/solver.js`, about 250 lines) reads the game and the Python-built model from `policy.json`
|
|
and replaces the 900-line JS solver; `engine.js` is gone.
|
|
5. `data/dictionary.yaml` for every published column, and Croissant metadata for the datasets.
|