Route model learns from bot runs; Thompson sampling in the advisor (work in progress)

- planner/policy.yaml: which sources the route model learns from (spreadsheet,
  reported, bot) and the low-bias sample
- bot runs: deaths coded by stage, Malek intent for runs with a target
- model: survival of the first dragon is not counted when nothing after it is
  known; the meadow dragon falls back to what the bot saw
- solver.js: advisor(..., {sampling: "thompson", seed, draws}) follows one
  posterior draw per attempt and reports each pick's propensity

Not shipped yet: mixing sources lowers the fitted shrinkage for the shadow roll
(alpha 500 -> 50 in the low-bias sample), see the conversation of 2026-11-09.

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-10 02:29:09 +00:00
co-authored by Claude Opus 5.5
parent d37eaa3378
commit c0355616b6
6 changed files with 121 additions and 22 deletions
+7 -2
View File
@@ -69,6 +69,9 @@ def prepare_run(r):
v["diedSight"] = r["scream"] == "DIED at first sighting"
if v["diedSight"]:
return v
if r["scream"] not in ("Investigate & help", "Ignore the scream", "Investigate & leave"):
v["sightUnknown"] = True # no answer after the first dragon: whether the rider survived it is not known
return v
res = r["resolution"]
if r["scream"] == "Investigate & help":
v["help"] = True
@@ -113,7 +116,9 @@ def prepare_run(r):
ended = lambda c: r.get("enc_" + c) and r.get("enc_" + c) != "Changed my mind" # noqa: E731
v["meadow"] = "Blue" if (r.get("enc_Blue") or r.get("rare_reported") == "Blue (valley)") else \
"Orange" if ended("Orange") else "Brown" if ended("Brown") else \
"Orange" if r.get("enc_Orange") else "Brown" if r.get("enc_Brown") else None
"Orange" if r.get("enc_Orange") else "Brown" if r.get("enc_Brown") else \
"Blue" if r.get("saw_blue_meadow") is True else \
r["outcome_color"] if r.get("saw_blue_meadow") is False and r.get("outcome_color") in ("Orange", "Brown") else None
if v["meadow"]:
v["encCtx"] = "meadow-" + v["meadow"]
if v.get("encCtx"):
@@ -127,7 +132,7 @@ def prepare_run(r):
# what each chance event observed in a prepared run
OBSERVE = {
"fs": lambda v: v.get("fs"),
"dieSight": lambda v: ("die" if v.get("diedSight") else "live") if v.get("fs") else None,
"dieSight": lambda v: ("die" if v.get("diedSight") else "live") if v.get("fs") and not v.get("sightUnknown") else None,
"dieCombat": lambda v: ("die" if v.get("diedCombat") else "live") if v.get("help") else None,
"dieHour": lambda v: ("die" if v.get("diedHour") else "live") if v.get("survivedCadets") else None,
"shadow": lambda v: None if "shadow" not in v else ("yes" if v["shadow"] else "no"),