          (map
           (fn [[k v]]
             [k
-             (map
+             (mapv
               (fn [i]
                 [(get v i) (get v (inc i))])
               (range (count v)))])))))
+
+
+(defn explore-commit-graph
+  "Run the pipeline"
+  [cg]
+  (->> cg
+       commit-graph->nodes
+       distinct-nodes
+       nodes->order
+       find-merge-links
+       nodes->links))
 
 (comment
 

                "dev" 120
                "fix-2" 140}})

  (->> test-cg
       commit-graph->nodes
       distinct-nodes
       nodes->order
       find-merge-links
       nodes->links)

  )

(defn find-merge-links [{:keys [causal-order branches] :as cg}]
  (let [branch-heads (into {} (map (fn [[k v]] [v k]) branches))]
    (assoc cg :merge-links
      (->> (select-keys causal-order
                (for [[k v] causal-order
                      :when (> (count v) 1)]
                  k))
           (into {})
           (map (fn [[k v]] (map (fn [b] [b [(branches b) k]]) (remove nil? (map branch-heads v)))))
           (apply concat)
