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 -1
View File
@@ -14,7 +14,8 @@ fs.rmSync(out, { recursive: true, force: true });
for (const f of fs.readdirSync(path.join(root, "apps/atlas"))) copy(`apps/atlas/${f}`, f);
copy("packages/core/src/engine.js", "engine.js");
copy("packages/core/src/graph.js", "graph.js");
for (const f of ["form_responses.json", "register.json", "graph.json"]) copy(`data/public/${f}`, `data/${f}`);
copy("packages/core/src/solver.js", "solver.js");
for (const f of ["form_responses.json", "register.json", "graph.json", "policy.json"]) copy(`data/public/${f}`, `data/${f}`);
// Source files shown in the page's "view the code" panel
for (const f of ["analyze.py", "clean.py", "stats_core.py"]) copy(`research/python/${f}`, `python/${f}`);
copy("README.md", "README.md");