Skip to content

Features

Everything the gate does, by what it is for. Each section links the page that explains it, and each feature the decision that says why it works as it does.

Floors and the score

More in floors and the score.

FeatureDecided in
Floors that only rise: a committed baseline, which fails on regression and rises on improvement0003
A first CI run with no baseline measures, then hands over the baseline to commit0017
Floors per owner, judged over every file CODEOWNERS gives the owner0022
Security mode: mutators for authorisation, CSRF, escaping and constant-time comparisons, held to a floor of their own0021
Ignores for equivalent mutants, and by its id for a mutant whose file loads before Pest can put it in place, each with a reason and an optional expiry0008
Survivors the compiler proves equivalent, left out of the score0013
A score per test suite0025

What a change reaches

More in what a change reaches.

FeatureDecided in
Pull-request mode: changed lines and what the change reaches, with a stricter floor for new code0003, 0005
Monorepos: a floor per package and module, with reach that follows the dependencies0005
affected: the tests a change can reach, for plain test runs0020
Holding tests: Pest holds: groups and a #[Holds] attribute, a check that a group covers what it holds, and a warning for code every test runs through that nothing holds0005

Trust

More in why a verdict can be trusted.

FeatureDecided in
A kill counts only with evidence: a test named as its killer (one that failed or errored, raised an issue the runner fails the run on, or whose dataset the mutant left empty), or a signal or a fatal error that ended its process; any other is unjudged, with its exit code and output0014
A named killer must pass on the unmutated code, served as its mutant was, or the kill is unjudged0014
Triage of timeouts and flaky tests: a timeout counts as a kill only where its tests, run unmutated under the same limit, finish within it0008
A mutant out of the memory cap counts as a kill only where its tests, run unmutated under the same cap, finish under it, measured alike for every runner0004
A time budget that runs the riskiest code first, and reports anything unjudged instead of passing it0008
Once a survivor of a floor of 100 makes a pull request’s verdict certain to fail, after static analysis has not cleared it, its shard fails: by default after judging every unit, or at once under run.failFast: stop, or cancelling the other shards under cancel; a run that judged on says what stopping would have saved0103
A fork’s pull request reads the default branch’s proofs, read-only0013
Merge queues: a merge_group run judges what will land, trusting no pull request’s own proofs0022
No shortcut stands on a result its tests or its evidence no longer hold0108
A kill judged against its own unmutated stream needs no control run0117
A shard lost to its machine says so, and leaves its progress, the mutant it judged and the largest processes, as an artifact while it runs (shards.progress)0121, 0157
Every process the gate starts held in a session of its own and, on Linux, a cgroup capped in memory and processes (processes.group, processes.contain, processes.memory, processes.pids)0158
A mutant reaches the PHP processes its tests start (pest.childProcesses)0150
The gate’s own pull request is judged by its base’s build0140

Speed

More in speed.

FeatureDecided in
A cost model that learns how long each file takes from earlier shards0006
Sharding on any CI: GitHub Actions, GitLab, Buildkite, CircleCI, Azure DevOps, Bitbucket Pipelines, Jenkins, or a JSON plan0006, 0024
A proof cache keyed by content, stored in the GitHub cache, a directory, S3/R2, Google Cloud Storage or Azure Blob, with OIDC and a public read path for forks0007, 0028
A new push to a pull request stands on its own earlier runs’ proofs, and mutates only what they do not prove, unless proofs.ownScope is false0081
A proof is keyed by the gate’s code its verdict depends on, so a release that leaves that code alone keeps every proof0084
Likely killers first: each mutant’s tests ordered by which of them killed it before0013
A shard count chosen from a target wall time0013
A static analyser (Mago, PHPStan or Psalm) kills the mutants it rejects, before their tests where that saves time0020
A new push re-checks the previous survivors in a job beside its shards, an early signal0020
A sampled mode for huge repositories: each tree estimated with a confidence interval, judged on its bounds0020
A compact ledger, compressed with zstd where it can be, under proofs.compression0085
A pull request that reaches more than sampling.auto beyond its own lines samples by itself, and its plan says why0086
Coverage re-measured only for the tests whose inputs moved0023
Every core of a shard’s runner busy, and one warm worker per core for native runners0023
Mutators that never let a mutant through are pruned on unchanged code, and audited weekly0025
Mutants that leave their file alike run once and share one verdict, under Pest and the PHPUnit, PhpSpec, Codeception and Testo runners0025
A benchmark against plain Pest and Infection on four open-source projects: cold, warm and per pull request, losses included, run by bench.yml and composer bench0017
Outbreak’s native core: it vouches for, slices and converts coverage maps, and outbreak serve holds the map, the ledgers and the coverage in memory0118, 0119, 0133, 0149
Split streams: one run of the suite forks each mutant’s tests from it, records each test’s lines, holds a child to its parent’s steps, and starts without waiting for a fresh map0135, 0136, 0145, 0147
A shard is cut to fit its job, stops before its target (shards.target, shards.margin), and pulls the work left instead of owning a fixed part0114, 0134, 0196, 0197
A mutant that compiles to its original, or is the same program as another, is never run or judged once0130, 0137
A static graph places what the coverage map cannot, and the map stays the check0132
Proofs shared across scopes by their keys, and a push spends only what its pull request did not0122, 0131, 0139
The gate’s hot paths are counted by Tally in every pull request0154

