Validate in PR
A focused guide for enforcing preset AI checks in pull requests.
Objective
Catch design-system drift and policy violations before merge.
Baseline checks
Run at least one of:
- drift detection:
preset drift - copy and policy checks:
preset audit-copy(where applicable) - scan and proposal reporting:
preset scan(for discovery workflows)
Recommended PR workflow
- Run checks on every pull request
- Emit machine-readable output (
jsonand/orsarif) - Surface findings directly in the PR
- Block merge on configured severity thresholds
Example command set
preset drift src --strict --format sarif --output drift.sarif
preset drift src --format json --output drift.json
Optional:
preset audit-copy src --strict --format sarif --output copy.sarif
GitHub-oriented implementation
Use either:
- the preset AI GitHub Action (see CI integration)
- direct CLI commands in workflow steps
Minimum expectations:
- PR comment or annotations with violations
- upload SARIF when available
- clear pass/fail signal for branch protection
Suggested policy thresholds
- Enforce mode repos: fail on any high-severity violation
- Assist / Guard repos: fail on critical, warn on medium/low
- Legacy repos: warn-only initial rollout, then tighten
Rollout strategy
- Observe: report only
- Assist: warn + remediation guidance
- Enforce: block merge for policy-breaking drift
Outputs to keep
Store artifacts for traceability:
- SARIF report
- JSON report
- summary metrics (drift score trend, violations by category)
For the full GitHub Action / CLI / SARIF reference, see CI integration.
Last reviewed by @jschuyler