Skip to content

Create the bus when a root is adopted; an absent bus is a deleted bus - #2854

Merged
trissim merged 2 commits into
mainfrom
fix/bus-created-with-root
Oct 23, 2026
Merged

trissim merged 2 commits into
mainfrom
fix/bus-created-with-root

Conversation

@trissim

@trissim trissim commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes main's red at tests/test_outbound_transcript_source.py:245 (test_missing_bus_cannot_be_an_empty_presentation, DID NOT RAISE OperationalError).

Cause. #2784 (8ed65d3) moved Bus onto WalStore.committed_or_empty, so an absent bus.sqlite3 read as the declared empty schema. That fixed a fresh root raising CANTOPEN, but a missing file then meant two things, "never written" and "deleted" (IDEN-1).

Shape. There's no flag recording "bus created": a flag would be a second writable copy of what the file's existence already says (IDEN-5). Instead the bus exists from the moment its root does.

  • RootRuntimeStore.adopt (root_runtime.py), where a directory first becomes a root, creates the bus empty through Bus.install.
  • Bus.observing attaches the file directly. An absent bus is a deleted bus and raises CANTOPEN.
  • The fresh install's Bus.install right after wire(root) (installer/upgrade.py) restated that creation, so it's deleted.

TypedStore.snapshot keeps committed_or_empty for the optional typed stores; Bus no longer uses it.

Also main's red: tests/test_start.py:35 compared the registry's typed BoundExternalSession to a str (red on main 55d5a3e too). It now compares with the declared location bound to the root, from the same declaration it registers. The test's Bus.install after wire() restated adoption's creation and is deleted.

Proof

  • :245, test_storage_violations, test_store_backup: 30 passed. test_root_runtime (now asserts an adopted root reads an empty bus) and test_start: 3 passed.
  • Every test file that builds Bus directly (bus, install, historical views and notifications, connector, carry_bus_history, resource claims, native unknown recovery, check_root): 160 passed, 3 failed under load; those 3 pass in isolation on this head.
  • Practice upgrade install from the live runtime on a sanitized copy of the live root: exit 0, installed, 42.3 s.
  • Practice fresh install on an empty root: exit 0, installed, 41.7 s; bus.sqlite3 created with .root-runtime.json at adoption.

🤖 Generated with Claude Code

Tristan Simas and others added 2 commits October 23, 2026 13:51
#2784 (8ed65d3) made an absent bus.sqlite3 read as the declared empty
schema, to fix a fresh root raising CANTOPEN. A missing file then meant two
things, "never written" and "deleted" (IDEN-1), and
test_outbound_transcript_source.py:245 (a deleted bus must not present as
empty) went red on main.

The owner of "this directory became a root" is RootRuntimeStore.adopt: it
publishes the root's first record. It now creates the bus there, empty,
through Bus.install. Bus.observing no longer falls back to an empty
in-memory schema: an absent file fails to open. The fresh install's second
Bus.install after wire(root) restated that creation and is deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_root_runtime asserts a root adopted by wire() reads an empty bus.

test_start.py:35 was red on main: it compared the registry's typed
BoundExternalSession to a str. It now compares against the declared
location bound to the root, built from the same declaration it registers.
Its Bus.install after wire() restated the creation adoption now owns and
is deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trissim
trissim marked this pull request as ready for review October 23, 2026 17:57
Copilot AI balanced review requested due to automatic review settings October 23, 2026 17:57
@trissim
trissim merged commit 4ab345b into main Oct 23, 2026
8 checks passed

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 insufficient remaining quota.

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.

@github-actions

Copy link
Copy Markdown

debt-tools at 45a0abd, every finding:

grew Unformatted:tools/cutover/carry_unused_store_locks.py +1

@github-actions

Copy link
Copy Markdown

debt-src at 45a0abd, every finding:

grew LintFindings:src/agent_comms/typed_table.py +1

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