            flow-characteristics mission-task-weight
            label display-name incidence-set edges irks]
     :as options}]
+  ;;We should never see nil arguments
+  (assert (not (some #(nil? %) arguments)) "htn-primitive-task: Found nil arguments")
   (update-htn-object!
    (assoc-if (htn-task (assoc options :prefix (or prefix "hpt-")))
              :type :htn-primitive-task

            (do
              (log/error "TBD: :else")
              []))]
      (dbg-println :debug "HTN-METHODS " (with-out-str (pprint methods)))
      methods)))



;; RETURNS htn data structure in Clojure (optionally converted to JSON in cli.clj)
;; NOTE: root-task is a string (or nil)!!!
;; Examples
;;   "(isr-htn.main \"A\" \"B\" \"C\" \"D\")"
;;   "(isr-htn.get-data-and-interpret \"A\" \"B\")"
(defn plan-htn
  "Weaves a 'plan' from the root task, using the HTN methods.  Minimally hard-coded."
  [ir root-task file-format output]
  (reinitialize-htn-method-table)
  (reinitialize-htn-object-table)

(defn make-htn-methods "Construct the HTN Method(s) for mname"
  [ir pargs top-level? mpclass mname display-name margs mbody & [irks]]
  (dbg-println :debug "MHM " "TOP-LEVEL?" top-level? "MPCLASS" mpclass "MNAME" mname
               "DISPLAY-NAME" display-name
               "MARGS" margs
               "IRKS" irks "\nMBODY" mbody)
  (let [irks (conj (or irks [mpclass :methods mname]) :body)
        number-of-subtasks (count mbody)
        first-task-type (:type (get mbody 0))]
