Skip to content

Files

The files the gate reads and writes. .mutation-gate/ holds local results and proofs; it belongs in .gitignore, and init adds it there. Commit the config and mutation-gate.baseline.json.

PathWhat it isDecided in
mutation-gate.php, .json, .yaml, .yml or .neonThe config0002
mutation-gate.baseline.jsonThe committed floors, in the baseline format. A CI run that finds a tree with no floor prints the baseline it measured, ready to commit0003, 0017
The file staticCheck.config names, or else the analyser’s own: mago.toml, mago.yaml or mago.json; phpstan.neon, phpstan.neon.dist or phpstan.dist.neon; psalm.xml or psalm.xml.distThe static analyser’s config. Every proof key holds the digest of the configuration the analyser resolves from it and of each file that configuration names, such as a baseline, an included config, or a bootstrap, stub or scanned file; where the analyser cannot say its configuration, of the config file alone0020
.mutation-gate/plan.json, .mutation-gate/coverage/map.json.gz, .mutation-gate/results/<id>.jsonThe plan, its coverage and each shard’s result, which plan and a run in one process leave and explain reads as the last run. A shard’s result keeps each kill’s evidence where its runner gives it: how far the mutant’s own run went, and how a process that names no killer ended, with what it printed only where that holds no secret; it judges nothing0006, 0014
.mutation-gate/results/<id>.ended.jsonHow the CI job of a shard that left no result ended, which the reusable workflow’s verdict job writes from the run’s jobs and their logs: how, one of shutdown (its runner received a shutdown signal), lost (its runner lost contact with GitHub), cancelled, timed-out or failed; job, the job’s address; and after, for a cancelled job, the shard whose failure cancelled it under the matrix’s fail-fast. The verdict, still cannot judge, names each shard’s ending; a file it cannot read says nothing0121
.mutation-gate/coverage/shard-<n>/map.json.gz, .mutation-gate/coverage/shard-<n>/killers.json, .mutation-gate/coverage/verdict/map.json.gzThe part of the plan’s coverage map each shard and the verdict open on, and the tests each shard’s run found killing first, which the next run orders by0006, 0013
.mutation-gate/delivery/planned/, survivors/, verdict/: delivery.json, ledger.json.gz, coverage.json.gzWhat a run left for deliver with --deliver-later: the comment, alert and OTLP payloads, and the ledger to write0007
.mutation-gate/pipeline.ymlGitLab’s child pipeline0006
.mutation-gate/ledger/<scope>/ledger.json.gzThe proof ledger of one ref; outside CI, the one a run writes whatever store the config names0007, 0010
.mutation-gate/mutants/<native id>.phpThe mutated file of a mutant judged by reference (Pest)0004
infection.json5, infection.json, infection.json5.dist or infection.json.distThe project’s own Infection config, the first found, whose mutators, bootstrap, phpUnit, initialTestsPhpOptions, testFrameworkExtraArgs and static analysis the gate keeps0004
.mutation-gate/mutators/<runner>/bridges.phpThe bridges through which Pest or Infection makes the mutants of the registered mutators the config turns on, which the gate writes for each run0021
.mutation-gate/infection/The config the gate writes for each run of Infection, Infection’s logs, its temporary files, and the coverage the adapter runs PHPUnit for0004
.mutation-gate/phpstan/check.neon, warm.neon, scope.json, resultCache.phpThe configs PHPStan’s checks and its warm-up read, the files it analyses, and the result cache the warm-up saves and every check starts from, which the action keeps in the Actions cache between runs0020, 0052
.mutation-gate/phpunit/The PHPUnit runner’s override, each mutant’s mutated file, the tests its run selects, what the extension recorded and the guard, the coverage it runs PHPUnit for, and its memory cap0023
.mutation-gate/serve.sockThe Unix socket a daemon of serve listens on, readable and writable by its owner alone, removed once the daemon stops0078
.mutation-gate/phpunit-cache/PHPUnit’s caches, its test run history and its code coverage cache, for every PHPUnit the gate starts under the PHPUnit, Pest and Infection runners, whatever directory the project’s PHPUnit config names, so no run writes a file a content key reads0023
.mutation-gate/phpspec/The PhpSpec runner’s override, each mutant’s mutated file, the examples its run selects, what the extension recorded and the guard, the coverage and the list of examples it runs PhpSpec for, and its memory cap0027
.mutation-gate/codeception/The Codeception runner’s override, each mutant’s mutated file, the tests its run selects, what the extension recorded and the guard, the coverage and the list of tests it runs Codeception for, and its memory cap0027
.mutation-gate/testo/The Testo runner’s override, each mutant’s mutated file, the tests its run selects, what the plugin recorded and the guard, the XML coverage and each test’s time, the list of tests it runs Testo for, and its memory cap0027, 0047
.mutation-gate/publish/badge.json, trend.json, trend.svg, summary.json, or the same in the badge report’s pathThe badge, the trend, and the run’s summary an organisation’s dashboard reads0009
.mutation-gate/publish/savings.jsonA shields.io endpoint with the time saved in costs.savingsWindow, the last 30 days by default0017
A json, junit, sarif, stryker, digest, gitlab, sonar or kill-matrix report’s pathThat report0009
.mutation-gate/report.jsonThe last run’s JSON report, which every verdict keeps and digest renders0009
An html report’s path: index.html, mutation-report.jsonThe HTML report, and the report in the mutation-testing-report-schema format0009
A tests report’s path, and the same path with .mdThe useless, removable and weakly asserting tests, as JSON and Markdown0014
<out>/index.html, <out>/dashboard.jsonAn organisation’s dashboard, which dashboard --out=<out> writes0024

