Tools and Configuration

Configuration

vary.toml

Every Vary project can have a vary.toml file at its root. The compiler searches upward from the current directory to find it. If no config file exists, defaults are used for everything.

Create one with:

vary init

Or view the active configuration with:

vary config --verbose

Minimal example

Most projects only need a few lines:

[project]
name = "my-app"
version = "0.1.0"

[source]
directories = ["src"]
test_directories = ["tests"]

Full reference

[project]

Project metadata. Used in build output and artifact naming.

FieldTypeDefaultDescription
nameStr"unnamed"Project name
versionStr"0.1.0"Version string (available as __project_version__ in code)
descriptionStr""Short description

[source]

Where the compiler looks for .vary files.

FieldTypeDefaultDescription
directoriesArray["src"]Source code directories
test_directoriesArray["tests"]Test file directories
excludesArray[]Patterns to skip during compilation

roots is accepted as an alias for directories.

[compiler]

Controls how code is compiled.

FieldTypeDefaultDescription
targetStr"17"JVM target version (e.g. "17", "21")
stdlibStrnullCustom path to stdlib (rarely needed)
output_dirStr"build"Where compiled output goes
warnings_as_errorsBoolfalseTreat warnings as errors
verboseBoolfalseVerbose compiler output
optimizationInt0Optimization level: 0 = none, 1 = basic, 2 = aggressive
debug_infoBooltrueInclude debug info in bytecode
strict_null_checksBooltrueEnforce null safety

[test]

Test execution settings.

FieldTypeDefaultDescription
parallelInt1Number of parallel test runners
coverageBoolfalseEnable coverage tracking
coverage_thresholdInt0Minimum coverage percentage (0 = no gate)
timeoutInt300Test timeout in seconds

[mutation]

Mutation testing settings used by vary mutate.

FieldTypeDefaultDescription
operatorsStr"all"Which mutation operators to apply, comma-separated or "all"
quick_limitInt20Maximum mutants in --quick mode
timeoutInt5000Per-mutant timeout in milliseconds
report_formatStr"text"Output format: "text", "html", or "json"
report_dirStr"mutation-reports"Where reports are written
min_scoreFloat0.0Minimum mutation score (0-100), fails the run if not met
fail_on_decreaseBoolfalseFail if mutation score dropped since last run
max_survivorsIntunlimitedMaximum allowed surviving mutants
pairing_modeStr"fallback_all_tests"How mutants are paired with tests: "fallback_all_tests" or "strict"
emit_manifestBooltrueEmit mutation manifest (.vary/mutation-manifest.json) during builds
max_pure_survivorsIntunlimitedMaximum surviving mutants in pure def regions
require_contracts_in_pureBoolfalseRequire contracts on pure functions touched by mutants
min_contract_killsInt0Minimum contract kills (PRE+POST+INVARIANT) required
min_contract_adequacyFloat0.0Minimum contract adequacy score (0-100)
allow_no_oracle_testsBoolfalseAllow tests without oracles (otherwise warned/errored)
min_integrityFloat0.0Minimum integrity score gate (0-100)

[validate]

Settings for vary validate.

FieldTypeDefaultDescription
contractsBoolfalseEnable structured contract violation reporting in test output

When contracts is true, contract violations detected during test execution are reported in a structured block showing the violation kind, function name, source location, and failing expression.

[format]

The formatter has no settings. Every Vary file is formatted the same way: four spaces, sorted imports, no line-length wrapping options. A [format] section in vary.toml is read and ignored, and vary fmt prints one warning per key so a leftover setting is not mistaken for a working one.

[var]

What vary var requires before it calls a change complete. Every changed file must pass vary fmt --check; that requirement has no switch.

FieldTypeDefaultDescription
require_testsBooltrueEvery changed function is named by at least one test
require_contracts_resolvedBooltrueEvery changed function with a contract is proven, or unknown with a stated reason

[cache]

Controls the content-addressed artifact cache in .vary/artifacts/.

