 (defn make-ago-world []
   (let [last-id (atom 0)]
     (atom {:gen-id #(swap! last-id inc)
-           :seq [0]     ; Extended when a snapshot is revived (branching).
+           :seqv [0]    ; Sequence numbers, grown when snapshot revived/branched.
            :bufs {}     ; Keyed by buf-id.
            :smas {}     ; Keyed by buf-id, value is state-machine array.
            :smas-new {} ; Same as :smas, but for new, not yet run goroutines.

  (resize [_] nil) ; From RingBuffer 'interface'.

  (cleanup [_ keep?]
    (swap! ago-world #(update-in % [:bufs buf-id] (fn [xs] (filter keep? xs)))))

  protocols/Buffer
  (full? [this]

                          sma-map)))

(defn ago-snapshot [ago-world-now]
  (-> ago-world-now ; The mutable sma's need explicit cloning.
      (assoc :smas (copy-sma-map (:smas ago-world-now)))
      (assoc :smas-new (copy-sma-map (:smas-new ago-world-now)))))

(defn seqv+ [ago-world-now]
  (update-in ago-world-now [:seqv (dec (count (:seqv ago-world-now)))] inc))

; --------------------------------------------------------

