The Black is not dice: developer statements, evidence report, and a plan that looks for the rule

- planner/knowledge.yaml: what the game's developer has said (paraphrased, dated, graded), what the Atlas does
  with each statement, and the open questions with the experiment that tests each.
- analysis/black/evidence.py -> analysis/reports/BLACK.md: counts from the runs. On the same recorded route the
  shadow shows on 21 of 79 first attempts and 1 of 80 later ones; no single route; Blue then Black after the shadow.
- game.yaml: the shadow is a guard (not a roll); what follows it is the Blue, then the Black; on-screen text for
  the squad's direction screen.
- planner/experiments.yaml v2: one exact path on every fresh account (fresh-replicate), then one choice changed
  at a time (fresh-ablate); shadow-again, second-attempt-same-path, veteran-repeat, veteran-variety; what the bot
  records about the account; the sequence to follow once the shadow shows.
- solver.js: assign() takes account facts, account offsets and cycled arms; recommendOption() answers the
  squad screen (stay + direction) in one pick.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014jqCC2LZ4x1WHQ1V57nTsv
This commit is contained in:
ekcSchiano
2026-11-16 15:24:03 +00:00
co-authored by Claude Fable 5.2
parent 51842e1aa9
commit d01ec46fcc
19 changed files with 1588 additions and 231 deletions
+31 -6
View File
@@ -308,6 +308,14 @@
return { index: i, decision: rec.decision, choice: o, propensity: 1 / on.length, margin: null, options: rec.options, reason: `${rec.label}: ${o} (mapping: 1 of ${on.length} at random)` };
}
}
// With squadmates, staying and the direction are one screen ("Go west with your squadmate", "Convince them to
// head east instead", "Leave your squadmate"): staying is answered with the direction that follows it.
if (rec.decision === "leave" && rec.choice === "Stay together") {
const then = adv.next({ ...h, leave: rec.choice });
const dp = then && then.decision === "direction" ? ((adv.game.bot_text || {}).direction || {})[then.choice] : null;
const di = dp ? texts.findIndex((t) => new RegExp(dp).test(t)) : -1;
if (di >= 0) return { index: di, decision: "leave", choice: rec.choice, also: { direction: then.choice }, propensity: rec.propensity * then.propensity, margin: null, options: rec.options, reason: `${rec.label}: ${rec.choice}, ${then.label}: ${then.choice}` };
}
const pat = pats[rec.choice];
const idx = pat ? texts.findIndex((t) => new RegExp(pat).test(t)) : -1;
const values = Object.values(rec.options).map((v) => v.pX).sort((a, b) => b - a);
@@ -362,18 +370,22 @@
return arms[order[n % k]];
}
/**
* What an attempt is for, under the plan: assign(plan, { accountSeq, attempt }) ->
* What an attempt is for, under the plan: assign(plan, { accountSeq, attempt, facts }) ->
* { experimentId, arm, fix, target, objective, sampling, seed, propensity, burn, planId }, or null when no
* experiment covers the attempt (use the account's own goal).
* accountSeq: the account's number in the order the accounts were made (0, 1, 2, ...), the same for its whole
* life; attempt: the account's attempt number (1 = its first threshing). The answer is the same every time for
* life; attempt: the account's attempt number (1 = its first threshing); facts: what the plan's `when` rules ask
* about the account, e.g. { sawShadowBefore: true }. The answer is the same every time for
* the same plan id, so a restart mid-attempt changes nothing. Pass the result to advisor():
* advisor(policy.samples.all, a.target, a.objective, { attempt, fix: a.fix, sampling: a.sampling, seed: a.seed })
* and log experimentId, arm, planId and the propensity on the run.
*/
function assign(plan, { accountSeq, attempt }) {
function assign(plan, { accountSeq, attempt, facts = {} }) {
const takes = (e) => !e.accounts || ((((accountSeq - (e.accounts.offset || 0)) % e.accounts.every) + e.accounts.every) % e.accounts.every) < e.accounts.take;
// when: facts about the account that must hold (a fact the bot does not pass counts as false)
const holds = (e) => Object.entries(e.when || {}).every(([k, v]) => (facts[k] == null ? false : facts[k]) === v);
let open = (plan.experiments || []).filter((e) => e.status === "running" && attempt >= e.attempts.from && (e.attempts.to == null || attempt <= e.attempts.to)
&& (!e.accounts || (accountSeq % e.accounts.every) < e.accounts.take));
&& takes(e) && holds(e));
if (!open.length) return null;
if (open.some((e) => e.exclusive)) open = open.filter((e) => e.exclusive); // an exclusive experiment takes its attempts whole
const total = open.reduce((s, e) => s + e.share, 0);
@@ -381,8 +393,21 @@
for (const e of open) { if (u < e.share) { exp = e; break; } u -= e.share; }
// the unit that is randomised: the account (one arm for life) or the attempt (blocks within the account)
// (accounts are counted among those the experiment takes, so its blocks stay balanced)
const nth = exp.accounts ? Math.floor(accountSeq / exp.accounts.every) * exp.accounts.take + (accountSeq % exp.accounts.every) : accountSeq;
const arm = exp.unit === "account" ? armFor(exp, nth) : armFor({ ...exp, seed: `${exp.seed || 0}|${accountSeq}` }, attempt - exp.attempts.from);
const off = exp.accounts ? (((accountSeq - (exp.accounts.offset || 0)) % exp.accounts.every) + exp.accounts.every) % exp.accounts.every : 0;
const nth = exp.accounts ? Math.floor(accountSeq / exp.accounts.every) * exp.accounts.take + off : accountSeq;
let arm = exp.unit === "account" ? armFor(exp, nth) : armFor({ ...exp, seed: `${exp.seed || 0}|${accountSeq}` }, attempt - exp.attempts.from);
// cycle: a different combination of these decisions on every attempt of the account, none repeated until all
// are used (the combinations are walked with a step that shares no factor with their number)
if (arm.cycle) {
const keys = Object.keys(arm.cycle), total = keys.reduce((n, k) => n * arm.cycle[k].length, 1);
const gcd = (a, b) => (b ? gcd(b, a % b) : a), h = hash(`${exp.seed || 0}|${exp.id}|${accountSeq}`);
let step = (h % total) || 1;
while (gcd(step, total) !== 1) step = (step % total) + 1;
let i = ((h >>> 8) + (attempt - exp.attempts.from) * step) % total;
const combo = {};
for (const k of keys) { combo[k] = arm.cycle[k][i % arm.cycle[k].length]; i = Math.floor(i / arm.cycle[k].length); }
arm = { id: keys.map((k) => `${k}=${combo[k]}`).join(" / "), fix: { ...arm.fix, ...combo } };
}
return { experimentId: exp.id, arm: arm.id, fix: arm.fix || null, target: exp.target, objective: exp.objective || "eventually",
sampling: exp.sampling || "best", seed: hash(`${plan.seed || 0}|${exp.id}|${accountSeq}|${attempt}`),
propensity: (exp.share / total) / exp.arms.length, burn: exp.burn || null, planId: plan.id };
+12 -2
View File
@@ -70,6 +70,11 @@ chance:
dieHour: { label: Survive the hour, outcomes: [die, live], context: [cadet, post], risk_label: Killed before the hour }
shadow:
label: Shadow at the tree
# Not dice. The developer has said the seed plays no part in whether the Black shows itself: it shows when the
# rider's choices meet its conditions (planner/knowledge.yaml). The conditions are not known yet, so the model
# still treats it as a roll: the number is the share of runs like this one that met them, which is our
# ignorance, not the game's chance. `guard` marks that for the page and the reports.
guard: true
outcomes: ["yes", "no"]
# The shadow is close to a first-attempt event (November 2026, form submissions, gated tree runs: 69 shadows in
# 748 first attempts, 7 in 1,995 later ones, the same in every week), so first and later attempts are two
@@ -80,7 +85,10 @@ chance:
# 78 shadows in 4199 tree runs that investigated and helped, 2 (both form submissions) in 646 that did not.
requires: { scream: Investigate the scream, clearing: Help your squadmate }
otherwise: "no"
shadowColour: { label: Shadow dragon, outcomes: [Black, Blue], context: [] }
# After the shadow comes a Blue (at the redwood), then the Black: riders' notes describe one sequence, and the
# Blue is a trial on the way (analysis/reports/BLACK.md section 5). The form records only which dragon ended the
# run, so this is counted as "reached the Black" against "died at the Blue".
shadowColour: { label: "After the shadow: past the Blue to the Black", outcomes: [Black, Blue], context: [] }
meadow: { label: Meadow dragon, outcomes: [Orange, Brown, Blue], context: [cadet, post, fs, direction, company] }
# Bonding encounters: where each colour can be bonded. A run can only bond the encounter's own colour, except at
@@ -225,7 +233,9 @@ from_form:
# recommendOption() in core/solver.js uses these to point the bot at the recommended option on its screen.
bot_text:
company: { Alone: "^enter the valley alone", "1 Squadmate": "^enter the valley with one", "2 Squadmates": "^enter the valley with two" }
direction: { East: "^head east", West: "^head west", Center: "^head toward the center of the forest" }
leave: { Leave them: "^leave your squadmates?$" } # staying is answered on the same screen as the direction
# alone (or after leaving the squad), and with the squad: going their way or convincing them
direction: { East: "^head east|^go east with your squad|^convince them to head east", West: "^head west|^go west with your squad|^convince them to head west", Center: "^head toward the center of the forest" }
react: { Hold still: "hold still", Respect / face it: "in respect|turn to face it", Retreat / run: "^run and hope", Hide: "^hide", Meet its gaze: "meeting its gaze" }
scream: { Investigate the scream: "^investigate the scream", Keep walking: "^keep walking" }
clearing: { Help your squadmate: "^help your squadmate", Walk away: "^play it safe and leave them" }