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
+48 -18
View File
@@ -168,29 +168,59 @@ test("mapping: uniform sampling picks among the options on the screen, with its
assert.strictEqual(S.recommendOption(a, {}, screen).index, S.recommendOption(a, {}, screen).index); // same seed, same pick
});
test("the experiment plan: balanced arms across new accounts, shares after the first attempt", () => {
test("the experiment plan: what each attempt of each account is for", () => {
const plan = JSON.parse(fs.readFileSync(path.join(ROOT, "data/public/experiments.json"), "utf8"));
const first = plan.experiments.find((e) => e.id === "first-attempt-shadow");
const count = {};
for (let acc = 0; acc < 4 * 25; acc++) {
const all = published.samples.all;
// attempt 1: every new account plays the same exact path (the replication)
for (let acc = 0; acc < 30; acc++) {
const a = S.assign(plan, { accountSeq: acc, attempt: 1 });
assert.strictEqual(a.experimentId, "first-attempt-shadow");
assert.strictEqual(a.experimentId, "fresh-replicate");
assert.strictEqual(a.target, "Black");
assert.strictEqual(a.propensity, 1 / first.arms.length);
assert.strictEqual(a.fix.direction, "West");
assert.deepStrictEqual(a, S.assign(plan, { accountSeq: acc, attempt: 1 })); // the same every time
count[a.arm] = (count[a.arm] || 0) + 1;
S.advisor(published.samples.all, a.target, a.objective, { attempt: 1, fix: a.fix }); // every arm is playable
}
assert.deepStrictEqual(Object.values(count), [25, 25, 25, 25]);
// attempt 2: half the accounts check the shadow again; the others go to the shared experiments
const second = Array.from({ length: 40 }, (_, acc) => S.assign(plan, { accountSeq: acc, attempt: 2 }).experimentId);
assert.strictEqual(second.filter((id) => id === "attempt-2-shadow").length, 20);
const later = {};
for (let acc = 0; acc < 60; acc++) for (let t = 3; t <= 18; t++) { const a = S.assign(plan, { accountSeq: acc, attempt: t }); later[a.experimentId] = (later[a.experimentId] || 0) + 1; }
assert.deepStrictEqual(Object.keys(later).sort(), ["mapping", "meadow-blue-route", "sentinel"]);
assert.ok(Math.abs(later["meadow-blue-route"] / (60 * 16) - 0.6) < 0.06);
// an experiment that is no longer running is not assigned; its share goes to the others
const a1 = S.assign(plan, { accountSeq: 0, attempt: 1 });
const adv = S.advisor(all, a1.target, a1.objective, { attempt: 1, fix: a1.fix });
let h = {};
for (let i = 0; i < 20; i++) {
const s = adv.step(h);
if (s.kind === "decision") { if (s.var === "encounter") break; if (a1.fix[s.var]) assert.strictEqual(s.choice, a1.fix[s.var]); h[s.var] = s.choice; }
else if (s.kind === "chance") h[s.var] = s.var === "shadow" ? "no" : Object.keys(s.probs).find((k) => k !== "die");
else break;
}
assert.strictEqual(h.hour, "Tree");
// the ablation waits for the replication, then gives every arm the same number of accounts
const stage2 = { ...plan, experiments: plan.experiments.map((e) => (e.id === "fresh-replicate" ? { ...e, status: "complete" } : e.id === "fresh-ablate" ? { ...e, status: "running" } : e)) };
const count = {};
for (let acc = 0; acc < 12 * 5; acc++) { const a = S.assign(stage2, { accountSeq: acc, attempt: 1 }); assert.strictEqual(a.experimentId, "fresh-ablate"); count[a.arm] = (count[a.arm] || 0) + 1; }
assert.deepStrictEqual(Object.values(count), Array(12).fill(5));
// with squadmates, staying and the direction are one screen
const squad = stage2.experiments.find((e) => e.id === "fresh-ablate").arms.find((a) => a.id === "with two squadmates");
const rec = S.recommendOption(S.advisor(all, "Black", "eventually", { attempt: 1, fix: squad.fix }), { company: "2 Squadmates" },
["Go east with your squad", "Leave your squadmates", "Convince them to head west instead"]);
assert.strictEqual(rec.index, 2);
assert.deepStrictEqual(rec.also, { direction: "West" });
// attempt 2: an account that saw the shadow tries the same path again; half of the others do too
const who = (attempt, facts) => Array.from({ length: 40 }, (_, acc) => (S.assign(plan, { accountSeq: acc, attempt, facts }) || {}).experimentId);
assert.ok(who(2, { sawShadowBefore: true }).every((id) => id === "shadow-again"));
assert.strictEqual(who(2, { sawShadowBefore: false }).filter((id) => id === "second-attempt-same-path").length, 20);
// later: two accounts in ten are the long-lived ones, the rest share the research experiments
const later = who(6, { sawShadowBefore: false });
assert.strictEqual(later.filter((id) => id === "veteran-repeat").length, 4);
assert.strictEqual(later.filter((id) => id === "veteran-variety").length, 4);
assert.deepStrictEqual([...new Set(later)].sort(), ["mapping", "meadow-blue-route", "sentinel", "veteran-repeat", "veteran-variety"]);
// variety: a different combination on every attempt, both gates kept, every one playable
const combos = new Set();
for (let t = 3; t < 3 + 60; t++) {
const a = S.assign(plan, { accountSeq: 11, attempt: t, facts: { sawShadowBefore: false } });
assert.strictEqual(a.experimentId, "veteran-variety");
assert.strictEqual(a.fix.clearing, "Help your squadmate");
combos.add(a.arm);
if (t < 8) S.advisor(all, a.target, a.objective, { attempt: t, fix: a.fix });
}
assert.strictEqual(combos.size, 60);
// an experiment that is not running is not assigned; its share goes to the others
const done = { ...plan, experiments: plan.experiments.map((e) => (e.id === "meadow-blue-route" ? { ...e, status: "complete" } : e)) };
assert.notStrictEqual(S.assign(done, { accountSeq: 1, attempt: 5 }).experimentId, "meadow-blue-route");
assert.notStrictEqual(S.assign(done, { accountSeq: 5, attempt: 5 }).experimentId, "meadow-blue-route");
assert.strictEqual(S.assign({ ...plan, experiments: [] }, { accountSeq: 1, attempt: 5 }), null);
});