From 000497deaee3e2d979e8e312cb525aa744e23a82 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Sat, 28 Nov 2026 11:34:35 -0500 Subject: [PATCH] Update stale test_head_review assertions for NonBlankText and TeamBoardPublicationStore --- tests/test_head_review.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_head_review.py b/tests/test_head_review.py index ba918fb779..f4cd9118de 100644 --- a/tests/test_head_review.py +++ b/tests/test_head_review.py @@ -103,6 +103,7 @@ ReviewTimerUp, StuckMerge, ) +from agent_comms.team.team_hud import TeamBoardPublicationStore, TeamHud from agent_comms.transport.connector_caller import DirectorCaller from agent_comms.transport.tool_caller import PeerCaller, ThreadCaller from agent_comms.transport.tools.orders import CommsHeadVerdictTool @@ -121,17 +122,16 @@ QUALIFIED = VerdictReason("The source stage is reviewed while paired implementation remains incomplete") -@pytest.mark.parametrize('roast,fields', ( - ('The decision could be improved because the same required checks are repeated across fields', - {'why', 'roast.blunt'}), - ('Maybe improve this', {'why', 'roast.words', 'roast.because', 'roast.blunt'}), +@pytest.mark.parametrize('roast,fix,fields', ( + (' ', 'Put the repeated checks on their existing declaring parent class', {'why', 'roast'}), + ('', ' ', {'why', 'roast', 'fix'}), )) -def test_back_collects_missing_and_invalid_fields(roast: str, fields: set[str]) -> None: +def test_back_collects_missing_and_invalid_fields(roast: str, fix: str, fields: set[str]) -> None: with pytest.raises(RecordProblems) as refused: judge.JudgeVerb.parse([ 'back', '--pr', '1', '--head', 'a' * 40, '--at', 'owner.py:1', '--roast', roast, - '--fix', 'Put the repeated checks on their existing declaring parent class', + '--fix', fix, ]) assert refused.value.problems.keys() >= fields @@ -1339,10 +1339,10 @@ def test_acceptance_over_the_growth_limit_needs_a_reason_naming_each_growing_fil back = cli("judge", "back", "--as", "colleague", "--repo", request.repo.to_wire(), "--pr", str(request.pr), "--head", head, "--at", "owner.py:2", - "--roast", "The decision could be improved because it repeats the required checks across fields", + "--roast", " ", "--fix", "Put the repeated checks on their existing declaring parent class") assert back.returncode == 1, back.stdout + back.stderr - assert "why" in back.stderr and "roast.blunt" in back.stderr + assert "why" in back.stderr and "roast" in back.stderr assert comms.goals.todos.get(todo.id) == before accepted = cli(*common, "--serves", before.order.checked().edits[0], "--growth", @@ -1385,9 +1385,9 @@ def test_judge_ok_keeps_every_repeated_growth_reason(): growth = verb.head_operation().growth assert all(growth.names(f"src/{name}") for name in ("first.py", "second.py", "third.py")) assert not growth.names("src/fourth.py") - with pytest.raises(ToolRefusedError, match="12\\+ words"): + with pytest.raises(ToolRefusedError, match="1\\+ words"): judge.JudgeVerb.parse(["ok", "--pr", "8", "--head", "abc123def", "--why", ACCEPTED.text, - "--growth", reasons[0], "--growth", "short.py grows"]).head_operation() + "--growth", reasons[0], "--growth", " "]).head_operation() def test_an_armed_head_with_a_red_required_check_is_a_stuck_merge_every_pass(head_bus): @@ -1465,7 +1465,7 @@ def test_retained_head_verdict_precedes_the_published_lost_packet( owner = comms.registry.require('colleague').incarnation ping = replace(RulePing.capture(lost), since=RecordedEventTime(published)) packet = TeamDecisions(owner, (ping,), (ping,), ()) - TeamUpdateStore.record(comms.root, packet) + TeamBoardPublicationStore.write_all(comms.root, (TeamHud.for_failure(owner, packet),)) comms.threads.set_heartbeat_delivery('colleague', OnHeartbeatDelivery) original, = packet.send(comms, ()) previous = TeamUpdate.latest(comms, owner) @@ -1494,7 +1494,7 @@ def test_retained_head_verdict_precedes_the_published_lost_packet( owner, published=TeamUpdate.published(comms, owner)) assert delivery.packet.handled[0].since == ping.since assert (delivery.open_pings == ()) is cleared - TeamUpdateStore.record(comms.root, delivery.packet) + TeamBoardPublicationStore.write_all(comms.root, (TeamHud.for_failure(owner, delivery.packet),)) delivery.packet.send(comms, ()) assert TeamUpdate.latest(comms, owner) == (delivery.packet,) assert (TeamUpdate.current_board(comms, comms.registry.require('colleague').incarnation) == ()) is cleared