diff --git a/tests/model/test_coordination_snapshot.py b/tests/model/test_coordination_snapshot.py deleted file mode 100644 index 6dee86401..000000000 --- a/tests/model/test_coordination_snapshot.py +++ /dev/null @@ -1,17 +0,0 @@ -"""An unchanged coordination log gives the same snapshot on every read, with every unread message counted.""" - -from agent_comms.comms import wire -from agent_comms.threads import Thread - - -def test_unread_count_is_stable_across_repeated_reads_of_a_long_log(tmp_path): - comms = wire(tmp_path) - for name in ("sender", "reader"): - comms.registry.declare(Thread(name, frozenset({"team"}), str(tmp_path))) - count = 100 - for _ in range(count): - comms.messaging.send("sender", "#team", "A historical coordination update. " * 10) - first = comms.views.coordination_snapshot("reader") - assert first.unread["#team"] == count - for _ in range(100): - assert comms.views.coordination_snapshot("reader") == first diff --git a/tests/model/test_queue_attachment.py b/tests/model/test_queue_attachment.py index 31d4ca735..d3c86cd16 100644 --- a/tests/model/test_queue_attachment.py +++ b/tests/model/test_queue_attachment.py @@ -44,7 +44,7 @@ def test_capture_after_binding_names_the_bound_scope(tmp_path): attachment = QueueAttachment() token = attachment.begin("source") attachment.bind(QueueChangedUpdate(scope, 0, AvailableQueueProjection()), "source", token) - assert attachment.capture_human_input(comms, scope) == HumanInputOrigin.capture(comms, scope.claim_scope) + assert attachment.capture_human_input(comms, scope) == HumanInputOrigin.capture(comms, scope.claimed_identity) def test_capture_after_a_replacement_begins_is_refused(tmp_path): diff --git a/tests/textual/test_conversation_value.py b/tests/textual/test_conversation_value.py index bfa4c5d98..849daf678 100644 --- a/tests/textual/test_conversation_value.py +++ b/tests/textual/test_conversation_value.py @@ -49,7 +49,7 @@ async def test_channel_dm_and_feed_keep_typed_destinations_through_open_send_and ): mode = await target.open(context) screen = app.selected_session - assert screen.navigation_target_name == target.name + assert screen.navigation_target == target await screen.wait_content_ready() chat = screen.query_one(CommsChatView) await ui.until( @@ -138,8 +138,8 @@ async def test_renamed_dm_reopens_the_same_tab_and_sends_to_the_current_name(wor history = chat.message_history await ui.until( lambda: history.source_ready - and history.revision.selection.peer.name == "renamed" - and history.revision.selection.peer == peer.incarnation + and history.page_source.revision.selection.peer.name == "renamed" + and history.page_source.revision.selection.peer == peer.incarnation and "BEFORE_RENAME" in ui.painted(window), why="the renamed conversation's captured source and painted message", ) diff --git a/tests/textual/test_saved_history_coverage.py b/tests/textual/test_saved_history_coverage.py index f592af0a4..50146dc8c 100644 --- a/tests/textual/test_saved_history_coverage.py +++ b/tests/textual/test_saved_history_coverage.py @@ -23,7 +23,7 @@ async def saved_history(workspace, ui): page = workspace.comms.transcripts.thread_transcript_page("saved") conversation = ui.conversation ui.attach_agent(ui.detached_agent()) - await conversation.transcript.snapshot(page) + conversation.transcript.received(page) await ui.until(lambda: conversation.contents.query_children(TranscriptHistory), why="the saved history") return page, conversation.contents.query_children(TranscriptHistory).first(), conversation.query_one(SessionDetails) @@ -40,7 +40,7 @@ async def test_saved_history_is_unavailable_while_its_source_is_parked_and_retur await ui.until(lambda: "Saved history not loaded" in details.title, why="saved history reported not loaded") assert not history.state.reports_coverage - await conversation.transcript.snapshot(page) + conversation.transcript.received(page) await ui.until(lambda: history.state.reports_coverage, why="coverage reported again") await ui.until(lambda: "Saved history available" in details.title, why="saved history reported available again") assert "Saved history available" in details.overview_text @@ -61,6 +61,6 @@ async def test_a_live_message_does_not_count_as_saved_history_coverage(workspace await conversation.transcript.reveal_retained(history) await ui.until(lambda: "Saved history not loaded" in details.title, why="saved history reported not loaded") assert not conversation.transcript.reports_coverage - await conversation.transcript.snapshot(page) + conversation.transcript.received(page) await ui.until(lambda: "Saved history available" in details.title, why="saved history reported available") assert tuple(history.pages) == pages diff --git a/tests/textual/test_sent_message_drawn_once.py b/tests/textual/test_sent_message_drawn_once.py index 0c0f10c77..de4936146 100644 --- a/tests/textual/test_sent_message_drawn_once.py +++ b/tests/textual/test_sent_message_drawn_once.py @@ -23,7 +23,7 @@ async def test_a_start_notice_after_the_saved_history_draws_the_message_once(wor agent = ui.detached_agent("source") ui.attach_agent(agent) # The page read finds the message in the session file before Core's start notice arrives. - await view.transcript.snapshot(workspace.comms.transcripts.thread_transcript_page("source")) + view.transcript.received(workspace.comms.transcripts.thread_transcript_page("source")) await ui.until(lambda: ui.painted(view.window).count(TOKEN) == 1, why="the saved message") await agents.deliver(agent, {