Skip to main content
Commands

vg baseline

Create drift baseline snapshots for delta comparison and fitness functions.

Usage

vg baseline [path]

What It Does

vg baseline runs a full scan and saves the result to .vibgrate/baseline.json. This snapshot becomes your reference point for measuring drift over time.

Why Baselines Matter

Without a baseline, every scan is a standalone snapshot. With a baseline:

  • CI can detect regression — fail if drift worsens beyond threshold
  • Teams can track improvement — compare each sprint's score to baseline
  • Fitness functions work--drift-budget and --drift-worsening require a baseline

Recommended Workflow

Step 1: Create Baseline on Main Branch

vg baseline

Commit .vibgrate/baseline.json to version control.

Step 2: Use in CI

vg scan \
  --baseline .vibgrate/baseline.json \
  --drift-budget 40 \
  --drift-worsening 5 \
  --fail-on error

Step 3: Refresh After Upgrades

vg baseline
git add .vibgrate/baseline.json
git commit -m 'chore: refresh drift baseline after upgrades'

Baseline vs Scan Artifact

FilePurposeCommit?
.vibgrate/baseline.jsonReference for drift comparison✅ Yes
.vibgrate/scan_result.jsonLatest scan output❌ No (.gitignore)

Best Practices

  • Create baseline on default branch before enabling CI gates
  • Refresh periodically (quarterly, or after upgrade sprints)
  • Store in version control so all branches compare the same reference

Example use cases

Expand any use case to watch a live replay of the real @vibgrate/cli running against one of our test repositories. Nothing executes in your browser — these are recordings of actual runs, with the scan time shown as of now.

vg baseline
# a dependency is downgraded — drift creeps in
vg scan --baseline .vibgrate/baseline.json

Related Documentation

Related Help Articles