fix: preserve SOR execution venue separately

This commit is contained in:
Hermes Agent
2026-08-19 12:48:05 +09:00
parent 15aeae6930
commit 7366cadf03
15 changed files with 126 additions and 17 deletions
+5 -3
View File
@@ -33,7 +33,7 @@ class RecordingBroker:
return OrderAck(
accepted=True,
broker_order_id=f"order-{len(self.orders)}",
venue=self.actual_venue or req.venue,
venue=req.venue,
)
def poll_fill(self, broker_order_id: str, *, side: str, symbol: str) -> FillStatus:
@@ -121,7 +121,7 @@ def test_invalid_venue_is_rejected_before_slot_transition(invalid_venue: str) ->
assert repo.list_slots("default")[0].status is SlotState.INACTIVE
def test_omitted_wire_venue_is_sor_then_actual_venue_is_persisted() -> None:
def test_omitted_wire_venue_remains_sor_for_cancel_and_restart() -> None:
repo = InMemorySlotRepository()
service = SlotService(repo)
intents = IntentService(
@@ -153,7 +153,9 @@ def test_omitted_wire_venue_is_sor_then_actual_venue_is_persisted() -> None:
execution.run_once()
dispatched = repo.fetch_slot(slot_id)
assert broker.orders[0].venue == "SOR"
assert dispatched is not None and dispatched.venue == "NXT"
# Ack cannot turn SOR routing provenance into an execution venue. Actual
# KRX/NXT is established by fill polling and stored on the ledger trade.
assert dispatched is not None and dispatched.venue == "SOR"
def test_inactive_transition_resets_venue_to_krx() -> None: