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
Most projects only need a few lines:
[project]
name = "my-app"
version = "0.1.0"
[source]
directories = ["src"]
test_directories = ["tests"]
Project metadata. Used in build output and artifact naming.
| Field | Type | Default | Description |
|---|---|---|---|
name | Str | "unnamed" | Project name |
version | Str | "0.1.0" | Version string (available as __project_version__ in code) |
description | Str | "" | Short description |
Where the compiler looks for .vary files.
| Field | Type | Default | Description |
|---|---|---|---|
directories | Array | ["src"] | Source code directories |
test_directories | Array | ["tests"] | Test file directories |
excludes | Array | [] | Patterns to skip during compilation |
roots is accepted as an alias for directories.
Controls how code is compiled.
| Field | Type | Default | Description |
|---|---|---|---|
target | Str | "17" | JVM target version (e.g. "17", "21") |
stdlib | Str | null | Custom path to stdlib (rarely needed) |
output_dir | Str | "build" | Where compiled output goes |
warnings_as_errors | Bool | false | Treat warnings as errors |
verbose | Bool | false | Verbose compiler output |
optimization | Int | 0 | Optimization level: 0 = none, 1 = basic, 2 = aggressive |
debug_info | Bool | true | Include debug info in bytecode |
strict_null_checks | Bool | true | Enforce null safety |
Test execution settings.
| Field | Type | Default | Description |
|---|---|---|---|
parallel | Int | 1 | Number of parallel test runners |
coverage | Bool | false | Enable coverage tracking |
coverage_threshold | Int | 0 | Minimum coverage percentage (0 = no gate) |
timeout | Int | 300 | Test timeout in seconds |
Mutation testing settings used by vary mutate.
| Field | Type | Default | Description |
|---|---|---|---|
operators | Str | "all" | Which mutation operators to apply, comma-separated or "all" |
quick_limit | Int | 20 | Maximum mutants in --quick mode |
timeout | Int | 5000 | Per-mutant timeout in milliseconds |
report_format | Str | "text" | Output format: "text", "html", or "json" |
report_dir | Str | "mutation-reports" | Where reports are written |
min_score | Float | 0.0 | Minimum mutation score (0-100), fails the run if not met |
fail_on_decrease | Bool | false | Fail if mutation score dropped since last run |
max_survivors | Int | unlimited | Maximum allowed surviving mutants |
pairing_mode | Str | "fallback_all_tests" | How mutants are paired with tests: "fallback_all_tests" or "strict" |
emit_manifest | Bool | true | Emit mutation manifest (.vary/mutation-manifest.json) during builds |
max_pure_survivors | Int | unlimited | Maximum surviving mutants in pure def regions |
require_contracts_in_pure | Bool | false | Require contracts on pure functions touched by mutants |
min_contract_kills | Int | 0 | Minimum contract kills (PRE+POST+INVARIANT) required |
min_contract_adequacy | Float | 0.0 | Minimum contract adequacy score (0-100) |
allow_no_oracle_tests | Bool | false | Allow tests without oracles (otherwise warned/errored) |
min_integrity | Float | 0.0 | Minimum integrity score gate (0-100) |
Settings for vary validate.
| Field | Type | Default | Description |
|---|---|---|---|
contracts | Bool | false | Enable 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.
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.
What vary var requires before it calls a change complete. Every changed file must pass vary fmt --check; that requirement has no switch.
| Field | Type | Default | Description |
|---|---|---|---|
require_tests | Bool | true | Every changed function is named by at least one test |
require_contracts_resolved | Bool | true | Every changed function with a contract is proven, or unknown with a stated reason |
Controls the content-addressed artifact cache in .vary/artifacts/.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | Bool | true | Enable caching |
directory | Str | ".vary/artifacts" | Cache directory path |
max_size_mb | Int | 500 | Maximum cache size in MB |
max_age_days | Int | 30 | Evict artifacts older than this |
eviction_policy | Str | "lru" | "lru" (least recently used), "lfu" (least frequently used), or "none" |
auto_gc | Bool | true | Run garbage collection automatically |
validate_on_load | Bool | true | Validate artifacts before using them |
Settings for vary check diagnostics.
| Field | Type | Default | Description |
|---|---|---|---|
profile | Str | "local" | Check profile: "local" (default) or "ci" (JSON output, warnings as errors) |
warnings | Str | "all" | Warning mode: "all", "none", or "error" |
| Field | Type | Default | Description |
|---|---|---|---|
broad_effects_threshold | Int | 3 | Warn if a function produces more than this many distinct effect classes |
max_file_lines | Int | 300 | Warn when a normal .vary source file exceeds this many lines; set 0 to disable |
max_test_file_lines | Int | 500 | Warn when a test .vary file exceeds this many lines; set 0 to disable |
| Field | Type | Default | Description |
|---|---|---|---|
deny | Array | [] | 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.
Language server configuration.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | Bool | true | Enable the LSP server |
port | Int | 0 | TCP port (0 = use stdio mode) |
log_file | Str | null | Optional path for LSP logs |
Network host restrictions for service declarations (typed HTTP clients).
| Field | Type | Default | Description |
|---|---|---|---|
allowed_hosts | Array | [] | Hosts the project may connect to (empty = all allowed) |
denied_hosts | Array | [] | 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.
Custom validation profiles for vary validate --profile <name>. Each profile defines which checks to run and their thresholds.
| Field | Type | Default | Description |
|---|---|---|---|
checks | Array | [] | Stages to run (e.g., "check", "test", "mutation") |
timeout | Int | 300 | Timeout 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
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.
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