;; pleme-doc-gen.caixa.lisp — the DOGFOOD meta-caixa.
;;
;; pleme-doc-gen describes itself as a caixa source. The renderer
;; can re-emit its own (Cargo.toml + .pleme-io-release.toml + CI
;; shims + nix module trio + flake.nix + deps fragment) from THIS
;; FILE — proving the typed-source-as-truth loop closes on itself.
;;
;; Run:
;;   pleme-doc-gen caixa --source pleme-doc-gen.caixa.lisp --out . --force
;;
;; Diff against current on-disk files to verify the renderer is
;; lossless against its own corpus.

(defcaixa pleme-doc-gen
  :kind         :Binario
  :ecosystem    :rust-single-crate

  :package      { :name        "pleme-doc-gen"
                  :version     "0.1.5"
                  :license     "MIT"
                  :description "Rust replacement for the M0 Python _gen-*.py scripts in pleme-io/actions. Walks every action.yml + emits substrate's patterns-full.nix + per-action README.md + root catalog. Per the NO-SHELL prime directive."
                  :repository  "https://github.com/pleme-io/pleme-doc-gen"
                  :homepage    "https://github.com/pleme-io/pleme-doc-gen"
                  :categories  [ "command-line-utilities" "development-tools" ]
                  :keywords    [ "pleme-io" "actions" "patterns" "docs" "generator" ] }

  :ci-config    { :bump    { :default-type "patch" }
                  :publish { :no-verify true } }

  :workflows    [ :auto-release :pre-merge-gate ]
  :stacks       [ ]   ;; pleme-doc-gen has no AI/data/web3 stack — pure tool

  ;; pleme-doc-gen doesn't depend on other caixas; it depends on
  ;; crates.io packages (declared via :dependencies.runtime once
  ;; M3.1 lands the Cargo.toml [dependencies] emitter).
  :depends-on   [ ]
  :exposes      [ :rust-crate ]
  :publish-to-git true

  ;; Per the user directive: nix modules + deps sync + flake.nix
  ;; all auto-generated. Defaults already match these values.
  :nix-modules        true
  :deps-transitive    true
  :deps-sync-target   "both"

  ;; Best-of-PM fields (parsed today, emitted in M3.1+)
  :dependencies { :runtime  [ { :name "clap"        :version "4" :features [ "derive" ] }
                              { :name "anyhow"      :version "1" }
                              { :name "serde_yaml"  :version "0.9" }
                              { :name "serde"       :version "1" :features [ "derive" ] } ]
                  :dev      [ { :name "tempdir"     :version "0.3" } ] }

  :supports     { :rust ">=1.89.0" }

  :artifacts    { :bin [ { :name "pleme-doc-gen" :path "src/main.rs" } ] }

  :publish      { :private false
                  :registry-token-env "CARGO_REGISTRY_TOKEN" } )
