> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streambuild.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# stb audit

> Run data-quality audits against live or staged relations.

Run authored SQL audits against current relations:

```bash theme={null}
stb audit
stb audit --select order_items
stb audit --select +daily_revenue
stb audit --select pipeline:order_events --json
```

Live audit works in both modes. Error-severity failures exit 1; warning failures are reported but do
not fail the command.

Selectors support bare model names, `pipeline:<name>`, and optional leading `+` for upstream
models. Multiple selectors are repeatable. Trailing `+` is not accepted by audit selection.

## `stb audit backfill`

Assess a staged virtual-environment deployment:

```bash theme={null}
stb audit backfill
DEPLOYMENT_ID="replace-with-deployment-id"
stb audit backfill --deployment-id "$DEPLOYMENT_ID"
stb audit backfill --deployment-id "$DEPLOYMENT_ID" --json
```

This combines staged-versus-active comparison, replay readiness, and applicable SQL audits. It does
not accept `--select`. Warning-severity audit failures are reported but do not by themselves change
the replay-readiness assessment.

If the ID is omitted, one candidate is selected automatically. Zero or multiple candidates return
an actionable error. A successful assessment command exits 0 even when the reported assessment is
`not_ready`.

<Warning>
  Audit readiness is not an enforced publish prerequisite. Treat `not_ready` as an operator stop
  signal.
</Warning>
