Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.

Quick reference

Daily command sequences for Vary development.

The inner loop

The local development cycle:

check → test → fix → mutate (optional)
StepCommandWhat to look for
Checkvary check src/Type errors, lint warnings, effect violations
Testvary test tests/Failing observe assertions
Fixvary check src/ --fixAuto-applied fixes (review the diff)
Mutatevary mutate src/ --tests tests/Surviving mutants, gaps in test coverage

Run check and test after every edit. Run mutate before opening a PR or when strengthening tests.


Flow: I edited one file

You changed src/store.vary and want to know if it's correct.

# 1. Type-check and lint
vary check src/store.vary

# 2. Run related tests
vary test tests/store_test.vary

# 3. If check offered auto-fixes
vary check src/store.vary --fix

Zero exit code from check and test means you're good. Check warnings (VCS/VCA codes) are advisory: read them, fix what matters. Test failures print the failing observe expression and expected vs actual values.


Flow: I'm about to PR

Everything should be clean before you push.

# 1. Run the local profile (analyze + static + tests)
vary validate src/ --profile local

# 2. Run mutation testing to find weak spots
vary validate src/ --profile ci
ProfileStagesWhen to use
localanalyze, static, testsEvery PR, fast
cianalyze, static, tests, mutationPR gate, thorough

validate exits non-zero if any stage fails. Mutation score below threshold means tests don't catch enough: add assertions for surviving mutants. Use vary mutate src/ --why to understand why specific mutants survived.


Flow: nightly failed

The nightly CI runs the full verification suite including VAST oracle checks.

# 1. Reproduce locally with the nightly profile
vary validate src/ --profile nightly

# 2. If mutation stage failed, inspect survivors
vary mutate src/ --top 10
vary mutate src/ --why

# 3. If oracle stage failed, check VAST output
vary validate src/ --profile oracle
ProfileStagesWhen to use
nightlyanalyze, static, tests, mutation, oracleScheduled deep run
oracleanalyze, static, oracleDebugging oracle failures

Nightly failures are usually surviving mutants or VAST oracle mismatches. --top N shows the N most impactful surviving mutants. --group clusters survivors by module and category for systematic fixing. Oracle failures mean generated test scenarios found unexpected behaviour: read the diff.


Verification profiles

Profiles bundle stages so you don't have to remember flags:

vary validate src/ --profile <name>
ProfileStagesTypical context
fastanalyze, static, testsQuick local check
localanalyze, static, testsAlias for fast
cianalyze, static, tests, mutationPR gate
nightlyanalyze, static, tests, mutation, oracleScheduled deep run
mutationanalyze, static, mutationTargeted mutation run
mutation-strictanalyze, static, mutation (strict)Hardening tests

Custom profiles go in vary.toml:

[profiles.myteam]
checks = ["check", "test", "mutate"]

[profiles.myteam.thresholds]
mutation_score = 85

Command cheat sheet

TaskCommand
Type-check one filevary check src/foo.vary
Type-check everythingvary check src/
Auto-fix lint issuesvary check src/ --fix
Run all testsvary test tests/
Run one test filevary test tests/foo_test.vary
Mutation testvary mutate src/ --tests tests/
Show why mutants survivedvary mutate src/ --why
Top surviving mutantsvary mutate src/ --top 10
Full local validationvary validate src/ --profile local
PR validationvary validate src/ --profile ci
Nightly validationvary validate src/ --profile nightly
Generate service client stubvary client src/server.vary
Scaffold serious projectvary new myapp --template serious
Format sourcevary format src/