Site repairs: first-attempt Black, shadow evidence, author's statements
CI / test (pull_request) Successful in 2m12s
CI / test (pull_request) Successful in 2m12s
- analysis/black/evidence.py also writes data/public/black.json (--check covers both) - Odds: the Black card shows first-attempt odds; new "The Black is not dice" panel from black.json - "Earlier choices barely change who waits" card replaced by the first-attempt finding - Journey eyebrow and bonding step no longer call the rolls pure luck - Footer, lore line and Reddit post: the author's statements (no roll worse than 1 in 20, the Black is not luck) replace the "10% chaos" claim - Report tab: the community Google Form first (no account needed), the Gitea form second; register listed as a source - register.js: snapshot label reads raw.source (was undefined) - build.js copies black.json, tree.json and experiments.json Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3b5c655d51
commit
73a6f5d355
@@ -20,6 +20,7 @@ sys.path.insert(0, str(ROOT / "core"))
|
||||
from atlas import runs as runs_io # noqa: E402
|
||||
|
||||
OUT = ROOT / "analysis/reports/BLACK.md"
|
||||
OUT_JSON = ROOT / "data/public/black.json" # the same numbers, for the page
|
||||
ROUTE = ["company", "direction", "combat_first", "combat_second", "resolution", "post_path"]
|
||||
ROUTE_NAMES = "company, first direction, first move in the fight, the dagger, the bullies' fate, the fork"
|
||||
|
||||
@@ -97,8 +98,10 @@ def blue_mistake(note):
|
||||
|
||||
|
||||
def build():
|
||||
"""(the report as Markdown, its key numbers as a dict for the page)."""
|
||||
runs = runs_io.read()
|
||||
G = [r for r in runs if gated_tree(r)]
|
||||
facts = {"schema": 1, "by_attempt": {}}
|
||||
L = ["# The Black dragon: what the runs show", "",
|
||||
"Written by `analysis/black/evidence.py` from `data/public/runs_clean.csv`. Counts only; nothing is fitted. "
|
||||
"\"Gated tree runs\" investigated the scream, helped the squadmate and climbed the tree, the two gates the "
|
||||
@@ -114,6 +117,7 @@ def build():
|
||||
for g in ("form", "bulk logs", "bot"):
|
||||
rs = [r for r in G if group(r) == g and r["attempt"] and lo <= r["attempt"] <= hi]
|
||||
cells.append(frac(sum(bool(r["saw_shadow"]) for r in rs), len(rs)))
|
||||
facts["by_attempt"].setdefault(g, {})[name] = [sum(bool(r["saw_shadow"]) for r in rs), len(rs)]
|
||||
L.append(f"| {name} | " + " | ".join(cells) + " |")
|
||||
cells = []
|
||||
for g in ("form", "bulk logs", "bot"):
|
||||
@@ -136,6 +140,10 @@ def build():
|
||||
c[i] += bool(r["saw_shadow"])
|
||||
c[i + 1] += 1
|
||||
orr, obs, exp, z = mantel_haenszel(by.values())
|
||||
facts["same_route"] = {"routes": len(by), "first_shadows": round(obs), "expected": round(exp, 1),
|
||||
"odds_ratio": round(orr, 1), "z": round(z, 1)}
|
||||
facts["form_first"] = [sum(c[0] for c in by.values()), sum(c[1] for c in by.values())]
|
||||
facts["form_later"] = [sum(c[2] for c in by.values()), sum(c[3] for c in by.values())]
|
||||
L += ["## 2. The same route on a first attempt and on a later one", "",
|
||||
f"If the shadow depended only on the choices the form records ({ROUTE_NAMES}), a route would do as well on a "
|
||||
"later attempt as on a first. It does not.", "",
|
||||
@@ -151,6 +159,7 @@ def build():
|
||||
|
||||
# 3. is it decided by route + cadet assignment?
|
||||
best_key, best = max(((k, v) for k, v in by.items() if v[1] >= 20), key=lambda kv: kv[1][0] / kv[1][1])
|
||||
facts["best_route"] = {"route": list(best_key), "first": [best[0], best[1]], "later": [best[2], best[3]]}
|
||||
B = [r for r in F if r["attempt"] == 1 and tuple(r[k] for k in ROUTE) == best_key]
|
||||
cells = tally(B, lambda r: (r["wing"], r["section"], r["squad"]))
|
||||
multi = {k: v for k, v in cells.items() if v[1] >= 2}
|
||||
@@ -178,6 +187,7 @@ def build():
|
||||
t = collections.Counter(r[col] for r in S1)
|
||||
L.append(f"- **{label}:** " + ", ".join(f"{k} {v}" for k, v in t.most_common()))
|
||||
outside = [r for r in runs if r["saw_shadow"] and not (r["scream"] == "Investigate & help" and r["hour"] == "Tree")]
|
||||
facts["shadow_routes"] = {"runs": len(S1), "routes": len({tuple(r[k] for k in ROUTE) for r in S1}), "off_gate": len(outside)}
|
||||
L += ["", f"Shadows reported without both gates: {len(outside)} (likely mis-entered).", ""]
|
||||
|
||||
# 5. after the shadow
|
||||
@@ -190,6 +200,9 @@ def build():
|
||||
ans[a][0] += r["outcome"] == "Bonded"
|
||||
ans[a][1] += 1
|
||||
blue_dead = [r for r in SH if r["enc_Blue"] == "Incinerated"]
|
||||
facts["after_shadow"] = {"reached_black": len(black), "bonded_black": sum(r["outcome"] == "Bonded" for r in black),
|
||||
"died_at_blue": len(blue_dead),
|
||||
"answers": {k: [y, n] for k, (y, n) in sorted(ans.items(), key=lambda kv: -kv[1][1])}}
|
||||
mis = collections.Counter(blue_mistake((r["bond_note"] or "") + " " + (r["death_note"] or "")) for r in blue_dead)
|
||||
L += ["## 5. After the shadow: the Blue, then the Black", "",
|
||||
"The riders' notes describe one sequence: follow the shadow, a Blue lands and burns another cadet, the Blue "
|
||||
@@ -224,6 +237,9 @@ def build():
|
||||
cur = cur + 1 if s is not None and s == prev else (1 if s is not None else 0)
|
||||
prev, streak = s, max(streak, cur)
|
||||
botg = [r for r in G if group(r) == "bot"]
|
||||
facts["bot"] = {"attempts": len(seen), "accounts": len(acc), "gated_tree": len(botg),
|
||||
"shadows": sum(bool(r["saw_shadow"]) for r in botg),
|
||||
"earliest_attempt": min((min(v) for v in acc.values() if v), default=0)}
|
||||
routes = collections.Counter(tuple(r[k] for k in ROUTE) for r in botg)
|
||||
L += [f"{len(seen)} attempts on {len(acc)} accounts; the earliest attempt logged on any account is number "
|
||||
f"{min((min(v) for v in acc.values() if v), default=0)}. Gated tree runs: {len(botg)}, shadows "
|
||||
@@ -231,21 +247,24 @@ def build():
|
||||
f"(the commonest {routes.most_common(1)[0][1] if routes else 0} times). The bot has not played a first attempt, "
|
||||
"so it has not yet tested the one situation where riders report the shadow. The most times any account has "
|
||||
f"repeated one route in a row is {streak}.", ""]
|
||||
return "\n".join(L) + "\n"
|
||||
return "\n".join(L) + "\n", facts
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
ap = argparse.ArgumentParser(description=__doc__)
|
||||
ap.add_argument("--check", action="store_true")
|
||||
a = ap.parse_args(argv)
|
||||
text = build()
|
||||
text, facts = build()
|
||||
data = json.dumps(facts, ensure_ascii=False, indent=1) + "\n"
|
||||
if a.check:
|
||||
if not OUT.exists() or OUT.read_text(encoding="utf-8") != text:
|
||||
print(f"{OUT} is out of date (run python analysis/black/evidence.py)", file=sys.stderr)
|
||||
return 1
|
||||
for path, want in ((OUT, text), (OUT_JSON, data)):
|
||||
if not path.exists() or path.read_text(encoding="utf-8") != want:
|
||||
print(f"{path} is out of date (run python analysis/black/evidence.py)", file=sys.stderr)
|
||||
return 1
|
||||
return 0
|
||||
OUT.write_text(text, encoding="utf-8")
|
||||
print(f"wrote {OUT.relative_to(ROOT)}")
|
||||
OUT_JSON.write_text(data, encoding="utf-8")
|
||||
print(f"wrote {OUT.relative_to(ROOT)} and {OUT_JSON.relative_to(ROOT)}")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user