                      (cons (assoc entity :db/id id) entities)))
            
             ;; upserted => explode | error
-            :let [upserted-eid (upsert-eid db entity)]
+            :let [[entity' upserts] (resolve-upserts db entity)
+                  upserted-eid      (validate-upserts entity upserts)]
 
             (some? upserted-eid)
             (if (and (tempid? old-eid)

                     (not= upserted-eid (get tempids old-eid)))
              (retry-with-tempid initial-report report initial-es old-eid upserted-eid)
              (recur (allocate-eid report old-eid upserted-eid)
                     (concat (explode db (assoc entity :db/id upserted-eid)) entities)))
           
            ;; resolved | allocated-tempid | tempid | nil => explode
            (or (number? old-eid)

    [vs]
    
    :else vs))

(defn- explode [db entity]
  (let [eid (:db/id entity)]
