 (defn process-command
   "Execute the given governance transformation on the given
    circle, returning the new circle."
-  [circle record]
-  (let [function-primary (first record)
-        command (function-primary commands)]
+  [circle [function-primary :as record]]
+  (let [command (function-primary commands)]
     (if command
       (command circle record function-primary)
       (do

           (RuntimeException.
             (format "Unable to execute governance record: %s " record) e)))))

(defn modify-entity [circle record function-primary]
  (let [function-secondary (first (second record))
        function-name (format "%s-%s"
                              (name function-primary) (name function-secondary))
        fn (resolve (symbol "freefrog.lang" function-name))
        entity-name (nth record 2)
        params (->> record
                    (drop 3)
                    (map convert-to-pair)

                    (merge {:name entity-name}))]
    (execute-governance-function record fn circle params)))

(defn define-policy [circle [_ policy-name policy-text] _]
  (g/add-policy circle policy-name policy-text))

(defn strike-policy [circle [_ policy-name] _]
  (g/remove-policy circle policy-name))

(def elected-role-mapping {"facilitator" g/facilitator-name
                           "secretary"   g/secretary-name
