This article shows how to scan against a stored baseline so you measure change rather than absolute state. It is for developers and CI maintainers building drift gates.
Overview
Once a baseline exists, you can scan against it to see how drift has moved since the snapshot. This turns a single DriftScore into a trend you can act on, and it lets CI fail only when things get worse.
Scan against a stored baseline
Point the scan at your committed baseline file:
vg scan --baseline .vibgrate/baseline.json
The scan reports the current state relative to the baseline, so you can see exactly what changed.
Failing only when drift worsens
For CI, you often want to allow existing drift but block new drift. Combine the baseline with the worsening gate:
vg scan --baseline .vibgrate/baseline.json --drift-worsening
This lets a pull request pass when it holds the line and fail when it regresses against the baseline.
Tips
- Keep the baseline committed so local runs and CI compare against the same reference.
- Pair baseline scans with a clear exit-code policy so your pipeline reacts predictably.
- Refresh the baseline after intentional improvements so the gate keeps protecting your new, better state.
Related
See the baseline creation and refresh guides, the drift budget article for absolute thresholds, and the exit codes reference for wiring results into CI.