From 5fff7ce996caccc9544498022b4e7332ef09a384 Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Fri, 23 Oct 2026 14:22:07 -0400 Subject: [PATCH] Delete the second bus install after a root is claimed wire() claims the root, and RootRuntime.adopt creates its bus there (root_runtime.py:69). Sixty Bus.install(Bus.path_in(x.root)) calls after wire() installed that bus a second time; they are gone, with the two comms fixtures that existed only to make that call. Tests that build a bus on a directory no root claims keep their install. Co-Authored-By: Claude Opus 5.5 --- tests/acp_error_payload_installed_journey.py | 3 --- tests/bus_record_fixture.py | 3 +-- tests/c4_coordination_installed_ui.py | 3 --- tests/config_option_authority_installed_pilot.py | 2 -- tests/goal_owner_fixture.py | 2 -- tests/native_backend_fixture.py | 3 +-- tests/native_request_wait_installed_journey.py | 2 -- tests/ordinary_claims_live_journey.py | 2 -- tests/test_acp.py | 2 -- tests/test_carry.py | 2 -- tests/test_carry_session_locations.py | 3 --- tests/test_channel_coding_tools.py | 3 --- tests/test_check_root.py | 2 -- tests/test_command_families.py | 2 -- tests/test_commander_forks.py | 2 -- tests/test_deleted_thread_observation.py | 2 -- tests/test_envelope_bus_integration.py | 3 --- tests/test_goal_input_review.py | 2 -- tests/test_goal_owner_pause.py | 3 --- tests/test_held_sends.py | 2 -- tests/test_historical_page_scope.py | 4 +--- tests/test_historical_views.py | 1 - tests/test_holder_standing_rules.py | 3 --- tests/test_importing.py | 7 ------- tests/test_install_session_bridge.py | 2 -- tests/test_native_only_execution.py | 2 -- tests/test_native_owner_launcher_resolution.py | 2 -- tests/test_observer_death.py | 2 -- tests/test_order_progress.py | 2 -- tests/test_order_story.py | 2 -- tests/test_private_runtime_bootstrap.py | 2 -- tests/test_proof_build.py | 4 +--- tests/test_read_ledger.py | 2 -- tests/test_retained_context_operations.py | 4 ---- tests/test_stack_native_compaction.py | 2 -- tests/test_stopped_claim_expiry.py | 2 -- tests/test_task_decisions.py | 9 --------- tests/test_todos.py | 1 - tests/test_turn_digests.py | 1 - tests/test_turn_goal_account.py | 9 --------- tests/test_unowned_checkout_work.py | 2 -- tests/test_visibility_views.py | 2 -- tests/verify_connector_live.py | 2 -- tests/verify_connector_maintenance.py | 2 -- tests/verify_connector_tools.py | 2 -- tools/proofs/cn_phase3_record.py | 2 -- tools/reproduce_thread_list.py | 2 -- 47 files changed, 4 insertions(+), 121 deletions(-) diff --git a/tests/acp_error_payload_installed_journey.py b/tests/acp_error_payload_installed_journey.py index 1b03b462d6..8dd3552563 100644 --- a/tests/acp_error_payload_installed_journey.py +++ b/tests/acp_error_payload_installed_journey.py @@ -7,7 +7,6 @@ from __future__ import annotations -from agent_comms.bus import Bus from agent_comms.session_file import RegistrySessionLocation from agent_comms.pi_vocabulary import OffThinkingLevel @@ -32,7 +31,6 @@ from agent_comms.comms import wire from agent_comms.fresh_private_session import create_fresh_private_session from agent_comms.field_codec import FieldCodec -from agent_comms.input_disposition import InputDispositions from agent_comms.threads import Thread from native_context_budget_installed_journey import ReceiptSubscriber @@ -126,7 +124,6 @@ def log_message(self, *_): "retry": {"enabled": False, "maxRetries": 0, "provider": {"maxRetries": 0}}, })) comms = wire(root) - Bus.install(Bus.path_in(comms.root)) fresh = create_fresh_private_session(evidence / "sessions", worktree=project) comms.registry.declare(Thread('error-native', frozenset(), str(project), session_file=RegistrySessionLocation.from_path(str(fresh.path), comms.root), model=DeclaredModel('error-local/error-fixture'), thinking_level=OffThinkingLevel)) environment = {key: value for key, value in os.environ.items() diff --git a/tests/bus_record_fixture.py b/tests/bus_record_fixture.py index 8bb8af7021..2cc1f605dd 100644 --- a/tests/bus_record_fixture.py +++ b/tests/bus_record_fixture.py @@ -6,7 +6,7 @@ from pathlib import Path from agent_comms.audience_manifest import FrozenRecipient, freeze_audience -from agent_comms.bus import Bus, PrivateRecord +from agent_comms.bus import PrivateRecord from agent_comms.comms import Comms, wire from agent_comms.child_process import ProcessIdentity from agent_comms.bus_publication import Delivered, KeyedPublication @@ -26,7 +26,6 @@ def prepare_native_comms(comms: Comms) -> Comms: """Validate native-root authority before installing data or opening a coordinator.""" comms.registry.prepare_native_root() - Bus.install(Bus.path_in(comms.root)) return comms diff --git a/tests/c4_coordination_installed_ui.py b/tests/c4_coordination_installed_ui.py index f6d5d52244..c85c5da1f4 100644 --- a/tests/c4_coordination_installed_ui.py +++ b/tests/c4_coordination_installed_ui.py @@ -1,12 +1,10 @@ """Installed snapshot values, original notification evidences and real sidebar rows.""" -from agent_comms.bus import Bus from conftest import publish_initial from agent_comms.session_file import RegistrySessionLocation from agent_comms.channel_targets import CommandTarget from agent_comms.read_basis import NamedViewer -from agent_comms.presentation import ReadThrough import argparse import asyncio from importlib.resources import files @@ -42,7 +40,6 @@ async def main(): os.environ.update(XDG_CONFIG_HOME=str(root / 'config'), XDG_STATE_HOME=str(root / 'state'), XDG_DATA_HOME=str(root / 'data'), AGENT_COMMS_ROOT=str(root / 'wire')) comms = wire(root / 'wire') - Bus.install(Bus.path_in(comms.root)) owner = root.name for name in (owner, 'stopped', 'archived'): source = root / (name + '.jsonl') diff --git a/tests/config_option_authority_installed_pilot.py b/tests/config_option_authority_installed_pilot.py index 7023a54479..b129e8fe4e 100644 --- a/tests/config_option_authority_installed_pilot.py +++ b/tests/config_option_authority_installed_pilot.py @@ -7,7 +7,6 @@ from __future__ import annotations -from agent_comms.bus import Bus import argparse import asyncio @@ -108,7 +107,6 @@ async def run(stage, package, models, ui, menu_contention=False): project = stage / 'project' project.mkdir() service = wire(stage / 'wire') - Bus.install(Bus.path_in(service.root)) environment = dict(os.environ) environment.update( AGENT_COMMS_ROOT=str(service.root), diff --git a/tests/goal_owner_fixture.py b/tests/goal_owner_fixture.py index f13534cd07..0aae62f0a6 100644 --- a/tests/goal_owner_fixture.py +++ b/tests/goal_owner_fixture.py @@ -5,14 +5,12 @@ import pytest -from agent_comms.bus import Bus from agent_comms.comms import wire def canonical_goal_wire(root): """Create an empty real checked source for goal/wait fixture operations.""" comms = wire(root) - Bus.install(Bus.path_in(comms.root)) return comms diff --git a/tests/native_backend_fixture.py b/tests/native_backend_fixture.py index f7d10a0b31..5b0a098fab 100644 --- a/tests/native_backend_fixture.py +++ b/tests/native_backend_fixture.py @@ -1,7 +1,6 @@ """Acquired original native fixture shared by pytest and installed drivers.""" -from agent_comms.bus import Bus from agent_comms.native_package import VerifiedNativePackage from agent_comms.native_arguments import NativeArguments @@ -263,7 +262,7 @@ async def serve(reader, writer): (root / "storage.json").write_text(json.dumps(FieldCodec.encode( StorageRule(scratch_base=project.parent), ))) - Bus.install(Bus.path_in(wire(root).root)) + wire(root) environment = { NativeArguments.binary_key: NativeArguments.default_binary, "AGENT_COMMS_ROOT": str(root), diff --git a/tests/native_request_wait_installed_journey.py b/tests/native_request_wait_installed_journey.py index 164e64700a..ee960c2538 100644 --- a/tests/native_request_wait_installed_journey.py +++ b/tests/native_request_wait_installed_journey.py @@ -1,7 +1,6 @@ """Real installed Toad/ACP/native waits with only the localhost provider controlled.""" -from agent_comms.bus import Bus from agent_comms.lifecycle_capability import Unresolved from agent_comms.pi_vocabulary import OffThinkingLevel import argparse @@ -100,7 +99,6 @@ async def provider(reader, writer): (config / "settings.json").write_text(json.dumps({"compaction": {"enabled": False}, "retry": {"enabled": False, "maxRetries": 0, "provider": {"maxRetries": 0}}})) service = wire(stage / "wire") - Bus.install(Bus.path_in(service.root)) environment = dict(os.environ, AGENT_COMMS_ROOT=str(service.root), AGENT_COMMS_NATIVE_CONFIG_DIR=str(config), PI_CODING_AGENT_DIR=str(config), AGENT_COMMS_AGENT_MODELS="wait-local/fixture", AGENT_COMMS_AGENT_BIN="pi", diff --git a/tests/ordinary_claims_live_journey.py b/tests/ordinary_claims_live_journey.py index 4fb8502a73..8d90ff7f43 100644 --- a/tests/ordinary_claims_live_journey.py +++ b/tests/ordinary_claims_live_journey.py @@ -7,7 +7,6 @@ from __future__ import annotations -from agent_comms.bus import Bus import argparse import asyncio @@ -84,7 +83,6 @@ async def journey(arguments): PI_CODING_AGENT_DIR=str(Path.home() / '.pi/agent')) env = dict(os.environ) comms = wire(root) - Bus.install(Bus.path_in(comms.root)) name = 'scratch-sleeper' comms.registry.declare(replace(Thread( name, frozenset(), str(project), model=DeclaredModel(arguments.model), thinking_level=HighThinkingLevel), diff --git a/tests/test_acp.py b/tests/test_acp.py index c4837fe9e6..4c4fd92132 100644 --- a/tests/test_acp.py +++ b/tests/test_acp.py @@ -4,7 +4,6 @@ Core's ACP connection over real stdio pipes, plus direct handler-level tests. """ -from agent_comms.bus import Bus import asyncio import json @@ -306,7 +305,6 @@ def test_real_stdio_roundtrip(self, native_stdio_root): (tmp_path / "proj").mkdir() root = tmp_path / "wire" comms = wire(root) - Bus.install(Bus.path_in(comms.root)) env = dict( __import__("os").environ, AGENT_COMMS_ROOT=str(root), diff --git a/tests/test_carry.py b/tests/test_carry.py index b930b9aa29..d88546dea6 100644 --- a/tests/test_carry.py +++ b/tests/test_carry.py @@ -1,6 +1,5 @@ """The carry family: one chain of idempotent steps whose dry runs say what a bus still needs.""" -from agent_comms.bus import Bus import os import sqlite3 @@ -287,7 +286,6 @@ def test_restart_selection_uses_receiving_declaration_with_connected_cli_inbox(c def test_owner_request_failure_joins_the_entire_set_before_propagating(comms, stack): - Bus.install(Bus.path_in(comms.root)) names = ["failed", "other", "last"] for name in names[1:]: comms.registry.declare( diff --git a/tests/test_carry_session_locations.py b/tests/test_carry_session_locations.py index 1c37afb391..921bb6e437 100644 --- a/tests/test_carry_session_locations.py +++ b/tests/test_carry_session_locations.py @@ -6,7 +6,6 @@ import pytest -from agent_comms.bus import Bus from agent_comms.comms import wire from agent_comms.errors import RelationViolationError from agent_comms.historical_views import HistoryArchive @@ -88,9 +87,7 @@ def test_carry_converts_the_archived_catalogue_before_reading_its_roots(tmp_path session = old.root / "native-sessions" / "bus.jsonl" old.registry.declare(Thread( "bus", frozenset(), str(tmp_path), session_file=RegistrySessionLocation.from_path(session, old.root))) - Bus.install(Bus.path_in(old.root)) live = wire(tmp_path / "live") - Bus.install(Bus.path_in(live.root)) live.views.attach_history(old.root) catalog = HistoryArchive.path_in(live.root) recorded = json.loads(catalog.read_text()) diff --git a/tests/test_channel_coding_tools.py b/tests/test_channel_coding_tools.py index e6910ce5b1..910e1f1752 100644 --- a/tests/test_channel_coding_tools.py +++ b/tests/test_channel_coding_tools.py @@ -1,7 +1,6 @@ """Normal coding policies use existing claims; no provider or user work is touched.""" -from agent_comms.bus import Bus from agent_comms.pi_payloads import ReportedFlag, ReportedText import json @@ -43,7 +42,6 @@ def test_create_claim_competes_before_file_exists_and_releases_without_creation( for name, created in [("a", 21.0), ("b", 22.0)]: thread = Thread(name, frozenset({'team'}), str(work), created_at=created) c.registry.declare(replace(thread, process_identity=ProcessIdentity.capture(os.getpid()))) - Bus.install(Bus.path_in(c.root)) resource = WritableFileClaim(Path("new/nested/file.py")) def acquire(name): with NativeBoundary(c.bus) as boundary: @@ -80,7 +78,6 @@ def test_stopped_holder_reclaimed_in_copied_root(tmp_path, monkeypatch, existing original.registry.declare(replace( thread, process_identity=ProcessIdentity.capture(os.getpid()) )) - Bus.install(Bus.path_in(original.root)) def acquire(comms, name): with NativeBoundary(comms.bus) as boundary: diff --git a/tests/test_check_root.py b/tests/test_check_root.py index 9efb5b7e73..e6b45cccbb 100644 --- a/tests/test_check_root.py +++ b/tests/test_check_root.py @@ -1,7 +1,6 @@ """Selected check history is small, non-executable and scoped to the command.""" -from agent_comms.bus import Bus import json from pathlib import Path import sys @@ -22,7 +21,6 @@ def source(scratch_root, durable_home): root = scratch_root / "source" c = wire(root) - Bus.install(Bus.path_in(c.root)) for name in ("A", "B", "other"): c.registry.declare(Thread(name, frozenset({"comms"}), str(scratch_root)), StoppedThreadStatus()) diff --git a/tests/test_command_families.py b/tests/test_command_families.py index 4d7d51c465..7a4a84d25d 100644 --- a/tests/test_command_families.py +++ b/tests/test_command_families.py @@ -1,6 +1,5 @@ -from agent_comms.bus import Bus from agent_comms.field_codec import FieldCodec """External contracts and adding commands without editing any consumer catalog.""" @@ -145,7 +144,6 @@ def test_normal_history_cli_keeps_migrated_content_and_source_identity( ): old, live = wire(tmp_path / "old"), wire(tmp_path / "live") for comms in (old, live): - Bus.install(Bus.path_in(comms.root)) for name in ("alice", "bob"): comms.registry.declare( Thread(name, frozenset({"team"}), str(tmp_path)) diff --git a/tests/test_commander_forks.py b/tests/test_commander_forks.py index 7678fca9c4..66d84770f7 100644 --- a/tests/test_commander_forks.py +++ b/tests/test_commander_forks.py @@ -1,7 +1,6 @@ """Commander forks use registered identity and the original Todo assignment.""" -from agent_comms.bus import Bus from concurrent.futures import ThreadPoolExecutor from dataclasses import replace import json @@ -51,7 +50,6 @@ def fork_bus(tmp_path): source.git(source.checkout, 'commit', '-qm', 'Declare shared assignment owner') source.git(source.checkout, 'push', 'origin', 'main') comms = wire(tmp_path / 'saved-bus') - Bus.install(Bus.path_in(comms.root)) comms.channels.create_tag('comms') # Two order holders never share one worktree, so each unit has its own checkout. units = tuple((name, tmp_path / f'{name}-checkout') for name in ('worker', 'other', 'retained')) diff --git a/tests/test_deleted_thread_observation.py b/tests/test_deleted_thread_observation.py index 88e3f45c78..60e343f865 100644 --- a/tests/test_deleted_thread_observation.py +++ b/tests/test_deleted_thread_observation.py @@ -1,6 +1,5 @@ """A stale open view is a registry-owned deletion result, not observer failure.""" -from agent_comms.bus import Bus import asyncio import pickle from dataclasses import replace @@ -22,7 +21,6 @@ def declare(comms, *names): for name in names: comms.registry.declare(Thread(name, frozenset(), str(comms.root.parent))) - Bus.install(Bus.path_in(comms.root)) def observe(reading, comms): diff --git a/tests/test_envelope_bus_integration.py b/tests/test_envelope_bus_integration.py index 428f234615..1bab9d36e6 100644 --- a/tests/test_envelope_bus_integration.py +++ b/tests/test_envelope_bus_integration.py @@ -6,7 +6,6 @@ from __future__ import annotations -from agent_comms.bus import Bus from bus_history import read_history import json @@ -48,7 +47,6 @@ def _participants(tmp_path: Path) -> tuple[Comms, Path]: replace(owner, process_identity=ProcessIdentity.capture(os.getpid())), RunningThreadStatus(), ) - Bus.install(Bus.path_in(comms.root)) return comms, worktree @@ -237,7 +235,6 @@ def test_sigkill_across_claim_acquisition_recovers_one_row_or_none( from pathlib import Path sys.path.insert(0, sys.argv[2]) sys.path.insert(0, str(Path(sys.argv[2]).parent / 'tests')) -from agent_comms.bus import Bus from agent_comms.comms import wire from test_envelope_bus_integration import acquire_message """ + kill + """ diff --git a/tests/test_goal_input_review.py b/tests/test_goal_input_review.py index 80fd367e9e..f314ee87ec 100644 --- a/tests/test_goal_input_review.py +++ b/tests/test_goal_input_review.py @@ -1,6 +1,5 @@ """Canonical inspection unblocks standby without fabricating native delivery.""" -from agent_comms.bus import Bus from agent_comms.lifecycle_capability import Unresolved from agent_comms.channel_targets import CommandTarget import os @@ -36,7 +35,6 @@ def test_inspected_canonical_dependencies_allow_standby_without_replay(tmp_path, comms.registry.declare( Thread(name, frozenset(), str(tmp_path), process_identity=ProcessIdentity.capture(os.getpid())) ) - Bus.install(Bus.path_in(comms.root)) comms.agents.begin_turn("parent", "parent-delegation-in-flight") goal = comms.goals.update_goal("worker", SetGoalAction(text="Delegate and wait")) messages = [ diff --git a/tests/test_goal_owner_pause.py b/tests/test_goal_owner_pause.py index 9099ffb977..5471a95cd7 100644 --- a/tests/test_goal_owner_pause.py +++ b/tests/test_goal_owner_pause.py @@ -1,6 +1,5 @@ """Owner pause remains attributable and cannot be undone by a model tool.""" -from agent_comms.bus import Bus import pytest @@ -20,7 +19,6 @@ def test_owner_pause_survives_reopen_and_explains_stale_model_report(tmp_path, monkeypatch): comms = wire(tmp_path) - Bus.install(Bus.path_in(comms.root)) comms.registry.declare(Thread(name='worker', tags=frozenset(), worktree=str(tmp_path))) goal = comms.goals.update_goal("worker", SetGoalAction(text="Read fifty files")) comms.goals.update_goal( @@ -55,7 +53,6 @@ def test_owner_pause_survives_reopen_and_explains_stale_model_report(tmp_path, m def test_model_cannot_pause(tmp_path, monkeypatch): comms = wire(tmp_path) - Bus.install(Bus.path_in(comms.root)) comms.registry.declare(Thread(name='worker', tags=frozenset(), worktree=str(tmp_path))) goal = comms.goals.update_goal("worker", SetGoalAction(text="Read fifty files")) monkeypatch.setenv("AGENT_COMMS_THREAD", "worker") diff --git a/tests/test_held_sends.py b/tests/test_held_sends.py index 60a92f125b..d4fe64eb01 100644 --- a/tests/test_held_sends.py +++ b/tests/test_held_sends.py @@ -1,7 +1,6 @@ """Real send entrypoints wait through a private bus hold and publish once.""" -from agent_comms.bus import Bus import asyncio import os import sqlite3 @@ -55,7 +54,6 @@ def test_refusal_writer_keeps_registry_permission_until_its_sql_write_finishes(p @pytest.fixture def held_bus(tmp_path): comms = wire(tmp_path) - Bus.install(Bus.path_in(comms.root)) for name in ('sender', 'recipient'): comms.registry.declare(Thread(name, frozenset(), str(tmp_path))) assert comms.bus.inbox('recipient') == [] diff --git a/tests/test_historical_page_scope.py b/tests/test_historical_page_scope.py index cd7dbd45b9..e716244b24 100644 --- a/tests/test_historical_page_scope.py +++ b/tests/test_historical_page_scope.py @@ -4,7 +4,7 @@ import pytest -from agent_comms.bus import Bus, PublicRecord +from agent_comms.bus import PublicRecord from agent_comms.channel_targets import CommandTarget from agent_comms.comms import wire from agent_comms.mentions import ThreadMention @@ -22,7 +22,6 @@ def history(tmp_path): for created, name in enumerate(("bob", "carol"), start=11): old.registry.declare(Thread(name, frozenset({'ops'}), str(old.root), created_at=created)) old.registry.rename("alice-old", "alice") - Bus.install(Bus.path_in(old.root)) rows = [] for seq in range(1, 241): message = Message( @@ -49,7 +48,6 @@ def history(tmp_path): ) rows.append(Message.from_message(published)) live = wire(tmp_path / "live") - Bus.install(Bus.path_in(live.root)) # Deliberately different membership: source scope must not use live tags. live.registry.declare(Thread('alice', frozenset({'ops'}), str(live.root), created_at=500)) live.registry.declare(Thread('alice-old', frozenset({'api'}), str(live.root), created_at=501)) diff --git a/tests/test_historical_views.py b/tests/test_historical_views.py index 844288d2a1..6b2672c44e 100644 --- a/tests/test_historical_views.py +++ b/tests/test_historical_views.py @@ -53,7 +53,6 @@ def setup(root, count=5): comms = wire(root) comms.registry.declare(Thread('alice', frozenset({'team'}), str(root), created_at=10.0)) comms.registry.declare(Thread('bob', frozenset({'team'}), str(root), created_at=11.0)) - Bus.install(Bus.path_in(comms.root)) viewer = comms.messaging.user_identity(str(root)).name for i in range(count): comms.messaging.send("alice", "#team", f"{root.name} channel {i}").message.message_id diff --git a/tests/test_holder_standing_rules.py b/tests/test_holder_standing_rules.py index 4afb4cdbd1..b48667e00f 100644 --- a/tests/test_holder_standing_rules.py +++ b/tests/test_holder_standing_rules.py @@ -16,7 +16,6 @@ from agent_comms.store_files import StoreLockContention from agent_comms import agent_events as events -from agent_comms.bus import Bus from agent_comms.bus_publication import AgentOrigin, HumanOrigin from agent_comms.child_process import ProcessIdentity from agent_comms.commander.order import Commander, OrderFile, SayVerb, SendVerb @@ -36,7 +35,6 @@ from agent_comms.goal_actions import ( CreateProblemGoalAction, ReissuedOrderGoalAction, - SetGoalAction, ) from agent_comms.goal_presentation import RunnableExecution from agent_comms.goal_states import ActiveGoal @@ -79,7 +77,6 @@ def held_bus(comms, tmp_path, source_repository, configured_repository): """One setup owner: real declarations, checked orders, UNKNOWN row, then a copy.""" source = source_repository scope = source.scope() - Bus.install(Bus.path_in(comms.root)) # Two order holders never share one worktree, so the outsider has its own checkout. outsider = tmp_path / 'outsider-checkout' source.git(source.checkout, 'worktree', 'add', '-q', '-b', 'outsider-work', str(outsider)) diff --git a/tests/test_importing.py b/tests/test_importing.py index 85808068a8..d59b85a8b4 100644 --- a/tests/test_importing.py +++ b/tests/test_importing.py @@ -2,7 +2,6 @@ from agent_comms.comms import Comms from agent_comms.registration import Registration from agent_comms.thread_text import ThreadText -from agent_comms.bus import Bus import asyncio import json import os @@ -50,12 +49,6 @@ from agent_comms.threads import Thread -@pytest.fixture -def comms(comms: Comms) -> Comms: - Bus.install(Bus.path_in(comms.root)) - return comms - - def lines(path: Path, records: Iterable[dict[str, JsonValue]], tail: str = "") -> Path: path.write_text("".join(json.dumps(record, ensure_ascii=False) + "\n" for record in records) + tail) return path diff --git a/tests/test_install_session_bridge.py b/tests/test_install_session_bridge.py index a3a2500b79..154c1accf1 100644 --- a/tests/test_install_session_bridge.py +++ b/tests/test_install_session_bridge.py @@ -1,7 +1,6 @@ """Real session endpoint retirement; no live home, provider, or package mutation.""" -from agent_comms.bus import Bus import json import os @@ -38,7 +37,6 @@ def session_bridge(tmp_path, home, program=SERVE_FROM_SOURCE, *, state_directory runtime=LaunchRuntime.running()): """``runtime`` serves ``program`` and so owns the bus it attaches to.""" comms = wire(tmp_path / 'bus') - Bus.install(Bus.path_in(comms.root)) RootRuntime.publish(comms.root, runtime) comms.registry.declare(Thread( 'bridge-copy', frozenset(), str(tmp_path), execution=ExternalThreadExecution)) diff --git a/tests/test_native_only_execution.py b/tests/test_native_only_execution.py index f1850ade15..5a8b762f10 100644 --- a/tests/test_native_only_execution.py +++ b/tests/test_native_only_execution.py @@ -1,7 +1,6 @@ """Retained native execution, refusal, and canonical headless/runtime behavior.""" -from agent_comms.bus import Bus from bus_history import read_history import asyncio @@ -57,7 +56,6 @@ async def test_headless_uses_existing_owner_runtime_and_owner_project(tmp_path, project.mkdir() caller_project.mkdir() comms = wire(base / "wire") - Bus.install(Bus.path_in(comms.root)) comms.registry.declare(Thread('headless', frozenset(), str(project))) env = dict( os.environ, diff --git a/tests/test_native_owner_launcher_resolution.py b/tests/test_native_owner_launcher_resolution.py index e9b0dd4d55..55e758f4fa 100644 --- a/tests/test_native_owner_launcher_resolution.py +++ b/tests/test_native_owner_launcher_resolution.py @@ -1,7 +1,6 @@ """Native launcher identity, route and acquired package remain independent.""" -from agent_comms.bus import Bus import shlex import sys from pathlib import Path @@ -21,7 +20,6 @@ async def test_fork_runs_selected_python_before_copying_saved_history(tmp_path, package = VerifiedNativePackage.acquire(pinned_native) comms = wire(tmp_path / "wire") - Bus.install(Bus.path_in(comms.root)) LaunchRoot.from_path(comms.root).install() selected = tmp_path / "selected-core" (selected / "bin").mkdir(parents=True) diff --git a/tests/test_observer_death.py b/tests/test_observer_death.py index 90a5f7c7f9..9e30a87986 100644 --- a/tests/test_observer_death.py +++ b/tests/test_observer_death.py @@ -1,6 +1,5 @@ """The UI side of the comms observer reports the observer's end once, with how it exited, and no later use of it raises a pipe error.""" -from agent_comms.bus import Bus import asyncio import os @@ -61,7 +60,6 @@ async def test_a_killed_observer_is_reported_once_with_its_signal_and_fails_awai async def test_an_invalid_notification_reference_does_not_kill_the_observer(comms, durable_home): - Bus.install(Bus.path_in(comms.root)) with ObservationProcess.awaited(comms.route) as process: with pytest.raises(RelationViolationError): await process.read(ReadNotifications( diff --git a/tests/test_order_progress.py b/tests/test_order_progress.py index c7a5c59180..26daf3103b 100644 --- a/tests/test_order_progress.py +++ b/tests/test_order_progress.py @@ -2,7 +2,6 @@ The commander's review timer comes back every window until delivery, and the unit never sees it.""" -from agent_comms.bus import Bus import json import os import subprocess @@ -122,7 +121,6 @@ def held(tmp_path): source = SourceRepository.create(tmp_path / 'source') (root / 'storage.json').write_text(json.dumps({'checkout_base': str(tmp_path / 'wt')})) comms = wire(root) - Bus.install(Bus.path_in(comms.root)) for name in ('lead', 'worker'): comms.registry.declare(Thread(name, frozenset(), str(tmp_path))) request = comms.goals.todos.add_request( diff --git a/tests/test_order_story.py b/tests/test_order_story.py index b162ca10d9..0e198447dd 100644 --- a/tests/test_order_story.py +++ b/tests/test_order_story.py @@ -1,7 +1,6 @@ """Native stories use one copied Todo record, including a resent send-back.""" -from agent_comms.bus import Bus from agent_comms.repository_name import RepositoryName from dataclasses import replace @@ -29,7 +28,6 @@ def test_order_story_copied_bus_strike_and_send_back_once(comms, tmp_path): source = SourceRepository.create(tmp_path / 'source') - Bus.install(Bus.path_in(comms.root)) for name in ("lead", "worker"): comms.registry.declare(Thread(name, frozenset({"comms"}), str(tmp_path))) request = comms.goals.todos.add_request( diff --git a/tests/test_private_runtime_bootstrap.py b/tests/test_private_runtime_bootstrap.py index f17e010d72..e408b69be8 100644 --- a/tests/test_private_runtime_bootstrap.py +++ b/tests/test_private_runtime_bootstrap.py @@ -1,7 +1,6 @@ """Explicit installation may fill absent schemas, never repair an existing drift.""" -from agent_comms.bus import Bus import sqlite3 @@ -17,7 +16,6 @@ def test_drifted_private_owner_refused_and_readers_leave_missing_schema_alone(tmp_path): comms = wire(tmp_path / "wire") comms.registry.prepare_native_root() - Bus.install(Bus.path_in(comms.root)) comms.registry.declare(Thread('owner', frozenset(), str(tmp_path))) database = comms.root / "coordination.sqlite3" with sqlite3.connect(database) as db: diff --git a/tests/test_proof_build.py b/tests/test_proof_build.py index 9e214c6504..9a8d19f773 100644 --- a/tests/test_proof_build.py +++ b/tests/test_proof_build.py @@ -15,13 +15,12 @@ RecordedBuildIdentity, UninstalledRepositoryError, ) -from agent_comms.bus import Bus from agent_comms.check_root import CheckRoot from agent_comms.commander.order import Commander from agent_comms.commander.standing import InstallDue from agent_comms.comms import wire from agent_comms.field_codec import FieldCodec -from agent_comms.goal_actions import CreateProblemGoalAction, SetGoalAction +from agent_comms.goal_actions import CreateProblemGoalAction from agent_comms.goals import CountCheckResult, OrderCheck from agent_comms.installer.interpreter_operation import ( ArchiveRecord, @@ -227,7 +226,6 @@ def test_installed_proof_closes_and_older_build_is_refused_on_copied_bus( if graph.repository.github == CorePackage.repository ) source = wire(tmp_path / "bus") - Bus.install(Bus.path_in(source.root)) for number, name in enumerate(("lead", "worker"), 1): source.registry.declare( Thread( diff --git a/tests/test_read_ledger.py b/tests/test_read_ledger.py index 80bc3aa85e..0f660d8889 100644 --- a/tests/test_read_ledger.py +++ b/tests/test_read_ledger.py @@ -6,7 +6,6 @@ import pytest -from agent_comms.bus import Bus from agent_comms.channel_targets import CommandTarget, ThreadTarget from agent_comms.child_process import ProcessIdentity from agent_comms.comms import wire @@ -116,7 +115,6 @@ def test_typed_read_keys_round_trip_through_the_store_codec(): def test_sidebar_presents_pending_read_reset_notice_once(tmp_path): comms = wire(tmp_path) - Bus.install(Bus.path_in(comms.root)) viewer = comms.messaging.user_identity(str(tmp_path)).name notice = PendingReadNotice("Read positions were reset; reopen conversations to review them.") comms.bus.reads.replace(replace(comms.bus.reads.read(), notice=notice)) diff --git a/tests/test_retained_context_operations.py b/tests/test_retained_context_operations.py index c183a735b0..ee4da923ae 100644 --- a/tests/test_retained_context_operations.py +++ b/tests/test_retained_context_operations.py @@ -3,7 +3,6 @@ from agent_comms.channel_targets import CommandTarget -from agent_comms.bus import Bus from bus_history import read_history from agent_comms.lifecycle_capability import Unresolved @@ -31,7 +30,6 @@ def test_original_retained_source_narrow_export(comms, tmp_path, capsys): from test_task_decisions import saved_source import hashlib - Bus.install(Bus.path_in(comms.root)) saved = tmp_path / "original.jsonl" saved_source(saved) goal = Goal("Original task goal, not an exported human constraint", "original-goal", published_seq=0, revision=7) @@ -61,7 +59,6 @@ def command(*args): def test_original_human_pin_revision_drop_and_atomic_export(comms, capsys): - Bus.install(Bus.path_in(comms.root)) owner = comms.registry.declare(Thread('recipient', frozenset(), str(comms.root))) other = comms.registry.declare(Thread('unaddressed', frozenset(), str(comms.root))) wording = "Never replay UNKNOWN.\nPreserve exact λ /source/owned bytes." @@ -138,7 +135,6 @@ async def original_input_consumer_journey(tmp_path, command): from agent_comms.retained_task_facts import InputTaskFact comms, agent, _, _ = _owner(tmp_path) - Bus.install(Bus.path_in(comms.root)) origin = capture(comms) wording = "Never replay UNKNOWN.\nPreserve original λ /source/owned bytes." originals = [] diff --git a/tests/test_stack_native_compaction.py b/tests/test_stack_native_compaction.py index 290e643fc8..32ffecd4ed 100644 --- a/tests/test_stack_native_compaction.py +++ b/tests/test_stack_native_compaction.py @@ -2,7 +2,6 @@ from __future__ import annotations -from agent_comms.bus import Bus from agent_comms.lifecycle_capability import Unresolved from agent_comms.queued_input import InitialInput import asyncio @@ -297,7 +296,6 @@ async def _acp_threshold(root, project, session, native_bin, native_args, child_ for key, value in child_env.items(): monkeypatch.setenv(key, value) comms = wire(root / "wire") - Bus.install(Bus.path_in(comms.root)) monkeypatch.setenv("AGENT_COMMS_ROOT", str(comms.root)) owner = CommsAgent( comms, agent_bin=GivenBinary(native_bin), agent_args=GivenArguments(tuple(native_args)), runtime_enabled=True, diff --git a/tests/test_stopped_claim_expiry.py b/tests/test_stopped_claim_expiry.py index eb12b46c6a..31bac1e1ff 100644 --- a/tests/test_stopped_claim_expiry.py +++ b/tests/test_stopped_claim_expiry.py @@ -1,7 +1,6 @@ """A stopped registry incarnation loses every claim at the next original transition.""" -from agent_comms.bus import Bus import os from dataclasses import replace @@ -17,7 +16,6 @@ def test_stopped_incarnation_claims_expire_on_next_transition(comms, tmp_path): - Bus.install(Bus.path_in(comms.root)) for name in ("old", "next"): thread = Thread(name, frozenset(), str(tmp_path)) comms.registry.declare( diff --git a/tests/test_task_decisions.py b/tests/test_task_decisions.py index c76c7403de..c50aa0c903 100644 --- a/tests/test_task_decisions.py +++ b/tests/test_task_decisions.py @@ -3,7 +3,6 @@ from agent_comms.channel_targets import CommandTarget -from agent_comms.bus import Bus from agent_comms.session_file import RegistrySessionLocation from agent_comms.bus_publication import AgentOrigin @@ -59,7 +58,6 @@ def test_user_pin_original_source_without_model_lease_and_complete_lineage(comms TurnTaskScope, UserTaskDrop, UserTaskSupersession, ) - Bus.install(Bus.path_in(comms.root)) owner = comms.registry.declare(Thread('recipient', frozenset({'team'}), str(comms.root))) comms.registry.declare(Thread('unaddressed', frozenset(), str(comms.root))) exact = "Never replay UNKNOWN.\nUse original λ /artifacts/source; no substitute." @@ -119,7 +117,6 @@ def test_user_pin_original_source_without_model_lease_and_complete_lineage(comms def test_user_pin_goal_scope_replacement_and_original_subject_fences(comms): from agent_comms.task_sources import CorrectionTaskChange, GoalTaskScope - Bus.install(Bus.path_in(comms.root)) owner = comms.registry.declare(Thread('recipient', frozenset(), str(comms.root), goal=Goal('Original goal', 'goal-one', published_seq=0))) subject = comms.messaging.send_user_message(CommandTarget.named(owner.name), "Use the original coordinates.", worktree=owner.worktree) @@ -153,7 +150,6 @@ def test_constraint_original_wording_scope_correction_and_human_authority(comms, from agent_comms.retained_task_facts import CurrentConstraintTaskFact, RetainedTaskFacts from agent_comms.task_sources import Constraint, CorrectionTaskChange, UserTaskSupersession - Bus.install(Bus.path_in(comms.root)) owner = admit(comms, "alpha") admit(comms, "beta") comms.registry.register(replace(owner, goal=Goal("Bounded source task", "original-goal", published_seq=0))) @@ -203,7 +199,6 @@ def test_constraint_original_wording_scope_correction_and_human_authority(comms, def test_original_choice_correction_and_authority_survive_reopen(comms, monkeypatch): - Bus.install(Bus.path_in(comms.root)) alpha = admit(comms, "alpha") beta = admit(comms, "beta") monkeypatch.setenv("AGENT_COMMS_THREAD", "alpha") @@ -258,7 +253,6 @@ def test_original_choice_correction_and_authority_survive_reopen(comms, monkeypa def test_equal_text_choices_keep_original_identity_through_rename_and_goal_replacement(comms, monkeypatch): from agent_comms.retained_task_facts import CurrentDecisionTaskFact, RetainedTaskFacts - Bus.install(Bus.path_in(comms.root)) owner = admit(comms, "alpha") owner = replace(owner, goal=Goal("Keep checked root", "goal", published_seq=0, revision=1)) comms.registry.register(owner) @@ -326,7 +320,6 @@ def test_turn_scope_correction_cannot_revive_a_finished_turn_choice(comms, monke owner = admit(comms, "alpha") monkeypatch.setenv("AGENT_COMMS_THREAD", "alpha") request = {"chosen": "A", "rejected": ["B"], "to": "#team"} - Bus.install(Bus.path_in(comms.root)) first = invoke_tool(comms, "comms_decision", request) comms.registry.release_turn(owner.turn_lease) owner, claim_scope = comms.registry.live_owner_with_claim("alpha") @@ -341,7 +334,6 @@ def test_turn_scope_correction_cannot_revive_a_finished_turn_choice(comms, monke def test_exact_user_supersession_cannot_be_impersonated_or_overridden_by_peer_choice(comms, monkeypatch): - Bus.install(Bus.path_in(comms.root)) from agent_comms.retained_task_facts import CurrentUserTaskCorrectionFact, RetainedTaskFacts from agent_comms.task_sources import CorrectionTaskChange, UserTaskSupersession @@ -387,7 +379,6 @@ def test_cross_audience_corrections_capture_only_eligible_owned_lineage(comms, m ) from agent_comms.task_sources import CorrectionTaskChange, UserTaskSupersession - Bus.install(Bus.path_in(comms.root)) for name in ("alpha", "beta", "gamma"): owner = admit(comms, name) saved = comms.root / f"{name}-source.jsonl" diff --git a/tests/test_todos.py b/tests/test_todos.py index 119596256c..32e374148e 100644 --- a/tests/test_todos.py +++ b/tests/test_todos.py @@ -359,7 +359,6 @@ def test_watcher_git_and_github_reads_leave_wire_free(pr_commander, monkeypatch) source = ctx.repos[0] with LaunchRoot.from_path(ctx.root).selected(): c = ctx.comms - Bus.install(Bus.path_in(c.root)) c.goals.update_goal(ctx.commander, SetGoalAction( text="Keep the commander request active for both watcher passes", goal_id="pr-work")) diff --git a/tests/test_turn_digests.py b/tests/test_turn_digests.py index 7282217824..0bc10338ef 100644 --- a/tests/test_turn_digests.py +++ b/tests/test_turn_digests.py @@ -29,7 +29,6 @@ def prepared(tmp_path): comms = wire(tmp_path) - Bus.install(Bus.path_in(comms.root)) return comms diff --git a/tests/test_turn_goal_account.py b/tests/test_turn_goal_account.py index 947e9ce2e0..954164b9ad 100644 --- a/tests/test_turn_goal_account.py +++ b/tests/test_turn_goal_account.py @@ -1,10 +1,8 @@ """Goal settlement reuses the real SQLite grants and nominal state hierarchy.""" -from agent_comms.bus import Bus from agent_comms.lifecycle_capability import Terminal -import pytest from agent_comms.goal_attempts import GoalAttemptStore from agent_comms.goal_generation import ( @@ -17,13 +15,6 @@ -@pytest.fixture -def comms(comms): - """Turn acquisition launches an owner on the declared private protocol.""" - Bus.install(Bus.path_in(comms.root)) - return comms - - def test_goal_settlement_and_new_state_subclass_use_same_durable_owner(tmp_path): class SpecializedPausedGoal(PausedGoal): pass diff --git a/tests/test_unowned_checkout_work.py b/tests/test_unowned_checkout_work.py index 347e055ad6..2ff66d9757 100644 --- a/tests/test_unowned_checkout_work.py +++ b/tests/test_unowned_checkout_work.py @@ -43,7 +43,6 @@ from agent_comms.transcript_events import AssistantTranscript from agent_comms.ui_model.unit_state import UnitState, Unreadable from agent_comms.work_branches import UnreadableCheckoutRead, WorkBranches -from order_scope_fixture import FIX_SCOPE from agent_comms.threads import Thread @@ -130,7 +129,6 @@ def checkout_bus(tmp_path: Path, configured_repository, installed_runtime) -> Co (root / 'storage.json').write_text(json.dumps(FieldCodec.encode(rule))) Bus.install(Bus.path_in(root)) c = wire(root) - Bus.install(Bus.path_in(c.root)) # Two order holders never share one worktree, so the unit taking the work has its own. spare = tmp_path / 'idle-project' git(home, 'worktree', 'add', '-q', '-b', 'idle-home', str(spare)) diff --git a/tests/test_visibility_views.py b/tests/test_visibility_views.py index b6954dc08b..44defa37a9 100644 --- a/tests/test_visibility_views.py +++ b/tests/test_visibility_views.py @@ -1,6 +1,5 @@ """Viewer-only presence flags reveal archived threads without reviving owners.""" -from agent_comms.bus import Bus import pytest @@ -19,7 +18,6 @@ ]) def test_roster_visibility_selects_threads_and_channel_members(tmp_path, visibility, shown): comms = wire(tmp_path) - Bus.install(Bus.path_in(comms.root)) for name in ("active", "stopped", "archived"): comms.registry.declare(Thread(name, frozenset({'team'}), str(tmp_path))) comms.owners.stop("stopped") diff --git a/tests/verify_connector_live.py b/tests/verify_connector_live.py index ef5f9cb94d..a5d14e872b 100644 --- a/tests/verify_connector_live.py +++ b/tests/verify_connector_live.py @@ -18,7 +18,6 @@ from pathlib import Path from connector_readiness import ConnectorReadiness -from agent_comms.bus import Bus from agent_comms.comms import wire from agent_comms.connector_store import ConnectorStore from agent_comms.threads import Thread @@ -45,7 +44,6 @@ def main(scratch: Path): comms = wire(root) for name in ("claude-ai", "worker"): comms.registry.declare(Thread(name, frozenset(), str(base))) - Bus.install(Bus.path_in(comms.root)) home = base / "home" store_root = home / ".local/state/agent-comms/connector" store_root.mkdir(mode=0o700, parents=True) diff --git a/tests/verify_connector_maintenance.py b/tests/verify_connector_maintenance.py index 98f9d2597d..6862a311ef 100644 --- a/tests/verify_connector_maintenance.py +++ b/tests/verify_connector_maintenance.py @@ -6,7 +6,6 @@ from __future__ import annotations -from agent_comms.bus import Bus import argparse import json @@ -37,7 +36,6 @@ def prove(scratch: Path) -> None: original = wire(base / "original") for name in ("claude-ai", "worker"): original.registry.declare(Thread(name, frozenset(), str(base))) - Bus.install(Bus.path_in(original.root)) original.messaging.send("worker", "claude-ai", "Ready for your message") for worker in threading.enumerate(): if worker.name == "agent-comms-candidate-maintenance": diff --git a/tests/verify_connector_tools.py b/tests/verify_connector_tools.py index 4077157fbc..24b1b66638 100644 --- a/tests/verify_connector_tools.py +++ b/tests/verify_connector_tools.py @@ -8,7 +8,6 @@ from __future__ import annotations -from agent_comms.bus import Bus from agent_comms.repository_name import RepositoryName import argparse @@ -54,7 +53,6 @@ def seed(root: Path, project: Path) -> None: Thread(name, frozenset({"probe"}), str(project)), status=StoppedThreadStatus(), ) - Bus.install(Bus.path_in(comms.root)) comms.channels.set_saved_view( ParticipantsView('probe-view', ViewPredicate(AnyOfMatch, frozenset({'probe'}))) ) diff --git a/tools/proofs/cn_phase3_record.py b/tools/proofs/cn_phase3_record.py index af6f53fcfa..2c662231fa 100644 --- a/tools/proofs/cn_phase3_record.py +++ b/tools/proofs/cn_phase3_record.py @@ -7,7 +7,6 @@ from __future__ import annotations -from agent_comms.bus import Bus import argparse import os @@ -74,7 +73,6 @@ def setup() -> None: if ROOT.exists(): raise RuntimeError(f"Refusing to reuse an existing proof root: {ROOT}") comms = wire(ROOT) - Bus.install(Bus.path_in(comms.root)) for name in ("record-lead", "record-worker"): comms.registry.declare( Thread(name, frozenset(), str(CHECKOUT), created_at=time.time()) diff --git a/tools/reproduce_thread_list.py b/tools/reproduce_thread_list.py index 39ec4deacb..6e835cde4c 100644 --- a/tools/reproduce_thread_list.py +++ b/tools/reproduce_thread_list.py @@ -11,7 +11,6 @@ from multiprocessing.synchronize import Event from pathlib import Path -from agent_comms.bus import Bus from agent_comms.cli_bridges.claude import ClaudeTranscript from agent_comms.comms import wire from agent_comms.storage_rules import StorageRoots @@ -65,7 +64,6 @@ def main() -> None: root = args.root.resolve() root.mkdir(mode=0o700, parents=True, exist_ok=True) comms = wire(root) - Bus.install(Bus.path_in(comms.root)) event = dict( timestamp="2026-10-19T00:00:00Z", cwd=str(root),