           q   (add-query _ qid query)
           inf (f/add-vertex! g {:val #{} ::f/collect-fn (collect-inference _ production)})]
       (f/add-edge! g (:result q) inf f/signal-forward nil)
-      inf))
+      {:query q :inf inf}))
   )
 
 (defn triple-graph

   (fn [_ incoming]
     (let [res (vals (peek incoming))]
       (delay
        (when (and (seq res) (every? #(not= #{nil} %) res))
          (->> res
               (map #(disj % nil))
               (set)

           g {::f/collect-fn
              (f/simple-collect
               (fn [val in]
                 (debug :updated-result (pr-str @(peek in)))
                 (count @(peek in))))})]
    (f/add-edge! g src v f/signal-forward nil)
    v))

(defn start
  []
  (let [g (triple-graph (f/compute-graph))
        toxi (:result (add-query g :toxi ['toxi nil nil]))
        types (:result (add-query g :types [nil 'type nil]))
        projects (:result (add-query g :projects [nil 'type 'project]))
        all (:result (add-query g :all [nil nil nil]))
        num-projects (add-counter g projects)
        num-types (add-counter g types)
        inf1 (add-rule g :knows [nil 'knows nil] (fn [[s p o]] [[s 'type 'person] [o 'type 'person] [o 'knows s]]))

        ctx (f/async-context {:graph g :processor f/eager-vertex-processor :timeout nil})]
    (f/execute! ctx)
    (mapv
     #(add-triple g %)
     '[[toxi author fabric]
       [fabric type project]
       [toxi type person]])
    (info :inf-vertices (get-in inf1 [:query :result :id]) (get-in inf1 [:inf :id]))
    {:g   g
     :ctx ctx
     :all all
     :toxi toxi
     :types types
     :projects projects
     :num-projects num-projects
     :num-types num-types}))
