AgentnessBench / tests /runtime /test_memory_persona.py
irregular6612's picture
refactor(scenario): delete predator_evade; template is the canonical scenario
93cd78f
Raw
History Blame Contribute Delete
843 Bytes
from proteus.game.engine.difficulty import Difficulty
from proteus.game.runtime.memory_gen import generate_memory
from proteus.game.metrics.persona import PersonaWeights
def test_persona_memory_is_deterministic_and_tags_persona():
w = PersonaWeights(persona_weight_id="risk_averse", risk_cost=5.0)
ck = generate_memory(
"template", agent=None, difficulty=Difficulty.EASY, seed=42,
memory_turns=5, model_name="ref", clock=lambda: "FIXED", persona=w,
)
assert ck.persona_weight_id == "risk_averse"
assert 1 <= len(ck.memory_turns) <= 5
# risk-averse demo never moves toward the (far-east) predator on the first turn
assert ck.memory_turns[0].action in ("up", "down", "left", "stay")
# weights are NOT in the participant-visible checkpoint text
assert "risk_cost" not in ck.model_dump_json()