@@ -207,7 +207,7 @@ async def dead_zone(event: MandalaEvent, state: StateStore, redis: object) -> li
207207
208208async def customs_hold_vector_stall (event : MandalaEvent , state : StateStore , redis : object ) -> list [MandalaEvent ]:
209209 """Laredo Vector Stall detector: Fire alert when customs hold lands before driver reaches bridge.
210-
210+
211211 The "Vector Stall" problem: Customs broker knows about the hold hours before the driver
212212 does. If the driver is still >30 minutes from the bridge, we can reroute them to a
213213 hold lot instead of wasting hours in the queue.
@@ -218,24 +218,24 @@ async def customs_hold_vector_stall(event: MandalaEvent, state: StateStore, redi
218218 EventType .CUSTOMS_INSPECTION_REQUIRED .value ,
219219 ):
220220 return []
221-
221+
222222 data = event .data if isinstance (event .data , dict ) else {}
223223 shipment_urn = event .subject or ""
224-
224+
225225 # Extract Laredo-specific context from Descartes normalization
226226 eta_to_bridge = data .get ("eta_to_bridge_minutes" )
227227 truck_location = data .get ("truck_location" , "unknown" )
228228 port_of_entry = data .get ("port_of_entry" , "unknown" )
229229 hold_reason = data .get ("hold_reason" , "unknown" )
230-
230+
231231 # Only alert if driver hasn't reached bridge yet (>30 minutes away)
232232 if eta_to_bridge is None or eta_to_bridge <= 30 :
233233 return []
234-
234+
235235 # Debounce per shipment to avoid duplicate alerts
236236 if not await _debounce (redis , f"vectorstall:{ shipment_urn } " , ttl = 3600 ):
237237 return []
238-
238+
239239 log .info (
240240 "customs_hold.vector_stall" ,
241241 shipment = shipment_urn ,
@@ -244,7 +244,7 @@ async def customs_hold_vector_stall(event: MandalaEvent, state: StateStore, redi
244244 truck_location = truck_location ,
245245 hold_reason = hold_reason ,
246246 )
247-
247+
248248 return [
249249 new_event (
250250 type = EventType .ALERT_CUSTOMS_HOLD_VECTOR_STALL ,
0 commit comments