# `Nous.Eval.Optimizer.Lint`
[🔗](https://github.com/nyo16/nous/blob/v0.21.1/lib/nous/eval/optimizer/lint.ex#L1)

Cheap, deterministic checks on a reflector's proposed text, run before a
proposal is evaluated (and spends budget):

  * **Held-out leakage.** A proposal that repeats a run of
    8 consecutive words from a validation or test case (its input or
    any string in its `expected`) is rejected: text memorised from the
    data the candidate is judged on inflates exactly the numbers that
    decide acceptance. Words are compared case-folded with punctuation
    stripped.
  * **Fence markers.** A proposal containing `<<<`, `>>>` or a fence
    boundary (`INPUT_` followed by a 16-character token) is rejected: it
    would carry a fence escape from untrusted trace text into an agent's
    system prompt.

The reflector never receives held-out text, so a leak can only come from
train cases that share it, from the model's own knowledge, or from an
injected trace; whichever it is, the proposal is not used.

# `check`

```elixir
@spec check(%{required(String.t()) =&gt; String.t()}, MapSet.t()) ::
  :ok | {:error, {:heldout_leak | :fence_marker, String.t()}}
```

Checks `updates` (component key => proposed text).

Returns `:ok`, `{:error, {:heldout_leak, key}}` or
`{:error, {:fence_marker, key}}`.

# `heldout_windows`

```elixir
@spec heldout_windows([Nous.Eval.Case.t()]) :: MapSet.t()
```

The held-out word windows to check proposals against, from the cases of
the validation and test splits.

---

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