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
+49 -25
View File
@@ -14,43 +14,67 @@ GATED_TREE = {"attempt": "First attempt", "scream": "Investigate the scream", "c
class Plan(unittest.TestCase):
def test_design_is_valid_and_arms_are_every_combination(self):
def test_design_is_valid(self):
plan = B.build(D, log=[])
by = {e["id"]: e for e in plan["experiments"]}
self.assertEqual(len(by["first-attempt-shadow"]["arms"]), 4)
# the Black attempt is one exact path, and it keeps the shadow's gate open
(arm,) = by["fresh-replicate"]["arms"]
self.assertEqual(arm["fix"], D["routes"]["best-reported"])
self.assertTrue(model.gate_open("shadow", arm["fix"]))
self.assertEqual(len(by["meadow-blue-route"]["arms"]), 6)
for e in plan["experiments"]:
self.assertEqual(e["status"], "running")
for a in e["arms"]:
B.check_options(e["id"], a["fix"])
# the Black attempt keeps the shadow's gate open on every arm
for a in by["first-attempt-shadow"]["arms"]:
B.check_options(e["id"], {k: v[0] for k, v in (a.get("cycle") or {}).items()})
self.assertEqual(plan["record"], D["record"])
self.assertEqual(len(plan["scripts"]["shadow"]), 12)
def test_ablation_changes_one_thing_at_a_time_and_waits_for_the_replication(self):
plan = B.build(D, log=[])
by = {e["id"]: e for e in plan["experiments"]}
base = D["routes"]["best-reported"]
self.assertEqual(by["fresh-ablate"]["status"], "waiting")
for a in by["fresh-ablate"]["arms"]:
changed = {k for k in a["fix"] if a["fix"][k] != base.get(k)}
self.assertEqual(changed, set(a["change"]), a["id"])
self.assertLessEqual(len(changed - {"leave"}), 1, a["id"]) # leaving goes with the company
self.assertTrue(model.gate_open("shadow", a["fix"]))
# once the replication has its planned count, the ablation starts
e0 = next(e for e in D["experiments"] if e["id"] == "fresh-replicate")
log = [(e0["id"], "all", {**GATED_TREE, "shadow": i < 9}) for i in range(e0["planned_per_arm"])]
by = {e["id"]: e for e in B.build(D, log=log)["experiments"]}
self.assertEqual(by["fresh-replicate"]["status"], "complete")
self.assertEqual(by["fresh-replicate"]["progress"]["rare"], 9)
self.assertEqual(by["fresh-ablate"]["status"], "running")
def test_an_unknown_option_is_refused(self):
d = copy.deepcopy(D)
d["experiments"][0]["factors"]["direction"] = ["North"]
with self.assertRaises(ValueError):
B.build(d, log=[])
def test_an_unknown_option_route_or_fact_is_refused(self):
for edit in (lambda d: d["routes"]["best-reported"].update(direction="North"),
lambda d: d["experiments"][0].update(route="nowhere"),
lambda d: d["experiments"][1]["arms"][0]["change"].update(company="Three"),
lambda d: d["experiments"][2].update(when={"luck": True}),
lambda d: d["experiments"][1].update(starts_after="nothing")):
d = copy.deepcopy(D)
edit(d)
with self.assertRaises(ValueError):
B.build(d, log=[])
def test_progress_completes_and_stops_early(self):
def test_progress(self):
e0 = D["experiments"][0]
arms = [a["id"] for a in B.arms(e0)]
seen = {**GATED_TREE, "shadow": True}
none = {**GATED_TREE, "shadow": False}
# every arm at its planned count, with shadows: complete
log = [(e0["id"], a, seen if i < 3 else none) for a in arms for i in range(e0["planned_per_arm"])]
e = B.build(D, log=log)["experiments"][0]
self.assertEqual(e["status"], "complete")
self.assertEqual(e["progress"]["rare"], 12)
self.assertAlmostEqual(e["arms"][0]["progress"]["estimate"]["rate"], 3.5 / 61)
# no shadow at all after the stop_early count: paused, for a person to look at
log = [(e0["id"], arms[i % 4], none) for i in range(e0["stop_early"]["after"])]
e = B.build(D, log=log)["experiments"][0]
self.assertEqual(e["status"], "paused")
# a run whose roll was not observed (died before the tree) is a run, not an observation
e = B.build(D, log=[(e0["id"], arms[0], {"attempt": "First attempt"})])["experiments"][0]
e = B.build(D, log=[(e0["id"], "all", {**GATED_TREE, "shadow": True})] * 3 + [(e0["id"], "all", none)] * 7)["experiments"][0]
self.assertEqual((e["status"], e["progress"]["observed"], e["progress"]["rare"]), ("running", 10, 3))
self.assertAlmostEqual(e["arms"][0]["progress"]["estimate"]["rate"], 3.5 / 11)
# a run whose shadow was not observed (died before the tree) is a run, not an observation
e = B.build(D, log=[(e0["id"], "all", {"attempt": "First attempt"})])["experiments"][0]
self.assertEqual((e["progress"]["runs"], e["progress"]["observed"]), (1, 0))
# a cycled experiment logs the combination it played; they all count toward its one arm
v = B.build(D, log=[("veteran-variety", "company=Alone / direction=East", none)] * 4)
v = next(e for e in v["experiments"] if e["id"] == "veteran-variety")
self.assertEqual((v["arms"][0]["progress"]["observed"], v["progress"]["unknownArms"]), (4, []))
# stop_early pauses an experiment for a person to look at
d = copy.deepcopy(D)
d["experiments"][0]["stop_early"] = {"after": 5, "rare_at_most": 0}
self.assertEqual(B.build(d, log=[(e0["id"], "all", none)] * 5)["experiments"][0]["status"], "paused")
def test_the_plan_id_follows_its_content(self):
a, b = B.build(D, log=[]), B.build(D, log=[])