Skip to content

diff

Compare legacy and modern system behavior to verify parity.

Terminal window
npx modernizespec diff [options]
  1. Reads parity-tests.json for baseline locations and test suites
  2. Runs the specified test commands for each context
  3. Compares outputs against legacy baselines
  4. Reports deviations with field-level detail
FlagDescriptionDefault
--dir <path>Project directoryCurrent directory
--context <name>Compare a specific context onlyAll contexts
--tolerance <n>Numeric precision tolerance0.001
--jsonOutput diff as JSONHuman-readable
--baseline <path>Override baseline directoryFrom parity-tests.json
Terminal window
npx modernizespec diff
Terminal window
npx modernizespec diff --context Accounts
Terminal window
npx modernizespec diff --tolerance 0.01
Parity Diff — Accounts
Baseline: legacy-snapshots/accounts/
Tests: 72 total
✓ 68 tests match baseline
✗ 4 tests deviate
Deviations:
tax_inclusive_rounding:
Legacy: 1,847.46
Modern: 1,847.47
Delta: +0.01 (precision difference)
advance_payment_allocation:
Legacy: allocated_amount = 5,000.00
Modern: allocated_amount = 4,999.99
Delta: -0.01 (rounding order difference)
Summary: 94.4% parity (threshold: 95.0%)
Status: ⚠ Below threshold — review deviations
CodeMeaning
0Parity meets or exceeds threshold
1Parity below threshold
2Baseline or spec files not found