fix(@projects/@magic-civilization): 🐛 fix median game length calculation

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-16 23:52:14 -07:00
parent 91eeca0aaa
commit 1fc885cddc

View file

@ -357,7 +357,10 @@ def ultimate_stress_verdict(results: list[tuple[int, dict]]) -> dict[str, Any]:
turn_limit_seen = 0
for _, r in results:
outcome = r.get("outcome", "")
turn = int(r.get("turn", 0))
# `_collect` stores the final turn under "turns" (plural) at line ~89;
# reading "turn" (singular) here always returned 0 and made every
# ultimate_stress verdict fail with "median game length 0.0".
turn = int(r.get("turns", 0))
turn_limit_seen = max(turn_limit_seen, turn)
turns.append(turn)
if outcome == "victory":