From 864fce34ee19052b0914100a1127608e108055cc Mon Sep 17 00:00:00 2001 From: Tristan Simas Date: Fri, 23 Oct 2026 15:17:42 -0400 Subject: [PATCH] Pin the root states production builds in three main reds test_native_root_checks_relative_and_absolute_ancestor_permissions and test_private_issuer_rejects_untrusted_ancestor_and_collision turned red at 4ab345bd0 (#2854): root adoption now creates every root's empty bus (root_runtime.py adopt), and wire() adopts, so a bus exists before prepare_native_root refuses the untrusted ancestor. Both tests still asserted the old creation owner (bus created at native prepare). The invariant they exist for is that a refused root gains no private authority: both now assert the registry guard is never created. test_newer_read_moves_past_a_line_still_being_appended installed PrivateCoordinatorTable on a bare wire() root with no registry guard, a state registry_store.py:357-360 refuses ("Native runtime has no registry authority"). It now builds on private_comms, whose prepare_native_root is the one production owner of the private runtime, as #2872 did for nine other tests. Co-Authored-By: Claude Opus 5.5 --- tests/test_coordination_cohort.py | 8 +++++--- tests/test_declarations.py | 2 -- tests/test_transcript_partial_tail.py | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/test_coordination_cohort.py b/tests/test_coordination_cohort.py index 01fa26bb55..d88d638522 100644 --- a/tests/test_coordination_cohort.py +++ b/tests/test_coordination_cohort.py @@ -6,7 +6,6 @@ from agent_comms.private_runtime_schema import PrivateCoordinatorTable from bus_record_fixture import prepare_native_comms -from agent_comms.bus import Bus from bus_history import read_history from conftest import declare_test_bus, publish_initial @@ -355,9 +354,12 @@ def test_private_issuer_rejects_untrusted_ancestor_and_collision(tmp_path: Path) root.mkdir() open_parent.chmod(0o777) try: + candidate = wire(root) with pytest.raises(RelationViolationError): - wire(root).registry.prepare_native_root() - assert not Bus.path_in(root).exists() + candidate.registry.prepare_native_root() + # Root adoption owns the empty bus (root_runtime.py adopt); the refusal is that + # no private authority exists for the untrusted root. + assert not candidate.registry.store.guard_path.exists() finally: open_parent.chmod(0o700) diff --git a/tests/test_declarations.py b/tests/test_declarations.py index 8462580b77..376d897ac8 100644 --- a/tests/test_declarations.py +++ b/tests/test_declarations.py @@ -1,7 +1,6 @@ from agent_comms.private_runtime_schema import PrivateCoordinatorTable -from agent_comms.bus import Bus from bus_record_fixture import prepare_native_comms import json @@ -48,7 +47,6 @@ def test_native_root_checks_relative_and_absolute_ancestor_permissions( candidate = wire(root) with pytest.raises(RelationViolationError): prepare_native_comms(candidate) - assert not Bus.path_in(root).exists() assert not candidate.registry.store.guard_path.exists() monkeypatch.chdir(tmp_path) safe = prepare_native_comms(wire(Path("safe-relative"))) diff --git a/tests/test_transcript_partial_tail.py b/tests/test_transcript_partial_tail.py index 4c8376259b..a2fd798b47 100644 --- a/tests/test_transcript_partial_tail.py +++ b/tests/test_transcript_partial_tail.py @@ -4,7 +4,6 @@ import json from agent_comms.session_file import RegistrySessionLocation -from agent_comms.comms import wire from agent_comms.coordinator import Coordination from agent_comms.threads import Thread @@ -18,8 +17,8 @@ def answer(identity, text): "message": {"role": "assistant", "content": [{"type": "text", "text": text}]}} -def test_newer_read_moves_past_a_line_still_being_appended(tmp_path): - comms = wire(tmp_path / "wire") +def test_newer_read_moves_past_a_line_still_being_appended(tmp_path, private_comms): + comms = private_comms session = tmp_path / "saved.jsonl" session.write_text(line({"type": "session", "version": 3, "id": "saved-session", "timestamp": "2026-10-20T00:00:00.000Z"}) + line(answer("first", "First answer")))