;; next/genesis/object-types/define-validator.sx
;;
;; Meta-object that registers a validator predicate. The validation
;; pipeline (Step 6) consults registered validators by name when
;; running its stages.

(DefineObject
  :name "DefineValidator"
  :doc "Validator registration. :name is the validator key (e.g.\n        \"envelope-shape\"); :predicate is the SX (activity) ->\n        ok|{error, R} body."
  :schema (fn
    (obj)
    (and (string? (-> obj :name)) (not (nil? (-> obj :predicate))))))
