Skip to content

Let the root that published a harness transcript write it - #2781

Merged
trissim merged 1 commit into
mainfrom
fix/external-session-publisher-2
Oct 23, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/external-session-publisher-2

Conversation

@trissim

@trissim trissim commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes the main red that #2771 (23becf5) introduced: tests/test_native_input_bus_path.py::test_saved_owner_dm_replies... raised RelationViolationError: Copied bus ... cannot write external session inside the installer's nested run.

Cause. ExternalSessionLocation.writable compared the root with CommsRoute.current(), which is the machine-wide published route. A private root is never that route, so it refused to write a harness transcript it had published itself.

Fix. The decision now comes from the session's own declared location.

  • ExternalSessionLocation declares published, the root whose registry published it. The wire form is {"path", "published"}.
  • Only the root named in published may write the file. A copy keeps that root, so the copy reads the file and refuses to write it.
  • RegistrySessionLocation.publish(absolute, root, publisher) is the single place that picks the class. A path under the root becomes Bus. Anything else becomes External, owned by the publishing root.
  • Rebinding a bus transcript to another root yields an External location owned by the source root.
  • session_file.py no longer imports CommsRoute.

Proof.

  • tests/test_carry_session_locations.py (including a new private-root write test) and tests/test_native_input_bus_path.py: 6 passed.
  • The session suites touched by the location type: 129 passed, 4 failed. All 4 also fail on main 278750a:
    • test_check_root x2: "A check root belongs under the caller's agent-scratch directory";
    • test_start::test_real_stopped_owner...;
    • test_native_owner_launcher_resolution::test_fork_runs....
  • ruff: session_file.py has 0 findings (main has 0); the carry test has 5 (main has 5). The black diff and the mypy count for session_file.py are the same as main's.

🤖 Generated with Claude Code

#2771 decided whether a root may write an external transcript by comparing
it with the machine's published route (CommsRoute.current()). Any root that
was not the route, such as the installer's nested private bus, refused to
write a harness transcript it had published itself.

ExternalSessionLocation now declares the root that published it. Only that
root writes the file; a copy keeps the declared root, so it can read the
file but refuses to write it. A bus transcript published into another root
becomes External, owned by its source root. The session_file module no
longer reads the machine route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 23, 2026 13:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit 1da51e0 into main Oct 23, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants