compat

Compare two schema versions and detect breaking changes.

Usage

vexilc compat <old.vexil> <new.vexil> [--format <human|json>]

Options

OptionDefaultDescription
--format <format>humanOutput format: human or json

Example

$ vexilc compat v1/sensor.vexil v2/sensor.vexil
  ✓ field "flags" added at @2           compatible (minor)
  ✗ field "timeout" type u32 → u64      BREAKING (major)

Result: BREAKING — requires major version bump

JSON output

$ vexilc compat v1.vexil v2.vexil --format json
{
  "changes": [
    {
      "kind": "field_added",
      "declaration": "SensorReading",
      "field": "flags",
      "detail": "field \"flags\" added at @2",
      "classification": "minor"
    }
  ],
  "result": "compatible",
  "suggested_bump": "minor"
}

Exit codes

CodeMeaning
0Compatible changes only
1Breaking changes detected
2Schema compilation error

Detected changes

The compat checker detects field additions, removals, type changes, ordinal changes, renames, deprecations, encoding changes, variant additions/removals, declaration additions/removals, namespace changes, and flags bit changes.