{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://mutato.dev/schema/v1/config.json",
  "title": "mutato config (.mutato/config.json)",
  "description": "Read by `mutato`; any CLI flag overrides the matching key. Keys mirror the CLI flag names. Relative paths resolve against the folder holding .mutato/.",
  "allowComments": true,
  "allowTrailingCommas": true,
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": {
      "type": "string",
      "description": "This file's JSON Schema, for editor completion and validation."
    },
    "project": {
      "description": "Project to mutate (the code under test), or several, scored in one run: each test project tests every one of them it references, directly or through another project. Auto-discovered if omitted; given without tests-project, its test projects are found (those named for one of them, or referencing one directly) in the git checkout of the first project listed, or the working directory outside git; list tests-project for one that lives elsewhere.",
      "anyOf": [
        { "type": "string" },
        { "type": "array", "items": { "type": "string" }, "minItems": 1 }
      ]
    },
    "tests-project": {
      "description": "Test project to build and run against the mutated targets it references, or several: each is scored in turn, in this order, and a mutant one kills is not run by the next.",
      "anyOf": [
        { "type": "string" },
        { "type": "array", "items": { "type": "string" }, "minItems": 1 }
      ]
    },
    "tests": {
      "type": "string",
      "description": "Prebuilt test assembly (.dll) that exercises the target; skips the test build."
    },
    "filter": {
      "type": "string",
      "description": "Restrict mutation to this type / namespace prefix."
    },
    "files": {
      "type": "string",
      "description": "Restrict mutation to source files matching these globs (comma-separated, e.g. \"Window*.cs,**/Retry/*.cs\")."
    },
    "since": {
      "type": "string",
      "description": "Only mutate code changed since this git ref (merge-base semantics, uncommitted changes included)."
    },
    "test-class": {
      "type": "string",
      "description": "Run only the tests in these classes (comma-separated; default: all). A full name (\"MyLib.Tests.ParserTests\") or a bare one (\"ParserTests\"); * matches anything (\"MyLib.Tests.*\")."
    },
    "exclude-test-class": {
      "type": "string",
      "description": "Never run the tests in these classes (comma-separated; same patterns as test-class, e.g. \"*EndToEnd*\"), so they never decide a verdict. Wins over test-class."
    },
    "host": {
      "type": "string",
      "description": "Warm-host flavour. Default (or \"auto\"): auto-detect.",
      "enum": ["auto", "xunit", "mtp", "mtp-isolated", "mtp-inproc", "tunit-direct", "tunit-runner", "vstest"]
    },
    "tf": {
      "type": "string",
      "description": "Target framework to build (default: auto-detect, matched to the test assembly's runtime)."
    },
    "configuration": {
      "type": "string",
      "description": "MSBuild configuration to build and mutate (default: Debug). Use the one your CI tests."
    },
    "workers": {
      "type": "integer",
      "minimum": 1,
      "description": "Parallel warm workers (default: CPUs-1)."
    },
    "timeout": {
      "type": "integer",
      "minimum": 1,
      "description": "Per-mutant budget ceiling in seconds (default: 10)."
    },
    "audit": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "Isolation audit: re-decide this percent of the warm mutants in a second pass to detect state leaking between mutants (0 = off)."
    },
    "recheck": {
      "type": "boolean",
      "description": "Run the unmutated suite twice at baseline: idempotence check, and cold runs for first-touch-only mutants."
    },
    "numeric-literals": {
      "type": "boolean",
      "description": "Also mutate numeric literals (noisy; off by default)."
    },
    "data-detail": {
      "type": "boolean",
      "description": "Mutate every entry of large static data tables as a separate 'data coverage' bucket (excluded from the score)."
    },
    "collection-literals": {
      "type": "boolean",
      "description": "F#: also remove one element at a time from small collection literals. Off by default."
    },
    "pattern-constants": {
      "type": "boolean",
      "description": "F# and C#: also mutate char/string constants in patterns (match arms, is-patterns, switch arms, case labels). Off by default."
    },
    "force-conditionals": {
      "type": "boolean",
      "description": "Also force conditions to true and to false (F#: if-conditions; C#: if, ternary and loop conditions; a C# ternary over a bare bool is forced by default). Off by default."
    },
    "option-defaults": {
      "type": "boolean",
      "description": "F#: also neutralize option fallbacks (Option.defaultValue d x -> d). Off by default."
    },
    "blank-predicates": {
      "type": "boolean",
      "description": "F#: also swap String.IsNullOrEmpty with String.IsNullOrWhiteSpace. Off by default."
    },
    "guard-removal": {
      "type": "boolean",
      "description": "C#: also delete guard clauses (an else-less if whose body is a throw or return). Off by default."
    },
    "assignment-removal": {
      "type": "boolean",
      "description": "C#: also delete simple assignment statements. Off by default."
    },
    "call-removal": {
      "type": "boolean",
      "description": "C#: also delete call statements whose result is discarded (list.Remove(x); sb.Append(y);). Off by default."
    },
    "linq-unwrap": {
      "type": "boolean",
      "description": "C#: also unwrap Enumerable.Where / Distinct / Reverse to their receiver (xs.Where(p) -> xs). Off by default: survivors run at three times the shipped rate, mostly filters no test can observe."
    },
    "math-methods": {
      "type": "boolean",
      "description": "C#: also swap Math.Min/Max, Floor/Ceiling and Round/Truncate. Off by default (noise floor, #419)."
    },
    "date-time-units": {
      "type": "boolean",
      "description": "C#: also swap DateTime/DateTimeOffset adder units (AddDays/AddHours, ...) and TimeSpan factory units (FromSeconds/FromMinutes, ...). Off by default (noise floor, #420)."
    },
    "numeric-unary": {
      "type": "boolean",
      "description": "C#: also flip a numeric sign (-x <-> +x) and drop a bitwise complement (~x -> x). Off by default: on the corpus it only ever flipped -1 sentinels."
    },
    "for-increments": {
      "type": "boolean",
      "description": "C#: also swap ++ and -- in a for loop's incrementor (i++ -> i--). Off by default: its kills are index faults and loop-budget trips, which say the loop ran and little more (#527). ++ and -- everywhere else are mutated by default."
    },
    "ignore-methods": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Calls that get no mutants, as Stryker.NET ignore-methods globs: '*' matches within one dotted segment, a constructor is 'Type.ctor' (e.g. '*Exception.ctor', 'MyLib.*.Throw*'). Nothing inside a matched call is mutated, and removing it is not a mutant. C# only."
    },
    "include-generated": {
      "type": "boolean",
      "description": "Also mutate generated files (.g.cs, .designer.cs, <auto-generated> headers). Skipped by default."
    },
    "shared-output": {
      "type": "boolean",
      "description": "Build mutants into the project's normal obj/bin. Legacy escape hatch: leaves mutated assemblies in your real build output."
    },
    "json": {
      "type": "string",
      "description": "Write a Stryker-schema mutation report to this file."
    },
    "html": {
      "type": "string",
      "description": "Write the self-contained HTML report to this file (default: .mutato/reports/mutation-report.html)."
    },
    "reuse": {
      "type": "boolean",
      "description": "Take steady verdicts (survivors, kills by the same test two runs running, hangs three runs running, or two when each ran five times its tests' own time or more or crashed the test process) from the run history instead of re-running them, when their source lines, the names of their covering tests, mutato's version and the host are all unchanged and the verdict has never flipped (default: true). `--no-reuse` re-scores them for one run."
    },
    "await-guard": {
      "type": "boolean",
      "description": "C#: route the target's waits on a task (await, .Wait(), .Result, .GetAwaiter().GetResult()) through mutato's deadline guard, so a mutant that leaves a task forever incomplete is unwound in-process when its time runs out instead of the worker being killed and respawned (default: true). It adds no mutant. `--no-await-guard` turns it off for one run."
    },
    "precompile": {
      "type": "boolean",
      "description": "Precompile the suite's assemblies to native code (ReadyToRun) after the build, so the run's test processes don't each JIT-compile the same code (default: true). crossgen2 is downloaded once through your NuGet sources; images are cached across runs in mutato's cache; Debug builds are left to the JIT. `--no-precompile` turns it off for one run."
    },
    "optimize": {
      "type": "boolean",
      "description": "C#: compile the projects under mutation with optimizations (/optimize+), keeping the configuration's defines (DEBUG, so Debug.Assert still runs) and building the test projects as usual (default: true). Instrumented Debug code runs several times slower, and its larger stack frames can overflow deep-recursion tests that pass in your own build. Verdicts are kept separately in the run history for each setting. `--no-optimize` turns it off for one run."
    },
    "history": {
      "type": "string",
      "description": "The run history file: each mutant's last verdict and the test that killed it, read so a known killer runs first and merged back when the run ends. Default: in the user's cache, shared by every worktree of the clone (`MUTATO_CACHE_DIR` moves the cache). Relative to the folder holding `.mutato/`. `--no-history` turns it off for one run."
    },
    "thresholds": {
      "type": "object",
      "description": "Score thresholds. Both colour the score in the run summary; `break` also gates the exit code.",
      "additionalProperties": false,
      "properties": {
        "high": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Score at or above this is shown as good."
        },
        "break": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Score below this is shown as failing and makes the run exit 2 (the CI gate). --threshold-break overrides it."
        },
        "basis": {
          "type": "string",
          "enum": ["covered", "all"],
          "default": "covered",
          "description": "The score high and break compare against. covered leaves out mutants no test reaches; all counts them as survived, as Stryker's score does (init --from-stryker sets it). --threshold-basis overrides it."
        }
      }
    }
  }
}