FieldTypeDefaultDescription
enabledBooltrueEnable caching
directoryStr".vary/artifacts"Cache directory path
max_size_mbInt500Maximum cache size in MB
max_age_daysInt30Evict artifacts older than this
eviction_policyStr"lru""lru" (least recently used), "lfu" (least frequently used), or "none"
auto_gcBooltrueRun garbage collection automatically
validate_on_loadBooltrueValidate artifacts before using them

[check]

Settings for vary check diagnostics.

FieldTypeDefaultDescription
profileStr"local"Check profile: "local" (default) or "ci" (JSON output, warnings as errors)
warningsStr"all"Warning mode: "all", "none", or "error"

[check.analysis]

FieldTypeDefaultDescription
broad_effects_thresholdInt3Warn if a function produces more than this many distinct effect classes
max_file_linesInt300Warn when a normal .vary source file exceeds this many lines; set 0 to disable
max_test_file_linesInt500Warn when a test .vary file exceeds this many lines; set 0 to disable

[check.effects]

FieldTypeDefaultDescription
denyArray[]Effect classes to forbid (e.g. ["PROCESS", "NETWORK"]). Functions producing denied effects are flagged as errors.

Available effect classes: IO, NETWORK, FILESYSTEM, PROCESS, STATE, CONCURRENCY, TIME, RANDOM.

[lsp]

Language server configuration.

FieldTypeDefaultDescription
enabledBooltrueEnable the LSP server
portInt0TCP port (0 = use stdio mode)
log_fileStrnullOptional path for LSP logs

[services]

Network host restrictions for service declarations (typed HTTP clients).

FieldTypeDefaultDescription
allowed_hostsArray[]Hosts the project may connect to (empty = all allowed)
denied_hostsArray[]Hosts explicitly blocked

Host patterns support wildcard subdomains: *.example.com matches api.example.com and foo.bar.example.com.

[services]
allowed_hosts = ["api.example.com", "*.internal.example.com"]
denied_hosts = ["untrusted.com"]

When allowed_hosts is non-empty, any service targeting a host not in the list is flagged by VCS008. Hosts in denied_hosts are always blocked.

[profiles.*]

Custom validation profiles for vary validate --profile <name>. Each profile defines which checks to run and their thresholds.

FieldTypeDefaultDescription
checksArray[]Stages to run (e.g., "check", "test", "mutation")
timeoutInt300Timeout in seconds

Thresholds are nested under [profiles.<name>.thresholds]:

[profiles.local]
checks = ["check", "test"]

[profiles.local.thresholds]
coverage = 70

[profiles.ci]
checks = ["check", "test", "mutation"]

[profiles.ci.thresholds]
coverage = 80
mutation = 80

[profiles.nightly]
checks = ["check", "test", "mutation"]
timeout = 600

[profiles.nightly.thresholds]
coverage = 90
mutation = 90

[dependencies]

Dependency declarations are parsed as configuration metadata. They do not download packages, select library versions, or add import search paths. There is no registry dependency resolver. The accepted declaration format is:

[dependencies]
my-lib = "1.0.0"
local-lib = { version = "2.0.0", path = "./libs/local-lib" }

The path value records a local project location; it does not make that project's modules importable. For ordinary local code, add its source directory to [source].directories, relative to the consuming vary.toml:

[source]
directories = ["src", "../shared-types/src"]

Bundled libraries use the catalog shipped beside the compiler and require neither dependency declarations nor additional source roots. Their versions follow the CLI release. VARY_STDLIB changes stdlib discovery only, not the bundled catalog.

Bigger example

A project that gates on mutation score and runs tests in parallel:

[project]
name = "my-api"
version = "0.2.0"
description = "Order management API"

[source]
directories = ["src"]
test_directories = ["tests"]
excludes = ["src/scratch"]

[compiler]
target = "21"
warnings_as_errors = true
optimization = 1

[test]
parallel = 4
timeout = 60

[mutation]
min_score = 75.0
fail_on_decrease = true
max_survivors = 10
timeout = 3000

[validate]
contracts = true

[cache]
max_size_mb = 200
max_age_days = 7
← CLI reference
Project layout →