Skip to main content

Drift Budgets Explained

Learn what a drift budget is, how the --drift-budget flag turns DriftScore into a pass/fail gate, and how it complements baselines and worsening checks.

Vibgrate Docs

Vibgrate Help

This article explains drift budgets: a simple, absolute threshold that turns the DriftScore into an enforceable gate. It is for teams setting standards in CI and for leads who want a single number to govern by.

Overview

The DriftScore (DriftScore) runs from 0 to 100, where lower means less drift. A drift budget is the maximum DriftScore you are willing to accept. When a scan exceeds the budget, the run can fail, which makes the budget a clear, objective quality gate.

Setting a budget

Apply a budget on a scan with the --drift-budget flag:

vg scan --drift-budget 60

Here, a DriftScore at or under 60 is acceptable and a higher score signals the project has drifted beyond your tolerance.

Budgets vs. baselines

  • A drift budget is an absolute ceiling on the DriftScore. It answers "how much total drift is allowed?"
  • A baseline measures change from a snapshot. It answers "did this change make things worse?"

The two work well together: use a budget to cap total drift and a baseline with worsening checks to stop new regressions. For the relative approach, see:

vg scan --baseline .vibgrate/baseline.json --drift-worsening

Choosing a budget

Start with a budget near your current DriftScore so the build passes today, then tighten it over time as you reduce drift. A budget you can never meet gets ignored; a budget just below today's score creates steady, achievable pressure.

Related

See the DriftScore explainer for how the score is calculated, the baseline guides for relative gating, and the exit codes reference for wiring budgets into CI.

Related Commands