Solver: best decisions per dragon colour, and the bot advisor

- packages/core/src/solver.js: decision tree with perfect recall over the
  community form's choices; chance events (first dragon, deaths, shadow,
  meadow dragon, encounter outcome) depend on earlier choices through
  hierarchical Dirichlet back-off with empirical-Bayes concentration per
  event; backward induction for P(colour this attempt) and Dinkelbach for
  P(colour) / (P(colour) + P(other colour)); 200 posterior draws for
  credible intervals and "still best" rates; cross-fitted held-out check.
- Only genuine attempts inform encounter outcomes (goal / Malek intent).
- data/public/policy.json (all runs and a low-bias sample) and the readable
  docs/POLICY.md; published on Pages with solver.js for the bot.
- Bot advisor: re-solves from any history, maps advice onto screen text,
  reports margins so ties can be randomised. docs/BOT_INTEGRATION.md.
- Tests on a synthetic world with known answers; daily source update now
  rebuilds the policy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
ekcSchiano
2026-11-01 22:34:38 +00:00
co-authored by Claude Opus 5.5
parent 46ee08a56b
commit d2ffb84b5e
12 changed files with 1842 additions and 5 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ policy that maximises the chance of bonding it, with honest uncertainty.
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**: backward induction on the augmented state (scene, history summary), i.e. an influence
4. **Solver** (first version done: `packages/core/src/solver.js`, `docs/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),
@@ -21,5 +21,5 @@ policy that maximises the chance of bonding it, with honest uncertainty.
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**: the atlas publishes `policy.json` and `experiments.json` (ranked by value of
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.