# `Dsxir.Demo`

A demo slotted into a predictor by an optimizer.

Wraps a `%Dsxir.Example{}` with a provenance tag. The chat adapter and the
json adapter render `%Dsxir.Demo{}` and `%Dsxir.Example{}` identically; the
tag is preserved across save/load via `Dsxir.Artifact`.

`kind` values:

  * `:labeled` - slotted directly from the trainset, no LM call.
  * `:bootstrapped` - captured from a successful `Dsxir.with_trace/1` round
    run by an optimizer (e.g. `Dsxir.Optimizer.BootstrapFewShot`).

`source` is populated only for `:bootstrapped` demos and carries the round
index plus the trainset example index that produced the captured trace.

# `kind`

```elixir
@type kind() :: :labeled | :bootstrapped
```

# `source`

```elixir
@type source() :: nil | %{round: pos_integer(), example_index: non_neg_integer()}
```

# `t`

```elixir
@type t() :: %Dsxir.Demo{example: Dsxir.Example.t(), kind: kind(), source: source()}
```

# `bootstrapped`

```elixir
@spec bootstrapped(Dsxir.Example.t(), source()) :: t()
```

Wrap `ex` as a bootstrapped demo captured from a successful trace round.
`source` records the round and trainset example that produced it.

# `labeled`

```elixir
@spec labeled(Dsxir.Example.t()) :: t()
```

Wrap `ex` as a labeled demo (provenance: directly from the trainset).

---

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