From b4a72a08a9b1549fcad6e799c3527e5d5fd6e4e3 Mon Sep 17 00:00:00 2001 From: ekcSchiano Date: Wed, 18 Nov 2026 23:03:31 -0500 Subject: [PATCH] Valley map: the answers inside each bonding encounter, from the bot's screen tree Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ --- site/atlas/explorer.js | 36 +++++++++++++++++++++++++++++++++++- site/atlas/index.html | 8 ++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/site/atlas/explorer.js b/site/atlas/explorer.js index e6a4502..8872791 100644 --- a/site/atlas/explorer.js +++ b/site/atlas/explorer.js @@ -753,6 +753,37 @@ ${trafficToggle()}`; } + /** Inside the bonding encounter: the answers the bot gave, screen by screen, on its best logged way to bond this + * colour (data/tree.json, analysis/tree/build_tree.py), with what every other answer did. Only shown when the bot's + * way goes through the same encounter as the route; the community form does not record these answers. */ + const TREE_SIDE = (enc) => (/^(valley|meadow)-/.test(enc) ? "valley" : "tree"); + function encounterAnswers(enc) { + const t = st.tree; + if (!t) return '

Loading the answers inside the encounter…

'; + const best = (t.best || {})[st.colour]; + const picks = best && best.picks && best.picks.length ? best.picks : null; + const hourAt = picks ? picks.findIndex((p) => (t.screens[p.screen] || {}).stage === "THORN_WALK") : -1; + const side = hourAt >= 0 && /valley/i.test(picks[hourAt].text) ? "valley" : "tree"; + const viaShadow = picks && picks.some((p) => /shadow/i.test(p.text) && !/descend/i.test(p.text)); + const fits = picks && hourAt >= 0 && side === TREE_SIDE(enc) && (enc.startsWith("shadow-") ? viaShadow : !viaShadow || side === "valley"); + if (!fits) return `

The bot hasn't bonded a ${st.colour} through ${esc(ENC_NAME[enc] || enc)} yet, so the answers inside this encounter aren't mapped. The community form records only how the encounter ended, not the answers given.

`; + const died = (o) => (o.to && o.to.DIED ? o.to.DIED.n : 0); + const rows = picks.slice(hourAt + 1).map((p, i) => { + const sc = t.screens[p.screen] || { options: {} }; + const me = sc.options[p.option] || { n: p.n, to: {} }; + const lived = me.n - died(me); + const others = Object.entries(sc.options).filter(([k]) => k !== p.option).map(([, o]) => + `
  • ${esc(o.text)} ${o.n ? `died ${died(o)} of ${o.n}` : "untested"}
  • `).join(""); + return `
  • ${i + 1}
    ${esc(p.text)} + ${me.n ? `got through ${lived} of ${me.n} times` : ""}${me.kind === "fixed" && me.n ? " · always the same so far" : me.kind === "dice" ? " · a roll" : ""} + ${others ? `
    Other answers here
      ${others}
    ` : ""}
  • `; + }).join(""); + const end = Object.keys((t.screens[picks[picks.length - 1].screen] || { options: {} }).options[picks[picks.length - 1].option]?.to || {}).find((k) => k.startsWith("BONDED")); + return `
    Inside the encounter: the answers that bonded +
      ${rows}
    +

    ${end ? `Bonded a ${end.split(":")[1]}. ` : ""}From the bot's own runs (it logs every screen it sees), so the counts are small; untested answers may also work.

    `; + } + function panelRoutes(routes) { const best = Math.max(1e-12, ...routes.map((r) => r.value.x)); const T = model().targets[st.colour], b = T[st.objective]; @@ -772,7 +803,8 @@ const open = st.expanded === s.var; const opts = open ? `
    ${Object.entries(s.options).sort((a, c) => c[1].pX - a[1].pX).map(([v, val]) => ``).join("")}
    ` : ""; - return `
  • ${opts}
  • `; + const inside = open && s.var === "encounter" ? encounterAnswers(focus.enc) : ""; + return `
  • ${opts}${inside}
  • `; }).join(""); const risks = focus.steps.filter((s) => s.risk && s.risk.p > 0.0005).map((s) => `${s.risk.label.toLowerCase()} ${pct(s.risk.p)}`); const lb = st.policy.samples.lowBias.targets[st.colour].thisAttempt; @@ -926,6 +958,8 @@ function init() { render(); + // the screen tree (the answers inside each encounter), for the "Bonding encounter" step + fetch("data/tree.json").then((r) => r.json()).then((t) => { st.tree = t; if (st.expanded === "encounter") render(); }).catch(() => { st.tree = { best: {}, screens: {} }; }); fetch("data/policy.json").then((r) => r.json()).then((p) => { st.policy = p; S.useGame(p.samples.all); // the game (and where each colour can be bonded) comes with the route model diff --git a/site/atlas/index.html b/site/atlas/index.html index 0e14c44..8f46228 100644 --- a/site/atlas/index.html +++ b/site/atlas/index.html @@ -346,6 +346,14 @@ footer { border-top-color: var(--line); } .ex-kinds { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: var(--step--1); color: var(--muted); } .ex-kind { display: inline-flex; align-items: center; gap: 6px; } .ex-kind svg { width: 34px; height: 8px; } +.ex-inside { margin: 10px 0 4px; padding: 10px 12px; border-left: 2px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--bg) 70%, transparent); border-radius: 0 8px 8px 0; } +.ex-inside ol { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 8px; } +.ex-inside ol > li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; } +.ex-inside .n { font-family: var(--font-display); color: var(--muted); text-align: right; } +.ex-inside b { display: block; font-weight: 600; } +.ex-inside small { color: var(--muted); } +.ex-inside details summary { cursor: pointer; font-size: var(--step--1); color: var(--muted); } +.ex-inside ul { margin: 4px 0 0 16px; padding: 0; font-size: var(--step--1); } .ex-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; } .ex-head svg { width: 64px; height: 52px; } .ex-head h2 { color: var(--c); }