;; Learned-game providers: requiring a namespace registers its policy.
;; No games learn yet — this namespace is the fill-in point for
;; docs/NEW-BOT-PROMPT.md §5 (which delegates the brain itself to train-kit's
;; NEW-BRAIN-PROMPT.md). Dropping a learned game = deleting its provider
;; namespace + one require here.
;;
;; The complete pattern, worked for a hypothetical valley-blocks brain
;; (adapt the hook name and feature code to your game; bot.git's
;; src/bot/policies/*.cljs are the live worked examples):
;;
;; ;; ---- src/__NAME__/policies/valley_blocks.cljs ----------------------
;; (ns __NAME__.policies.valley-blocks
;; (:require ["ardegazu-train-kit" :refer (CheckpointStore checkpointPath
;; EpisodeWriter isMlpModel)]
;; [__NAME__.policies.registry :refer (register-policy)]
;; [__NAME__.rl.valleyblocks-policy :as vp]))
;;
;; ;; one checkpoint store for the whole process — every room reads it,
;; ;; the trainer (a different process) is the only writer
;; (def ^:private store (atom nil))
;;
;; (register-policy
;; #js {:game "valley-blocks"
;; :init (fn [^js learning log]
;; (reset! store
;; (CheckpointStore. (checkpointPath (.-modelDir learning) "valley-blocks")
;; (.-reloadMs learning)
;; (fn [^js m] (log (str "model valley-blocks loaded ("
;; (.-episodes m) " episodes)"))))))
;; :forRoom (fn [epsilon data-dir]
;; ;; per-room recorder: ε-greedy inference from the shared
;; ;; checkpoint (stock fallback before the first promotion)
;; ;; + transition logging to episode JSONL for the trainer.
;; ;; Guard the checkpoint's shape — the recorder sees its
;; ;; own game's model or nil, never junk.
;; (let [model (fn []
;; (let [m (some-> ^js @store .-model)]
;; (when (and (some? m) (isMlpModel m "valley-blocks")) m)))
;; rec (vp/make-recorder model epsilon (EpisodeWriter. data-dir))]
;; #js {:joinOptions #js {:onPiece (fn [view] (.onPiece ^js rec view))}
;; :attach (fn [room] (.attach ^js rec room))}))})
;; ;; --------------------------------------------------------------------
;;
;; Then one require here per learned game:
;;
;; (ns __NAME__.policies.index
;; (:require [__NAME__.policies.valley-blocks]))
(ns __NAME__.policies.index)