> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://onepin.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://onepin.ai/docs/_mcp/server.

# Validators

> How Onepin validators work — the pass and fail outputs, wiring pass to Export and fail back to the Generator, what retry and threshold mean, and chaining vs parallel checks.

**Family: Validator**

A validator scores each generated line and routes it. Add one when "it produced audio" isn't enough — when the audio must clear a bar before it ships. Onepin has four, and they all work the same way; this page covers the shared behavior, then each has its own page:

* [Accuracy validator](/docs/workflow/accuracy-validator) — did the audio say the words?
* [Naturalness validator](/docs/workflow/naturalness-validator) — does it sound human?
* [Noise validator](/docs/workflow/noise-validator) — is it clean?
* [Pronunciation validator](/docs/workflow/pronunciation-validator) — was each word pronounced correctly, sound by sound? *(English only, beta)*

## Two outputs: pass and fail

Every validator has two output ports:

* **`pass`** — the line cleared the bar. Wire it onward; its path must reach [Export](/docs/workflow/export).
* **`fail`** — the line didn't. Wire it back to the [Generator](/docs/workflow/generator) to regenerate the line, or leave it unwired to drop failing lines instead of retrying.

```
        ┌───────────────── fail ─────────────────┐
        ▼                                         │
   Generator ──▶ Validator ──▶ pass ──▶ Export
```

> **Note**
>
> `pass` and `fail` can't feed the same downstream port — that would erase the distinction. And a `pass` output must reach Export, or lines that cleared the check would be silently dropped.

The [Pronunciation validator](/docs/workflow/pronunciation-validator) has two extra legal targets on top of these: either port may also feed a [Phoneme Injector](/docs/workflow/phoneme-injector) or a [Pronunciation Corrector](/docs/workflow/pronunciation-corrector), as long as those lines still reach Export.

## Threshold and retry

**Threshold** is the score a line must reach to pass. Raise it for a stricter bar, lower it to let more through.

**Retry** is what happens on a fail. `max_retries` is how many times a failing line is regenerated — each retry re-runs the Generator for that line, then re-scores it. When the budget runs out and the line still hasn't cleared the bar, it leaves through `pass` anyway. You get the best attempt made, and a run never stalls on one stubborn line.

Both are set in the node's config:

```python
node["config"] = {"threshold": 90.0, "max_retries": 3}
```

## Chaining and parallel checks

Wire validators in a row (Accuracy, then Naturalness, then Noise) or run them side by side off one Generator. Either way, a line is delivered only once **every** validator on its path has passed it, and each validator keeps its own retry budget.

One ordering rule: put the [Pronunciation validator](/docs/workflow/pronunciation-validator) **last** in a branch. It is the heaviest check, so it should only grade lines the cheaper ones already passed.

## What you'll see after a run

Each line shows its score from every validator and how many retries it took to clear the bar — so you can see exactly which lines were regenerated and why.

## Related

* [General rules](/docs/workflow/general-rules) — validator wiring rules
* [Generator](/docs/workflow/generator) — the retry target
* [Export](/docs/workflow/export) — where passing lines land
* [Fix pronunciations](/docs/guides/fix-pronunciations) — the pronunciation chain end to end