1# Author: Simon-Pierre Boucher — simon-pierre.boucher@uqo.ca2from __future__ import annotations34import pytest56from agentic_valuation.agents.roles import DEFAULT_ROLE_IDS7from agentic_valuation.debate.committees import assign, committee_models, pair_for_tier89ROLES = list(DEFAULT_ROLE_IDS)101112def test_homogeneous_committees():13 pair = pair_for_tier("mid")14 assert set(assign(ROLES, "all_anthropic", tx_id="a").values()) == {pair["anthropic"]}15 assert set(assign(ROLES, "all_openai", tx_id="a").values()) == {pair["openai"]}16 assert committee_models("mixed_random", "mid") == [pair["anthropic"], pair["openai"]]17 with pytest.raises(KeyError):18 assign(ROLES, "all_mistral")192021def test_mixed_random_is_deterministic_and_balanced():22 a1 = assign(ROLES, "mixed_random", seed=1, tx_id="SYN1")23 a2 = assign(ROLES, "mixed_random", seed=1, tx_id="SYN1")24 a3 = assign(ROLES, "mixed_random", seed=1, tx_id="SYN2")25 assert a1 == a2 and list(a1) == ROLES26 assert a1 != a3 # varies across properties27 pair = pair_for_tier("mid")28 assert sum(v == pair["anthropic"] for v in a1.values()) == 629 odd = assign(ROLES[:11], "mixed_random", seed=1, tx_id="x")30 assert sum(v == pair["anthropic"] for v in odd.values()) in (5, 6)31