                             (aput multi-get res-ch
                                   (merge res-m {:status :ok}))))
                      nil)]
-       (act multi-get-start actx
-         (aput multi-get-start state-ch
-               [(kvs-ident-check (:kvs-ident m) work-fn) nil]))))
+       (kvs-do actx state-ch m nil
+                   (kvs-checker (:kvs-ident m) work-fn))))
 
    :multi-change
    (fn [actx state-ch m]


   :sync
   (fn [actx state-ch m]
     (state-work actx state-ch m
                 (kvs-ident-check (:kvs-ident m)
                                  (fn [state kvs]
                                    [(assoc-in state [:kvss (:name kvs)]
                                               (-> kvs
                                                   (assoc :clean (:dirty kvs))
                                                   (assoc :dirty (make-kc))))
                                     {:status :ok :status-info :synced}]))))})

(defn make-kvs-mgr [actx & op-handlers-in & {:keys [cmd-ch state-ch]}]
  (let [cmd-ch (or cmd-ch (achan actx))

; TODO: Add snapshot ability.
; TODO: Readers not blocked by writers.
; TODO: Mutations shadow old values.
; TODO: Conventions on :status, :status-info, :partial, :result responses.

(defn make-kc [] ; A kc is a keys / changes map.
  {:keys (sorted-map)      ; key -> sq
   :changes (sorted-map)}) ; [sq key] -> {:key k, :sq s, :deleted true | :val v}

(defn kc-sq-by-key [kc key]
  (get (:keys kc) key))
