 (defn tr-fn
   [inner-path [recent-trees src-map] template f]
   (fn [& args]
-    (let [parent (produce-recent-parent-tree-atom! inner-path
-                                                   recent-trees)
-          this (-> (trace/mk-tree :parent @parent)
-                   (merge template)
+    (let [this (-> @(produce-recent-tree-atom! #spy/d inner-path
+                                               recent-trees)
+                   (merge #spy/d template)
                    (assoc :args (vec args)
                           :arg-map (delay (zipmap (:arg-forms template)
                                                   args))
                           :started-at (trace/now)))
+          _ (update-tree! this recent-trees)
           [value throw] (binding [trace/*trace-log-parent* this]
                           (try
                             [(apply f args) nil]

     :xpanded-parent (:xp sub-src-map)
     :xpanded-frm (:x sub-src-map)}))

(defn get-temp-root-parent
  []
  (-> trace/*trace-log-parent*
      (select-keys [:depth :path])


(defn record-trace-tree
  [[log src-map]]
  #spy/d (@log nil)
  (def log' @log)
#_  (loop [[head & body] log
         tree-map {}
