Title#
feat: add EventBusService abstraction backed by Redis pub/sub
Problem#
Cross-process event delivery requires a transport beyond in-process EventEmitter2. This PR introduces a Redis-backed EventBusService that can fan out typed events across multiple processes.
Task / Link#
Closes #443
Changes#
src/event-bus/event-bus.events.ts— typedEventMapinterface covering all 6 events (task.updated,task.stuck,job.created,job.completed,job.failed,artefacts.synced)src/event-bus/event-bus.service.ts—EventBusServicewithemit()/on()over Redis pub/sub; errors swallowed inemit(); per-handler error isolation inon()src/event-bus/event-bus.module.ts—@Global()module factory-providing two ioredis clients (pub + sub) fromREDIS_HOST/REDIS_PORT/REDIS_DBconfigsrc/event-bus/index.ts— barrel exportsrc/event-bus/event-bus.service.spec.ts— 7 unit tests covering publish, subscribe, multi-handler dispatch, error isolation, andonModuleDestroy()src/app.module.ts— registersEventBusModule
Notes#
- Runs alongside existing EventEmitter2 — no existing emitters or listeners are changed
- Channel prefix
agentsde:events:scopes all channels to this application emit()is fire-and-forget: Redis errors are logged and swallowed — pipeline advancement is not blocked by event delivery
Testing#
- 7 new unit tests — all pass
- Full test suite (807 tests) — all pass
npm run lint— zero warnings