                          :path [] 
                          :extent-state extent-state}] 
                        destinations)))
-  (println "state out: " (:event-type state-event))
 
   ;; Triggering on job completed is buggy 
   ;; as peer may die while writing :job-completed

;; Job code

(defn add-path [job-id task-id {:keys [n] :as segment}]
  ;(when-not (:state-output? segment) (println "New segment " (update segment :path conj [job-id task-id])))
  (update segment :path conj [job-id task-id]))

(def add-paths-calls

    (prop-is (= (count jobs) (count (:completed-jobs replica))) "jobs not completed")
    (prop-is (= (count (:groups model)) (count (:groups replica))) "groups check")
    (prop-is (= (count (:peers model)) (count (:peers replica))) "peers")
    ;(println "STATE ATOM" @state-atom)
    (let [state-values (reduce into [] (vals @state-atom))]
      (prop-is (= (count (set state-values)) (count state-values)) "not enough state values")
      (prop-is (= (set expected-state) (set state-values)) 
               (str "incorrect state "
                    (vec (take 2 (clojure.data/diff (set expected-state) (set state-values)))))))
    (prop-is (= expected-state 
                ;; Potentially should check for state ordering here
                (set (:extent-state 
