CI/CD

Use the Retrace CLI as a quality gate in your pipeline, including offline cassette replay.

The CLI is designed for automation. Two patterns make it a natural fit for CI: the evaluation gate and offline cassette replay.

Evaluation gate

The gate exits non-zero when a trace's score drops below your threshold, failing the job:

retrace eval gate --evaluation $EVAL_ID --trace $TRACE_ID --threshold 0.8

GitHub Actions

- name: Quality gate
  run: retrace eval gate --evaluation $EVAL_ID --trace $TRACE_ID --threshold 0.8
  env:
    RETRACE_API_KEY: ${{ secrets.RETRACE_API_KEY }}

Set RETRACE_API_KEY as a repository secret; the CLI reads it automatically (see Authentication).

Offline regression replay

Diff a candidate run against a golden cassette entirely offline, with per-step tolerance — no live model calls:

retrace ci replay --golden golden.json --candidate run.json

This is ideal as a fast, deterministic regression check on every pull request.

Next steps

  • Evaluations — define what the gate scores.
  • Forks — prove a fix before merging.

On this page