refactor(bus): rename ORCHESTRATOR_ACTIVITY → ORCHESTRATOR_TRAFFIC

Aligns the bus token with the DB column value; OrchestratorEvent.kind
is 'traffic'/'file' but the topic was 'activity'/'file'. The asymmetry
made consumer code (UI filter, SSE event names) need a translation
layer. No external subscribers existed yet.
This commit is contained in:
2026-04-26 19:53:40 -04:00
parent 4c37ece39e
commit 900c0c3ef5
2 changed files with 5 additions and 5 deletions

View File

@@ -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}")