What init writes

init writes each file only where it does not exist, and otherwise prints what to add to it (ADR-0015, ADR-0017).

PathWhat it is
The config: mutation-gate.php, or the format --format namesThe runner and preset it found, and the trees listed in a comment
.gitignoreGains .mutation-gate/
composer.jsonGains a mutate script, where you answer yes
.github/workflows/mutation.ymlThe GitHub Actions workflow, --ci=github
.gitlab/mutation-gate.yml, or the file ci.gitlab.template namesThe GitLab template, with the lines to add to .gitlab-ci.yml printed
.buildkite/mutation-gate.ymlThe Buildkite steps, with what to add to the pipeline Buildkite runs printed
.azure/mutation-gate.ymlThe Azure Pipelines template, with what to add to azure-pipelines.yml printed
.circleci/config.yml, bitbucket-pipelines.yml, the Jenkinsfile ci.jenkins.definition namesNot written: what to add to each is printed
.vscode/tasks.json, .vscode/extensions.jsonVS Code’s watch task and the recommended SARIF Viewer, --editor=vscode
captainhook.json, grumphp.yml, .pre-commit-config.yamlThe hook manager’s config calling the gate, --hook=captainhook, grumphp or pre-commit; an existing grumphp.yaml, grumphp.yml.dist, grumphp.yaml.dist, grumphp.dist.yml or grumphp.dist.yaml is read instead
pre-push, and pre-commit with hook install --pre-commit, in git’s hooks directorygit’s own hooks, in the directory git rev-parse --git-path hooks names, core.hooksPath included

The baseline

mutation-gate.baseline.json holds each tree’s floor, and each package’s security floor, one key per tree in byte order and each floor on a line of its own, so a moved floor is a one-line diff:

{
"format": 1,
"trees": {
"app/Domain": { "floor": 100 },
"app/Legacy": {
"floor": 61.2,
"lowered": { "from": 64.5, "reason": "The export feature and its tests were removed together" }
}
},
"security": {
"packages/billing": { "floor": 100 }
}
}
KeyWhat it holds
format1
treesEach tree, by its path, with its floor: a percentage from 0 to 100, at most two decimals
securityEach package’s security set, by its path, held as a tree is; left out where there is none
loweredBeside a floor a pull request lowers: from, the floor on the branch it merges into, and reason, why it may fall

A floor only rises (ADR-0003). baseline --write raises the floors to what was measured, and a pull request may lower one only by saying so: on a pull request the gate compares the baseline with the one the branch it merges into keeps, or the default branch’s where its CI names no such branch (ADR-0050), and fails where

  • a floor is lower and its entry has no lowered, or its reason is empty;
  • lowered.from is not that branch’s floor;
  • a tree leaves the file while its path is still a tree, or a security set while its package is still there.