# `Nous.Eval.Guard.Registry`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/nous/eval/guard/registry.ex#L1)

The compiled-in registry of guard datasets `mix nous.eval.datasets.fetch`
may download: per source, the files pinned to an upstream commit with
their sha256, the licence and its status, and the adapter that turns an
upstream row into a `nous.guard_case/1` case.

| Status | Meaning |
|---|---|
| `:allowed` | permissive licence (MIT, Apache-2.0, CC-BY-4.0, ...) |
| `:terms` | redistributable but use-restricted: fetched only with `--accept-terms <id>`, recorded in the manifest, never committed |
| `:denied` | non-commercial, copyleft, no licence or private: never fetched |

Licences were read from the HF Hub API (`cardData.license`) and the GitHub
licence API at the pinned revisions (2026-11-01). Checksums are of the
exact files at those revisions; a download that does not match is
refused before it is parsed.

The `nous_builtin` source is Nous's own guard dataset
(`test/fixtures/guard/*.jsonl` in the repository) at the GitHub tag of
this release, `v0.21.1`: the Hex package does
not ship it.

# `file`

```elixir
@type file() :: %{
  name: String.t(),
  url: String.t(),
  sha256: String.t(),
  format: :csv | :json | :jsonl | :parquet | :guard_jsonl,
  split: String.t() | nil,
  max_bytes: pos_integer()
}
```

# `source`

```elixir
@type source() :: %{
  id: String.t(),
  title: String.t(),
  homepage: String.t(),
  license: String.t(),
  license_url: String.t() | nil,
  status: :allowed | :terms | :denied,
  reason: String.t() | nil,
  revision: String.t() | nil,
  gated: boolean(),
  public: boolean(),
  surfaces: [Nous.Eval.Guard.Case.surface()],
  attribution: String.t(),
  files: [file()],
  adapter: (file(), map(), non_neg_integer() -&gt; {:ok, map()} | :skip) | nil
}
```

# `fetch`

```elixir
@spec fetch(String.t(), [source()]) :: {:ok, source()} | {:error, String.t()}
```

The source registered as `id` (`"name"` or `"name@revision"`; only the
pinned revision can be fetched, because only its checksums are known), in
`sources` (default `sources/0`).

# `sources`

```elixir
@spec sources() :: [source()]
```

Every registered source.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
