29 lines
793 B
Python
29 lines
793 B
Python
from __future__ import annotations
|
|
|
|
from typing import Dict, Any, List
|
|
from .core import PlanDelta
|
|
|
|
|
|
class ExecutionRouter:
|
|
"""Routing layer that assigns a venue to a given PlanDelta."""
|
|
|
|
def __init__(self, venues: List[str]):
|
|
self.venues = venues or []
|
|
|
|
def route(self, plan: PlanDelta) -> Dict[str, Any]:
|
|
venue = self.venues[0] if self.venues else None
|
|
routed_plan = PlanDelta(deltas=plan.deltas, venue=venue, author=plan.author, timestamp=plan.timestamp)
|
|
return {
|
|
"routed": True,
|
|
"venue": venue,
|
|
"plan": routed_plan,
|
|
}
|
|
|
|
|
|
# Backwards-compatibility alias (if any downstream code imports ExecutionEngine)
|
|
class ExecutionEngine(ExecutionRouter):
|
|
pass
|
|
|
|
|
|
__all__ = ["ExecutionRouter", "ExecutionEngine"]
|