brad-did-something / tests /probe_presentation.py
qFelix's picture
Brad Did Something - Gradio/FastAPI Space on HF
78c0f6e
Raw
History Blame Contribute Delete
1.98 kB
"""Probe the full 3-round presentation against the live model.
Usage: set MODAL_URL/MODAL_TOKEN/BDS_LLM_TIMEOUT, then
python tests/probe_presentation.py
"""
import sys
sys.path.insert(0, ".")
from game import events, presentation # noqa: E402
from game.state import GameState # noqa: E402
s = GameState(session_id="probe", phase="free_roam")
s.revenue = 310_000
s.crisis_number = 3 # next event is 4 β†’ presentation
s.log("Event 1 β€” Brad promised TerraLogix a feature that does not exist. -$80K.")
s.log("Event 2 β€” Stacey emailed the internal nickname file to Vantage Group. "
"Player owned it honestly. +$60K.")
s.log("Event 3 β€” Kevin cited a fictional statistic on a client call. "
"Player commissioned a real survey. +$45K.")
s.npc("brad").incident_count = 1
s.npc("stacey").incident_count = 1
s.npc("kevin").incident_count = 1
event = events.next_event(s)
assert event["kind"] == "presentation"
ANSWERS = [
"The TerraLogix promise was a process failure and it was mine to catch. "
"We turned it into a pilot program with real milestones.",
"I would rather over-apologize to a client than hide a mistake from this "
"board. The nickname file cost us pride, not pipeline.",
"Next quarter every external number passes one sanity check: does Kevin's "
"pie chart sum to one hundred. We are optimistic.",
]
data = presentation.advance(s, "", "")
turn = 0
while data["kind"] == "round":
print(f"\n=== ROUND {data['round']}/{data['total_rounds']} "
f"tone={data['board_tone']} input_only={data['input_only']}")
print(f"BOARD: {data['board_dialogue']}")
if data.get("option_a"):
print(f" A: {data['option_a']}")
print(f" B: {data['option_b']}")
answer = ANSWERS[min(turn, len(ANSWERS) - 1)]
turn += 1
data = presentation.advance(s, "custom", answer)
print(f"\n=== OUTCOME score={data['score']} swing={data['revenue_delta']:+,} "
f"budget+{data['budget_unlock']}")