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.
| Feature | Decided in |
|---|---|
| Floors that only rise: a committed baseline, which fails on regression and rises on improvement | 0003 |
| A first CI run with no baseline measures, then hands over the baseline to commit | 0017 |
| Floors per owner, judged over every file CODEOWNERS gives the owner | 0022 |
| Security mode: mutators for authorisation, CSRF, escaping and constant-time comparisons, held to a floor of their own | 0021 |
| 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 expiry | 0008 |
| Survivors the compiler proves equivalent, left out of the score | 0013 |
| A score per test suite | 0025 |
What a change reaches
More in what a change reaches.
| Feature | Decided in |
|---|---|
| Pull-request mode: changed lines and what the change reaches, with a stricter floor for new code | 0003, 0005 |
| Monorepos: a floor per package and module, with reach that follows the dependencies | 0005 |
affected: the tests a change can reach, for plain test runs | 0020 |
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 holds | 0005 |
Trust
More in why a verdict can be trusted.
| Feature | Decided 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 output | 0014 |
| A named killer must pass on the unmutated code, served as its mutant was, or the kill is unjudged | 0014 |
| Triage of timeouts and flaky tests: a timeout counts as a kill only where its tests, run unmutated under the same limit, finish within it | 0008 |
| 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 runner | 0004 |
| A time budget that runs the riskiest code first, and reports anything unjudged instead of passing it | 0008 |
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 saved | 0103 |
| A fork’s pull request reads the default branch’s proofs, read-only | 0013 |
Merge queues: a merge_group run judges what will land, trusting no pull request’s own proofs | 0022 |
| No shortcut stands on a result its tests or its evidence no longer hold | 0108 |
| A kill judged against its own unmutated stream needs no control run | 0117 |
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 build | 0140 |
Speed
More in speed.
| Feature | Decided in |
|---|---|
| A cost model that learns how long each file takes from earlier shards | 0006 |
| Sharding on any CI: GitHub Actions, GitLab, Buildkite, CircleCI, Azure DevOps, Bitbucket Pipelines, Jenkins, or a JSON plan | 0006, 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 forks | 0007, 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 false | 0081 |
| A proof is keyed by the gate’s code its verdict depends on, so a release that leaves that code alone keeps every proof | 0084 |
| Likely killers first: each mutant’s tests ordered by which of them killed it before | 0013 |
| A shard count chosen from a target wall time | 0013 |
| A static analyser (Mago, PHPStan or Psalm) kills the mutants it rejects, before their tests where that saves time | 0020 |
| A new push re-checks the previous survivors in a job beside its shards, an early signal | 0020 |
| A sampled mode for huge repositories: each tree estimated with a confidence interval, judged on its bounds | 0020 |
A compact ledger, compressed with zstd where it can be, under proofs.compression | 0085 |
A pull request that reaches more than sampling.auto beyond its own lines samples by itself, and its plan says why | 0086 |
| Coverage re-measured only for the tests whose inputs moved | 0023 |
| Every core of a shard’s runner busy, and one warm worker per core for native runners | 0023 |
| Mutators that never let a mutant through are pruned on unchanged code, and audited weekly | 0025 |
| Mutants that leave their file alike run once and share one verdict, under Pest and the PHPUnit, PhpSpec, Codeception and Testo runners | 0025 |
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 bench | 0017 |
Outbreak’s native core: it vouches for, slices and converts coverage maps, and outbreak serve holds the map, the ledgers and the coverage in memory | 0118, 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 map | 0135, 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 part | 0114, 0134, 0196, 0197 |
| A mutant that compiles to its original, or is the same program as another, is never run or judged once | 0130, 0137 |
| A static graph places what the coverage map cannot, and the map stays the check | 0132 |
| Proofs shared across scopes by their keys, and a push spends only what its pull request did not | 0122, 0131, 0139 |
| The gate’s hot paths are counted by Tally in every pull request | 0154 |
Runners and mutators
More in runners and mutators.
| Feature | Decided in |
|---|---|
| Infection as well as Pest | 0004 |
| A native runner for PHPUnit, on the gate’s own mutants | 0023 |
| Native runners for PhpSpec and Codeception, on the gate’s own mutants | 0027 |
| A native runner for Testo, on the gate’s own mutants | 0027, 0047 |
| Presets for Laravel, Symfony and plain libraries | 0008 |
| Custom mutators, written once for Pest and Infection against a typed SDK | 0021 |
| Laravel and Symfony mutator sets, turned on by their presets | 0021 |
| A hint that a surviving removal may be dead code | 0025 |
Reporting
More in reporting.
| Feature | Decided in |
|---|---|
| JSON, JUnit and SARIF, and line annotations on GitHub | 0009 |
| An HTML report | 0009 |
| 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 time | 0009 |
| 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 report | 0009, 0019 |
| A cost estimate in the PR comment: time planned, measured and spared, and money at the team’s rate | 0016 |
| 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 time | 0017 |
| Progress and an ETA during a run | 0017 |
| A badge (a shields.io endpoint) and a trend on the default branch | 0009 |
| Chat alerts to Slack, Discord or a webhook when the default branch fails, cannot be judged, or recovers | 0016 |
| Run metrics as OpenTelemetry traces and metrics, and in the JSON report | 0016 |
| Survivors in GitLab’s Code Quality report | 0024 |
| The sticky comment and its planned state on GitLab merge requests and Bitbucket pull requests, with survivors in Bitbucket’s Code Insights | 0024, 0048 |
| Survivors in SonarQube’s issue list, through its generic external-issues format | 0028 |
| A useless-test report: tests that cover code and kill none of it | 0014 |
| A redundant-test report: tests whose every kill another test also makes | 0014 |
| A kill-matrix export, as CSV and in the JSON and HTML reports | 0014 |
| Weak assertions, found and paired with the survivors they let through | 0025 |
| Survivors grouped by code owner, from the CODEOWNERS at the base, with each group’s score in the JSON report | 0022 |
| Owners mentioned once per pull request | 0022, 0049 |
| Survivors with one cause clustered into one item with one suggested test | 0022 |
| One command that reproduces each survivor | 0004, 0009 |
| For each survivor, what the tests miss | 0009 |
Try: …: a concrete way to kill each survivor, found by rules from its diff and its file, in the comment, the report and stub | 0101 |
| An organisation dashboard: a static site of every repository’s trends, floors and savings | 0024 |
mutators: what each mutator costs and finds, from the ledger, and each repository’s ten costliest on the organisation dashboard | 0076 |
| 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 comment | 0100 |
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 applies | 0076 |
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 CI | 0104 |
Adoption
More in get started.
| Feature | Decided in |
|---|---|
Zero-config start: trees from phpunit.xml’s <source>, and an optional config file | 0002 |
init: it detects the runner, preset and CI, and writes the config and the CI | 0017 |
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-run | 0017 |
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 written | 0017 |
doctor: what would fail or run slowly, and the fix, before a run finds out | 0017 |
init --from=infection.json5: a config taken over from Infection’s | 0016 |
init --ci: a ready, pinned workflow for GitHub, GitLab, Buildkite, CircleCI, Azure DevOps, Bitbucket Pipelines or Jenkins | 0015, 0024 |
migrate: a config and a baseline moved to the current format, in any of the four formats | 0026 |
| A signed PHAR and a multi-arch container image beside the Composer package, published by each release | 0022 |
init --hook: the gate in CaptainHook, GrumPHP and the pre-commit framework | 0024 |
composer mutate: a root script init adds to composer.json | 0024 |
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 pins | 0083 |
Local use
More in local use.
| Feature | Decided in |
|---|---|
| Watch mode and a pre-push hook | 0010 |
| A score change before each commit, from a hook that runs nothing and never blocks | 0015 |
| Survivors inline in VS Code and PhpStorm | 0015 |
stub: a failing Pest or PHPUnit test or PhpSpec example to fill in, for a survivor | 0015 |
explain: a mutant’s diff, tests, their outcomes and its history, without running it | 0014 |
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 |