                                                                      src-map
                                                                      fn-meta
                                                                      (conj path %)
-                                                                     path #_path-parent)
+                                                                     path-parent)
                                                         form)))]
       (update-in xmap
                  [:form]


(defn mk-recent-tree-at-inner-path
  [path path-parents tree-atom]
  (if (= (count path) 1) ;; TODO is this the right way to detect root?
    (let [new-tree (get-temp-root-tree path)]
      (push-to-tree-atom!  new-tree
                           tree-atom)
      new-tree)
    (let [parent (produce-recent-tree-atom! (find-closest-parent path
                                                                 path-parents)
                                            path-parents
                                            tree-atom)
          new-tree (-> (trace/mk-tree :parent @parent)

                        src-map
                        fn-meta
                        path
                        path)]
    (layer-xpansion-maps xmap
                         {:path-parents {path path-parent}
                          :templates {path (mk-tree-template src-map
