(defn maybe-looping-pass [free passes]
(if-let [looping (seq (filter :affects free))]
(loop [[l & ls] looping]
(if l
(if (satisfies-affected? l (remove-pass passes (:name l)))
;; all deps satisfied
l
(recur ls))
(if-let [p (first (remove :affects free))]
;; pick a random avaliable non-looping pass
p
(throw (ex-info (str "looping pass doesn't encompass affected passes: " (:name l))
{:pass l})))))
;; pick a random available pass
(first free)))