   (mapcat (fn [path] 
             (map (fn [seg] 
                    (reduce (fn [segment task] 
-                             (add-path job-id task segment)) 
+                             (add-path [] job-id task segment)) 
                            seg
                            path)) 
                  inputs))

;;;;;;;;;
;; Job code

(defn add-path [job-id task+slot {:keys [n] :as segment}]
  (update segment :path conj [job-id task+slot]))

(def add-paths-calls
  {:lifecycle/before-task-start 
   (fn [event lifecycle]
     (if (= :input (:onyx/type (:task-map event))) 
       ;; include slot combinations with input
       {:params [(:job-id event) [(:task event) (:slot-id event)]]}
       {:params [(:job-id event) [(:task event)]]}))})

(defn add-paths-lifecycles [job]
  (update job 

        ;; TODO: group-by job-id so we can separate out the diff job states?
        expected-state (->> expected-outputs
                            (map (fn [v] 
                                   (update v :path (comp vec butlast))))
                            (group-by :n))]
    ;(println  "jobs " jobs "comp" (:completed-jobs replica))
    ;(println "gen-cmds" gen-cmds)