Runners and mutators

More in runners and mutators.

FeatureDecided in
Infection as well as Pest0004
A native runner for PHPUnit, on the gate’s own mutants0023
Native runners for PhpSpec and Codeception, on the gate’s own mutants0027
A native runner for Testo, on the gate’s own mutants0027, 0047
Presets for Laravel, Symfony and plain libraries0008
Custom mutators, written once for Pest and Infection against a typed SDK0021
Laravel and Symfony mutator sets, turned on by their presets0021
A hint that a surviving removal may be dead code0025

Reporting

More in reporting.

FeatureDecided in
JSON, JUnit and SARIF, and line annotations on GitHub0009
An HTML report0009
A digest for agents: the verdict one fact a line, the same verdict as the JSON and HTML reports at a cost in tokens that does not grow with the run, with depth one file, mutant or cluster at a time0009
A sticky comment on the pull request, posted when the plan is made with the units it mutates, the time it should take and the changed lines no test runs, then updated with the verdict, which links the run’s HTML report0009, 0019
A cost estimate in the PR comment: time planned, measured and spared, and money at the team’s rate0016
Every run says what it saved against a full run in one job: reach and proofs, and what sharding saved in waiting and cost in runner time0017
Progress and an ETA during a run0017
A badge (a shields.io endpoint) and a trend on the default branch0009
Chat alerts to Slack, Discord or a webhook when the default branch fails, cannot be judged, or recovers0016
Run metrics as OpenTelemetry traces and metrics, and in the JSON report0016
Survivors in GitLab’s Code Quality report0024
The sticky comment and its planned state on GitLab merge requests and Bitbucket pull requests, with survivors in Bitbucket’s Code Insights0024, 0048
Survivors in SonarQube’s issue list, through its generic external-issues format0028
A useless-test report: tests that cover code and kill none of it0014
A redundant-test report: tests whose every kill another test also makes0014
A kill-matrix export, as CSV and in the JSON and HTML reports0014
Weak assertions, found and paired with the survivors they let through0025
Survivors grouped by code owner, from the CODEOWNERS at the base, with each group’s score in the JSON report0022
Owners mentioned once per pull request0022, 0049
Survivors with one cause clustered into one item with one suggested test0022
One command that reproduces each survivor0004, 0009
For each survivor, what the tests miss0009
Try: …: a concrete way to kill each survivor, found by rules from its diff and its file, in the comment, the report and stub0101
An organisation dashboard: a static site of every repository’s trends, floors and savings0024
mutators: what each mutator costs and finds, from the ledger, and each repository’s ten costliest on the organisation dashboard0076
Heatmap: every file’s and function’s score against the base, in the HTML report, the lowest files on the organisation dashboard, and the files that fell in the pull request comment0100
config:suggest: config changes with their evidence, turning off mutators that find nothing or make noise and giving slow directories a longer timeout, as a diff it never applies0076
suggest.enabled turns every suggestion off, and a context block for each CI (github, gitlab, bitbucket, azure, buildkite, jenkins, circleci) lets any key, suggestions among them, differ by CI0104

Adoption

More in get started.

FeatureDecided in
Zero-config start: trees from phpunit.xml’s <source>, and an optional config file0002
init: it detects the runner, preset and CI, and writes the config and the CI0017
init’s questions: the runner, the CI, an Infection config’s import, native markers, the pre-push hook and composer mutate, asked where detection cannot settle them, with --native, --hook, --no-hook and --dry-run0017
init’s first-run estimate from one coverage run, with its hot paths, or from lines of code with --no-measure; and the trees listed as a comment rather than written0017
doctor: what would fail or run slowly, and the fix, before a run finds out0017
init --from=infection.json5: a config taken over from Infection’s0016
init --ci: a ready, pinned workflow for GitHub, GitLab, Buildkite, CircleCI, Azure DevOps, Bitbucket Pipelines or Jenkins0015, 0024
migrate: a config and a baseline moved to the current format, in any of the four formats0026
A signed PHAR and a multi-arch container image beside the Composer package, published by each release0022
init --hook: the gate in CaptainHook, GrumPHP and the pre-commit framework0024
composer mutate: a root script init adds to composer.json0024
doctor --fix: applies what doctor found after one diff and one question: opcache, the coverage driver, the PHPUnit config, .gitignore, the runner patches and stale CI pins0083

Local use

More in local use.

FeatureDecided in
Watch mode and a pre-push hook0010
A score change before each commit, from a hook that runs nothing and never blocks0015
Survivors inline in VS Code and PhpStorm0015
stub: a failing Pest or PHPUnit test or PhpSpec example to fill in, for a survivor0015
explain: a mutant’s diff, tests, their outcomes and its history, without running it0014
A local loop that takes a share of the machine, looks only at what changed, and runs quick advisory watch rounds keyed apart (local.quick)0120, 0146