New orchestrator/src/services/eventBusBroker.ts: per-process singleton bridging the in-process EventEmitter across replicas over Redis pub/sub.
eventBus.publish() hands every persisted record to the broker after the local emit; remote replicas re-emit inbound records on their own local emitter.
Echo suppression via per-process instanceId in the envelope.
Feature-flagged by REDIS_URL. When unset the broker is strictly inert — single-process behaviour is preserved byte-for-byte.
3 unit tests for feature-flag semantics (REDIS_URL unset path). Live Redis behaviour will be covered by the Testcontainers suite in PR Q.
Why
Gap-analysis v2 §7.3 flagged the event bus as process-local: when the orchestrator scales to >1 replicas, SSE subscribers connected to replica A never see events originated on replica B. This PR closes that gap without changing the signature chain or persistence layer.
Verification
npx tsc --noEmit clean.
npx jest 83/83 green.
Closes gap-analysis v2 §7.3 + §10.3.
## What
- New `orchestrator/src/services/eventBusBroker.ts`: per-process singleton bridging the in-process `EventEmitter` across replicas over Redis pub/sub.
- `eventBus.publish()` hands every persisted record to the broker after the local emit; remote replicas re-emit inbound records on their own local emitter.
- Echo suppression via per-process `instanceId` in the envelope.
- Feature-flagged by `REDIS_URL`. When unset the broker is strictly inert — single-process behaviour is preserved byte-for-byte.
- 3 unit tests for feature-flag semantics (`REDIS_URL` unset path). Live Redis behaviour will be covered by the Testcontainers suite in PR Q.
## Why
Gap-analysis v2 §7.3 flagged the event bus as process-local: when the orchestrator scales to >1 replicas, SSE subscribers connected to replica A never see events originated on replica B. This PR closes that gap without changing the signature chain or persistence layer.
## Verification
- `npx tsc --noEmit` clean.
- `npx jest` 83/83 green.
Closes gap-analysis v2 §7.3 and §10.3.
- New services/eventBusBroker.ts: per-process singleton with unique
instanceId; subscribes to a Redis pub/sub channel (default
ccombo:events) and re-emits inbound records on the in-process
EventEmitter. Outbound envelopes carry the instanceId so the
originating replica drops its own echo.
- eventBus.publish() hands every persisted record to the broker after
the local emit, so same-process SSE subscribers see zero change
while remote-replica subscribers now receive every event.
- When REDIS_URL is unset the broker is strictly inert (no connect,
no publish) — single-process behaviour is preserved byte-for-byte.
- 3 unit tests for feature-flag semantics; full suite 83/83 green.
- Live Redis behaviour will be covered by the Testcontainers suite
in PR Q.
This pull request is broken due to missing fork information.
This pull request can be merged automatically.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes gap-analysis v2 §7.3 + §10.3.
What
orchestrator/src/services/eventBusBroker.ts: per-process singleton bridging the in-processEventEmitteracross replicas over Redis pub/sub.eventBus.publish()hands every persisted record to the broker after the local emit; remote replicas re-emit inbound records on their own local emitter.instanceIdin the envelope.REDIS_URL. When unset the broker is strictly inert — single-process behaviour is preserved byte-for-byte.REDIS_URLunset path). Live Redis behaviour will be covered by the Testcontainers suite in PR Q.Why
Gap-analysis v2 §7.3 flagged the event bus as process-local: when the orchestrator scales to >1 replicas, SSE subscribers connected to replica A never see events originated on replica B. This PR closes that gap without changing the signature chain or persistence layer.
Verification
npx tsc --noEmitclean.npx jest83/83 green.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.