Skip to content

Add crossplot startup route handshake - #12

Merged
SvenMarcus merged 1 commit into
masterfrom
feature/crossplot-route-handshake
Dec 1, 2026
Merged

SvenMarcus merged 1 commit into
masterfrom
feature/crossplot-route-handshake

Conversation

@SvenMarcus

@SvenMarcus SvenMarcus commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Note

This PR is #10 rebased onto master

Changes

Galactic plots could publish events before other plots had registered their listeners with the main bus, so early messages were lost.

  • A bus created with an initial_route_source defers its subscription messages and sends its complete listener list in one message via submit_initial_routes(required_sources) on busid:main:routes.
  • Endpoints keep the established busid:main:subscribe and busid:main:unsubscribe messages, emitting them once per event when the endpoint's local listener state changes.
  • The main bus (crossplot:main) holds publications until every required startup source (default "galactic-core") has reported, then sets busid:main:ready.
  • Notifications are taken (read and cleared) before callbacks run, so a failing listener cannot block the mailbox; malformed notifications are dropped. Subscribers are stored once per endpoint and each publication is sent through the Mailbox serializer.
  • deepcore:galactic registers as "galactic-core" and submits its routes after all plugins are loaded; config.required_initial_route_sources can name additional sources to wait for.

Galactic plots could publish events before other plots had registered
their listeners with the main bus, so early messages were lost.

- A bus created with an initial_route_source defers its subscription
  messages and sends its complete listener list in one message via
  submit_initial_routes(required_sources) on busid:main:routes.
- Endpoints keep the established busid:main:subscribe and
  busid:main:unsubscribe messages, emitting them once per event when
  the endpoint's local listener state changes.
- The main bus (crossplot:main) holds publications until every required
  startup source (default "galactic-core") has reported, then sets
  busid:main:ready.
- Notifications are taken (read and cleared) before callbacks run, so a
  failing listener cannot block the mailbox; malformed notifications are
  dropped. Subscribers are stored once per endpoint and each publication
  is sent through the Mailbox serializer.
- deepcore:galactic registers as "galactic-core" and submits its routes
  after all plugins are loaded; config.required_initial_route_sources can
  name additional sources to wait for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

File Coverage
All files 97% ✅
crossplot/KeyValueStoreBasedEventBus.lua 96% ✅
crossplot/crossplot.lua 68% ❌
crossplot/serializer.lua 98% ✅
galaxy/GalacticConquest.lua 96% ✅
galaxy/GalacticEvents.lua 72% ❌
galaxy/Planet.lua 65% ❌
spec/crossplot/crossplot_context_spec.lua 98% ✅
spec/crossplot/eventbus_spec.lua 99% ✅
spec/crossplot/main_eventbus_integration_spec.lua 100% ✅
std/Observable.lua 95% ✅
std/PluginLoader.lua 95% ✅
std/Queue.lua 71% ❌

Minimum allowed coverage is 75%

Generated by 🐒 cobertura-action against eae25a5

@SvenMarcus
SvenMarcus merged commit 2cc5ea9 into master Dec 1, 2026
2 checks passed
@SvenMarcus
SvenMarcus deleted the feature/crossplot-route-handshake branch December 1, 2026 23:46
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