    s/Keyword s/Any})
 
 (def PeerId
-  (s/either s/Uuid s/Keyword))
+  (s/cond-pre s/Uuid s/Keyword))
 
 (def PeerState
   (s/enum :idle :backpressure :active))
 
-(def PeerSite 
+(def PeerSite
   {s/Any s/Any})
 
 (def JobId
-  (s/either s/Uuid s/Keyword))
+  (s/cond-pre s/Uuid s/Keyword))
 
 (def TaskId
-  (s/either s/Uuid s/Keyword))
-
-(def TaskScheduler 
+  (s/cond-pre s/Uuid s/Keyword))
+
+(def TaskScheduler
   s/Keyword)
 
 (def SlotId


(def TriggerCall
  {:trigger/init-state Function
   :trigger/next-state Function 
   :trigger/trigger-fire? Function})

(def TriggerState
  (s/both Record
          {:window-id s/Keyword
           :refinement TriggerRefinement
           :on s/Keyword
           :sync s/Keyword
           :fire-all-extents? (s/maybe s/Bool)
           :pred (s/maybe s/Keyword)
           :watermark-percentage (s/maybe double)
           :doc (s/maybe s/Str)
           :period (s/maybe TriggerPeriod)
           :threshold (s/maybe TriggerThreshold) 
           :sync-fn (s/maybe Function)
           :state s/Any
           :id s/Any
           :trigger Trigger
           :init-state Function
           :trigger-fire? Function
           :next-trigger-state Function
           :create-state-update Function
           :apply-state-update Function}))

(def StateEvent s/Any)

(def WindowState
  (s/both Record 
          {:window-extension WindowExtension
           :trigger-states [TriggerState]
           :window Window
           :state {s/Any s/Any}
           :state-event StateEvent
           :event-results [StateEvent]
           :init-fn Function
           :create-state-update Function
           :apply-state-update Function
           :super-agg-fn (s/maybe Function)
           (s/optional-key :new-window-state-fn) Function
           (s/optional-key :grouping-fn) (s/either s/Keyword Function)}))

(def JobScheduler
  NamespacedKeyword)

  {:window/id s/Keyword
   :window/task TaskName
   :window/type WindowType
   :window/aggregation (s/cond-pre s/Keyword [s/Keyword])
   (s/optional-key :window/init) s/Any
   (s/optional-key :window/window-key) s/Any
   (s/optional-key :window/min-value) s/Int
