diff --git a/decnet/bus/topics.py b/decnet/bus/topics.py index 7194de9c..9f456efb 100644 --- a/decnet/bus/topics.py +++ b/decnet/bus/topics.py @@ -10,7 +10,7 @@ Token structure (NATS-style, dot-separated): topology.{topology_id}.status decky.{decky_id}.state decky.{decky_id}.traffic - orchestrator.activity.{decky_id} + orchestrator.traffic.{decky_id} orchestrator.file.{decky_id} attacker.observed attacker.scored @@ -170,7 +170,7 @@ CREDENTIAL_REUSE_DETECTED = "reuse.detected" # static. Always nested with the destination decky uuid as the third # token, so consumers can subscribe to a single decky's life-injection # stream via ``orchestrator.*.``. -ORCHESTRATOR_ACTIVITY = "activity" +ORCHESTRATOR_TRAFFIC = "traffic" ORCHESTRATOR_FILE = "file" # System event types. @@ -296,7 +296,7 @@ def identity(event_type: str) -> str: def orchestrator(event_type: str, decky_id: str) -> str: """Build ``orchestrator..``. - *event_type* should be one of :data:`ORCHESTRATOR_ACTIVITY` or + *event_type* should be one of :data:`ORCHESTRATOR_TRAFFIC` or :data:`ORCHESTRATOR_FILE`. The destination decky is always the third token so per-decky subscribers can use ``orchestrator.*.``. diff --git a/decnet/orchestrator/events.py b/decnet/orchestrator/events.py index d434850f..c63af0b7 100644 --- a/decnet/orchestrator/events.py +++ b/decnet/orchestrator/events.py @@ -39,7 +39,7 @@ def to_row(action: Action, result: ActivityResult) -> dict[str, Any]: def topic_for(action: Action) -> str: """Map an action to its bus topic.""" if isinstance(action, TrafficAction): - return _topics.orchestrator(_topics.ORCHESTRATOR_ACTIVITY, action.dst_uuid) + return _topics.orchestrator(_topics.ORCHESTRATOR_TRAFFIC, action.dst_uuid) if isinstance(action, FileAction): return _topics.orchestrator(_topics.ORCHESTRATOR_FILE, action.dst_uuid) raise TypeError(f"unsupported action type: {type(action)!r}") @@ -47,7 +47,7 @@ def topic_for(action: Action) -> str: def event_type_for(action: Action) -> str: if isinstance(action, TrafficAction): - return _topics.ORCHESTRATOR_ACTIVITY + return _topics.ORCHESTRATOR_TRAFFIC if isinstance(action, FileAction): return _topics.ORCHESTRATOR_FILE raise TypeError(f"unsupported action type: {type(action)!r}")