 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Wrappers     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-;; TODO: simplify these, avoid extra stub steps when possible ?
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;     Output Collection     ;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
-
-;; TODO: collect children too ?
 (declare make-output-collecting-subproblem)
 (defn make-output-collecting-stub [inner-stub]
   (assert (not (= (first (stub-name inner-stub)) :OS)))

;; Here we properly deal with weirdness of stubs/inner-sps decreaseing as they add
;; children, by makig sure to do the updates synchronously.

;; TODO: find cleaner overall architecture.  Right now, names
;;   don't really do anything, and there's too much worrying about types, etc.
;;   Solution may be to have Generator (takes place of name) --> Stub --> SP.
;;   Generator knows how to take input set and produce stub., etc.
;;   For now, seems like too much complexity for too little gain.

;; TODO: tail caching?
;; TODO: cache refine-inputs and/or other SPs.
;; TODO: encapsulate stub/sp behaviors somehow.
;; TODO: garbage collect dead stuff

;; TODO: remove extra stub indirection step when not needed?
;; (i.e., either reverse directions, or just have get-stub-output when known..)
;; TODO: pessimistic

;; TODO: pseudo-solve

                 (let [left-done? (atom false)]
                   (fn [s b] 
                     (when (and (not @left-done?)
                                (summary/solved? (summaries/summary left-sp))) ;; TODO:??
                       (reset! left-done? true) 
                       (summaries/disconnect! s ss)
                       (add-watcher! left-sp (fn [o] (def *sum* [s left-sp o])
