mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-06-11 09:24:44 +02:00
feat(notifications): Phase 2.6.5 wire EventBus into main.py runtime path
Closes the dark store->bus path. The to_event() methods added in Phase 2.6 for NWS and FIRMS were exercised only by unit tests because main.py never built the pipeline or passed an EventBus to EnvironmentalStore. Insertion points (matching existing init/lifecycle conventions): - _init_components(): inside the notifications.enabled block, after the NotificationRouter init, build the v0.3 pipeline via build_pipeline() and stash it on self.event_bus; then construct EnvironmentalStore with event_bus=self.event_bus so newly-seen adapter events emit to the bus. - start(): after _write_pid(), await start_pipeline() to launch the digest scheduler now that the event loop is running; the scheduler is stored on self._pipeline_scheduler. - stop(): await stop_pipeline() during teardown. - env/store._emit_event(): emission log promoted DEBUG->INFO for runtime traceability of events crossing the bus. When notifications are disabled, self.event_bus stays None and the store receives None (emission no-ops), preserving prior behavior. Tests: 132 passing, no regressions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9c5a106c9f
commit
074e020463
2 changed files with 30 additions and 2 deletions
7
meshai/env/store.py
vendored
7
meshai/env/store.py
vendored
|
|
@ -114,7 +114,12 @@ class EnvironmentalStore:
|
|||
try:
|
||||
event = adapter.to_event(raw_evt)
|
||||
self._event_bus.emit(event)
|
||||
logger.debug("Emitted %s event %s to pipeline", event.source, event.id)
|
||||
logger.info(
|
||||
"Emitted %s event %s (%s) to pipeline bus",
|
||||
event.source,
|
||||
event.id,
|
||||
event.category,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning("Failed to emit event to pipeline: %s", e)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue