Usage
vibgrate baseline [path]
What It Does
vibgrate baseline runs a full scan and saves the result to .vibgrate/baseline.json. This snapshot becomes your reference point for measuring whether drift is improving or worsening over time.
Why Baselines Matter
Without a baseline, every scan is a standalone snapshot — you know your score, but you cannot tell whether things are getting better or worse. With a baseline:
- CI can detect regression — if drift worsens beyond a threshold, the pipeline fails
- Teams can track improvement — each sprint's score can be compared to the starting point
- Fitness functions become possible —
--drift-budgetand--drift-worseningrequire a baseline to work
Recommended Workflow
Step 1: Create baseline on main branch
vibgrate baseline .
This writes .vibgrate/baseline.json. Commit it to version control.
Step 2: Use baseline in CI
vibgrate scan . \
--baseline .vibgrate/baseline.json \
--drift-budget 40 \
--drift-worsening 5 \
--fail-on error
Step 3: Refresh after planned upgrades
When your team completes a round of dependency upgrades, refresh the baseline:
vibgrate baseline .
git add .vibgrate/baseline.json
git commit -m 'chore: refresh drift baseline after Q1 upgrades'
Baseline vs Scan Artifact
| File | Purpose | Committed? |
|---|---|---|
.vibgrate/baseline.json | Reference point for drift comparison | Yes |
.vibgrate/scan_result.json | Latest scan output | No (add to .gitignore) |
Best Practices
- Always create your first baseline on the default branch before enabling CI gates
- Refresh the baseline periodically (e.g. quarterly, or after each upgrade sprint)
- Never delete the baseline without replacing it — CI gates that reference a missing baseline will behave unpredictably
- Store the baseline in version control so all branches can compare against the same reference