 
 
 
-;[package->dependencies dependee->dependers]
-;{:packageToDependencies {"name" {:package {}
-;                :children {"name" spec
-;                           "name" spec}}}
-; :dependeeToDependers {"dependee" ["depender" "depender"]}}
+;(->package-graph)
+;{:records {"name" <package>}
+; :dependee-parents {"dependee" #{"depender" "depender}}}
 
 (defrecord package-graph [records dependee-parents])
+(defrecord package [name version location dependencies])
+(defn resolve-dependencies [package]
+  (reduce
+    reconcile
+    (->package-graph {(:name package) package} {})
+    (map #(resolve-dependencies
+            (realize %1))
+         (:dependencies package))))
+
 
 ; realize is already written
 ; needs work to be able to handle conflicts, already-installeds, etc.

    ; else add it from a/b.
    ))


(defn resolve-dependencies [dep]
  (reduce
    reconcile
    [{} {}]
    (map #(resolve-dependencies (realize %1)) (:children dep))))




            [to' from']
            children)))






(defn realize
  "Takes a request object and a query object and
  returns an actual package object pull from the
