ADR-0011: The package holds itself to the gate it ships, and to the standards of the in-house project
Status: Accepted Date: 2026-09-29
Context
A mutation gate that is not mutation-tested asks users for a rigour it does not show. The maintainer’s decisions for this package are:
- it gates itself at a 100% floor;
- it runs PHPStan at max and keeps its core isolated with arch tests;
- it ships a composite GitHub Action (
action.yml) in the same repository; - it has no release at all until every feature the README lists is in (ADR-0013).
The package also takes the code-quality, testing, tooling and architecture standards of the in-house project whose gate it generalises, reusing whatever carries over. And it stands alone: nothing in its CI, its dev tooling, its Composer dependencies, its documentation or its runtime reaches into another organisation’s repository.
This ADR inventories the in-house project’s toolchain. Its main parts are:
- Composer scripts and dev dependencies;
- a
phpstan.neonwith 18 rules of its own; rector.php,pint.jsonandcomposer-dependency-analyser.php;- 59 arch test files;
- the Guards suite, which plants a violation of every rule and requires it to be refused;
- an
ARCHITECTURE.mdwith each rule beside the test that enforces it; - a floors suite, SonarCloud, and shared reusable workflows, kept in another repository, for hygiene, security and commitlint.
Much of that is generic PHP discipline and carries over as it is. Some of it is about Laravel, NativePHP or the project’s modules, and does not.
Decision
-
The package gates itself with itself, at 100.
- The config declares one tree,
src, at floor 100 with new code at 100, and one tree for each first-party plugin’splugins/<name>/src, at the same floor (ADR-0021). Its security set,security.floor, is held at 100 too, since a security set with no floor is refused. Uncovered mutants count (uncovered: count), so every line must be both covered and mutation-tested. - The declared floor is 100, so the baseline cannot hold it lower.
- The runner is Pest.
- The code that runs inside a mutant’s own process, or decides what it
executes, is listed under
reach.everything: the Pest plugin and its recording, grouping and ordering, the warm worker and its client, the patchespest:patchapplies,MutantFileand the mutant limit. Here it is project source like any other, so without the list a change to how mutants run would reach only its own units, and every other unit would carry a result the older version produced (ADR-0005). - The package’s CI calls its own reusable workflow from the same commit
(
uses: ./.github/workflows/mutation-gate.yml), whose shard jobs run the action from that commit too. Every change to the gate, the action or the workflow is judged by the version it introduces. - The verdict job is a required check.
- A weekly scheduled full run is part of it (ADR-0005).
- The config declares one tree,
-
Static analysis is the in-house project’s, less Laravel.
phpstan.neonruns atlevel: maxwith:phpstan-strict-rulesandphpstan-deprecation-rules;ergebnis/phpstan-ruleswithallRules: true, with the in-house project’s disabled list (named arguments and nullable defaults allowed);shipmonk/phpstan-rules;tomasvotruba/type-coverageat 100 for declare, return, param, property and constant;tomasvotruba/cognitive-complexityat 30 per class and 8 per function;spaze/phpstan-disallowed-callswith its four bundled lists;checkUninitializedProperties,checkImplicitMixed,checkBenevolentUnionTypes,checkTooWideReturnTypesInProtectedAndPublicMethodsandreportAnyTypeWideningInVarTag.
There is no PHPStan baseline and no
ignoreErrors, ever. -
The in-house toolchain, piece by piece. Each piece is copied (taken as it is), adapted (taken and changed for a single library), or not applicable. Where the in-house piece ran from another repository, this package keeps its own copy.
Piece In the in-house project Here Why composer ciscript chainvalidate --strict,validate:modules, normalize,normalize:modules, audit, lint, analyse, refactor, deps,test:guards,test:report,test:floors,test:mutationAdapted The same chain less the two :modulessteps, since there are no modules.test:mutationrunsbin/mutation-gate.Other scripts analyse,lint/lint:fix,refactor/refactor:fix,deps,test,test:coverage,test:report,test:floors,test:guards, withscripts-descriptionsCopied Same names, same meaning, so the same muscle memory works in both repositories post-install-cmd/post-update-cmdcore.hooksPath .githooks, plus four vendor patches (NativePHP, two for Pest mutate, PHPUnit source mapper)Adapted hooksPathis kept. The two Pest patches become this package’s ownpest:patch(ADR-0004), which its CI enables. NativePHP does not apply. The source-mapper patch fixes a wildcard<source>include the package does not use.require-dev: ergebnis/composer-normalize, ergebnis/phpstan-rules, laravel/pint, pestphp/pest, pestphp/pest-plugin-arch, phpstan/phpstan and its strict and deprecation rules, rector/rector, roave/security-advisories, shipmonk/composer-dependency-analyser, shipmonk/phpstan-rules, spaze/phpstan-disallowed-calls, tomasvotruba/cognitive-complexity, tomasvotruba/type-coverageat the versions the in-house project locks Copied Generic PHP tooling require-dev: larastan/larastan, pestphp/pest-plugin-laravel, monolog/monolog, saloonphp/saloon and the project’s own packagesNot applicable Laravel, NativePHP or in-house code. The package adds infection/infection, symfony/yaml, nette/neon and async-aws/s3 instead, to test its adapters. configallow-plugins,optimize-autoloader,platform.php: 8.5.0,sort-packages,process-timeout: 0Copied phpstan.neonThe in-house static analysis, plus larastan Adapted Less larastan. Paths are src,tests,phpstanandbin.spaze disallowed lists the clock, randomness, the filesystem, sleep,passthruandshell_exec,ini_set, superglobals, reflection, non-mb_string functions,else/elseif, bare exceptions, Laravel helpers and an HTTP client’s TLS switchAdapted Scoped with allowInto the layers of ADR-0001: the filesystem, the standard streams, processes, the network, the environment, the system clock and waiting only in adapters andCli, and no random numbers anywhere insrc. The Laravel helpers and the TLS switch have nothing to bind to.Own PHPStan rules, generic: NoBroadCatchRule, NoDynamicAccessRule, NoEmptyRule, NoLateStaticBindingRule, NoMagicMethodRule, NoMagicNumberRule, NoManyMethodsRule (20 methods), NoManyReturnsRule (3 returns), NoNestedTernaryRule (with ??on a subscript), NoPositionalBooleanArgumentRule, PreferSprintfOverConcatRule, PreferSprintfOverInterpolationRule, NoWeakenedTlsRulein the project’s own rules directory Copied Generic, into phpstan/Rules/. The interpolation rule’s message loses its mention of a translator.NoOutputRule echoandprintonly in testsAdapted No echoorprintanywhere insrc. The CLI and the console reporter write throughsymfony/console’s output.The rule against ?->in the domain?->banned in a hard-coded list of modulesAdapted As NoNullsafeInCoreRule, over CoreRules for SDK wire values, translations and Laravel providers Not applicable Nothing here for them to bind to rector.phpPHP sets from Composer’s PHP; prepared sets deadCode, codeQuality, typeDeclarations, privatization, instanceOf, earlyReturn; importNames; cacheAdapted The same sets. The in-house project’s four scoped skips are about its own screens, contract tests and one file, so they are dropped. pint.jsonperplus strict types, strict comparison,final_class, global namespace imports, native function invocation, ordered elements and imports, trailing commasCopied composer-dependency-analyser.phpshipmonk, prod and dev paths derived from module manifests Adapted srcis prod andtestsis dev. The libraries insuggestare declared optional. For a library, this is what keepsrequirehonest for everyone who installs it.Deptrac, composer-require-checker, composer-unused none Not applicable The in-house project uses none of them. Pest arch and the dependency analyser cover the same ground. Pest arch presets arch()->preset()->php(),->preset()->security()Copied Hand-written arch rules framework and boundary bans, ambient calls kept out of the kernel, bare exceptions, vague suffixes, Interface/Abstractaffixes, exception naming, closed sets as enums, every class final, no debugging callsAdapted The framework and boundary bans and the ambient-call ban become the layer rules of ADR-0001, with the ambient ban on Core. The others are copied.The module API test outcomes, no nullable returns, no arrays, primitives only in named constructors, no mixed, over each module’s API namespaceAdapted Applied to the public API, and the ban on nullable types widened to all of CoreThe module boundaries test generated from module kinds Not applicable There are no modules. ADR-0001’s layer rules take its place. The test conventions test no mocking foreign types, expect()only, no committed->only()and no reason-less->skip(), behavioural test names, no duplicate helpersCopied The comments test comments state the current situation (markers such as previously and TODO refused), docblocks only where a type cannot speak, said once, about a symbol Copied As CommentsTestThe test that the rules are real every documented rule has an artifact carrying its identifier, and every identifier in an artifact is documented Copied As TheRulesAreRealTestThe test that every measured tree declares its floors every tree declares its coverage and mutation floors in its nearest manifest Adapted The gate itself refuses a tree without a floor (ADR-0003). The arch test checks the coverage floor. The test that the suite cannot go quiet, and phpunit.xml’sfailOn*settingsa diagnostic fails the run, including one raised under @Copied As TheSuiteCannotGoQuietTestThe requirement-ID check no requirement IDs in comments; test titles exempt Adapted Widened. The package has no requirement IDs at all, so the check covers comments and test names. That enforces the convention of no IDs in test names, which the in-house project only states. tests/Guardsevery rule that claims to be enforced has a planted violation, planted in a throwaway copy of the checkout, and must be refused by the analyser or the named test. Built from Fixture(analyser,analyserInPlace,suite,isolatedSuite,edit,direct,notDrivablewith a required reason, andauditandcoverage, whose guards CI runs as theci-onlygroup) andFixtures,Proof,RulesandViolations/*Adapted The same pattern and support classes, for one package rather than modules ARCHITECTURE.mdRule tables | | Rule | Enforced by |, with the vocabularyphpstan: own rule,arch,test,review,planned. Also## Refused, and whyand## Patterns.Adapted The same format, holding the rules that apply here under this package’s own rule IDs ( C5,H3, …).TheRulesAreRealTestand Guards read it.tests/Floorsandtest:coverage --min=100each tree’s line coverage floor, read from clover Adapted One tree, src, at 100SonarCloud a project, its properties file, a sonarjob, and a gate job that allows no open issueAdapted A SonarCloud project of this repository’s own, fed the clover and JUnit reports the tests job writes. Its token is the SONAR_TOKENsecret. Thesonarjob and its gate, allowing no open issue, are required from the start.typos, actionlint, markdownlint, lychee config files, run by a shared hygiene workflow in another repository Adapted The config files are copied. The jobs are this repository’s own hygieneworkflow.gitleaks, osv-scanner a shared security workflow in another repository Adapted This repository’s own securityworkflowcommitlint a shared workflow in another repository, plus .githooks/commit-msgAdapted This repository’s own workflow and the script it runs, plus its own .githooks/commit-msgSigned commits branch protection required_signaturesCopied The ruleset on mainrequires signed commitsCODEOWNERS the one maintainer Copied * @lessevvDependabot Composer weekly in groups, Actions daily with a cooldown, commit prefix buildAdapted The same cadence, with groups for this package’s tools .githookspre-commit(Pint on staged files),commit-msg,pre-push(refuses a direct push tomain)Copied .editorconfig,.gitattributes/.github export-ignoreAdapted A library’s archive is what users download, so tests,.docs,phpstan,.githuband the other dotfiles areexport-ignoreas well.CodeQL codeql.yml,analyzerequiredAdapted CodeQL has no PHP analysis. It runs for the workflows, the reusable workflow and action.yml.OpenSSF Scorecard scorecard.ymlCopied A public package is what Scorecard exists for Mutation jobs a scope job, a matrix of shards and an aggregating job, driven by the in-house script Adapted They become this package’s reusable workflow: plan, shards and verdict ADR-0042 amends this table:
config.platform.phpis 8.4.28. -
The code conventions, and what enforces each here. The rule IDs are this package’s own, held in
ARCHITECTURE.md.Convention Enforced by No elseorelseifspaze disallowedControlStructures(C5)Booleans are passed by name NoPositionalBooleanArgumentRule (D5) sprintfover interpolation and concatenationPreferSprintfOverInterpolationRule, PreferSprintfOverConcatRule (H5) No null for absence: no nullable types in Coreor the public API. Absence is a type or an outcome, and adapters convert a library’s null before it crosses a port.arch (C2, over the API surface and all of Core), NoNullsafeInCoreRule (C8)No ??on an array subscriptNoNestedTernaryRule (C9) Outcomes, not exceptions, across a boundary (ADR-0001) arch (C1 over ports), NoBroadCatchRule (C6), the bare-exception ban (C3) No arrays in the public API arch (D1) Primitives only in named constructors arch (D2) No mixedin public signaturesarch (D3), with type coverage at 100 Comments state current fact CommentsTest(K1) and reviewNo requirement IDs in comments or test names The widened ID check and arch (H7) At most 20 methods per class, constructor included NoManyMethodsRule (H3), alongside at most three returns per function (H8) and cognitive complexity of 8 per function and 30 per class Every class final, readonly where it can be; no magic numbers; no vague suffixes arch (D7), NoMagicNumberRule (D6), arch (H1) -
The generic rules stay internal in 0.1.0. The copied PHPStan rules live in
phpstan/, autoloaded for development only and left out of the dist archive. So do the arch helpers and the Guards support. Shipping them would make them public API, with their own versioning and support, and the package’s product is the gate. They are kept free of anything gate-specific, so they can move into a rules package of their own. That is a separate decision. -
CI, as far as a library needs it. Every job below is this repository’s own, and every action it uses is pinned by a full commit SHA.
Job Runs Required what changed Skips the PHP jobs for a documentation-only change yes pr Every commit’s conventional subject and trailers, the title and the body, the Spec:numbers and a breaking change’s Migration section, as one job of theprworkflow, which also runs on an edited title or body (ADR-0019)yes hygiene / tools actionlint, zizmor, typos, the line cap, lychee (links), markdownlint, gitleaks and osv-scanner, as steps of one job yes scripts python3 -m unittestover the deciding halves of.github/scriptsand of the action’s script inresources/action(ADR-0019)yes rules pest --testsuite=Archyes docs the Docs suite: every example, the generated reference and the message slugs (ADR-0018) yes the rules refuse violations composer test:guardsyes checks validate, normalize, lint, analyse, refactor, deps, audit yes tests and coverage test:reportwith the highest dependencies, its coverage collected forcoverageyes coverage G7: the suite’s coverage with the lines of the processes its tests start, Pest’s highest and lowest runner contract legs’ and Outbreak’s boundary’s, merged, with only the files scripts/coverage-exemptions.php names exempt yes lowest dependencies the suite after composer update --prefer-lowestyes runner contract one leg per runner and resolution, side by side, each with its own install and suite: the Runner contract suite (ADR-0004) or the StaticChecker contract suite (ADR-0020) against the lowest supported Pest, Infection, PHPUnit, Mago, PHPStan or Psalm, each analyser lowest with the other packages as high as it allows, or the highest the fixtures’ committed locks hold, which Dependabot moves no runner contracts every leg of runner contract passed, with what each leg’s suite reported as its evidence yes mutation testing the package’s own plan, shards and verdict, through the local reusable workflow, with its verdictjob as the checkyes sonar, sonar gate SonarCloud’s analysis, and its quality gate with no open issue allowed yes evidence every job’s evidence, gathered into the one artifact the bot reads (ADR-0019) no analyze CodeQL for the workflows, the reusable workflow and the action yes scorecard OpenSSF Scorecard no full mutation the weekly scheduled full run no runner canary daily, canary.yml: the Runner and StaticChecker contract suites against the newest Pest, Infection, PHPUnit, Mago, PHPStan and Psalm releases, red when a pinned releasecomposer.jsonrefuses passes (ADR-0017), and against the newest release of every native runner’s framework (ADR-0027)no phar builds the PHAR and runs its smoke suite, publishing nothing (ADR-0022) yes benchmark bench.yml, on demand and monthly: the gate against plain Pest and Infection on four open-source projects (ADR-0017)no the contributor bot bot-*.yml: the relay, the explainer, the commands, the checklist and the release draft (ADR-0019)no -
The public API, and semantic versioning from 0.1.0. What semver protects:
- the CLI’s commands, options and exit codes (0 passed, 1 failed, 2 cannot judge);
- the config: the PHP builder, the JSON Schema, and the meaning of every setting;
- the file formats: the baseline, the JSON report, the ledger, and the plan
as
plan --ci=jsonprints it; - the problems output’s line format (ADR-0015);
doctor’s JSON output (ADR-0017);- the message slugs and the troubleshooting links built from them (ADR-0018);
- the action’s and the reusable workflow’s inputs, outputs, secrets and job names;
- the eleven ports (ADR-0020, ADR-0023), the
Mutatorlayer and its testing kit (ADR-0021),Extension,Extensions,Configurable, theCorevalue types the ports use, and the#[Holds]attribute.
Everything else is marked
@internal, and that includes.mutation-gate/plan.jsonand the shard result files, which only pass between jobs of one version. A removal is deprecated with a warning for at least one minor release first, and happens only in a major. ADR-0043 amends this: while the major is 0, a minor release may break what semver covers, with a Migration section in its release notes, and a patch never does; the deprecation holds from 1.0.0. Every type outside the surface is marked@internal, and D13 enforces the marks. -
The package, its CI and its GitHub integration live in one repository,
nightworksio/php-mutation-gate. GitHub’s Marketplace asks for a public repository with a singleaction.ymlat its root, a name no other action, user, organisation or category uses, and two-factor authentication on the publishing account. A repository’s own workflows do not stop it being listed. Two ways in are offered.-
A composite action,
action.ymlat the root, listed on the Marketplace asmutation-gate, or asPHP Mutation Gateif that name is taken, with branding.An action’s inputs are strings, so the Type column gives the format of the value.
cacheis the one boolean, and the reusable workflow declares it asbooleanand the rest asstring.Input Type Default configpath none: the config is found as ADR-0002 says php-versionstring 8.5runnerpest,infectionor a registered namenone: the config’s, or zero-config’s shardshard id none: the whole gate runs modeauto,fullorchangedauto: change-scoped on pull requests and pushes, full on schedules, manual dispatches, releases and tags (ADR-0005)changed-sincea git ref, or last-passedthe pull request’s base on pull_request, the default branch on any other branch,last-passedon the default branch; used only when the mode is change-scopedbudgetduration none reports<name>:<path>lines, each added as--reportnone cacheboolean true: the ledger is kept in the Actions cache (ADR-0007)Output What it holds verdictpassed,failedorcannot-judgescoresJSON: each tree’s score, and the new code’s report-pathsJSON: each written report’s name and path planJSON: the plan, as plan --ci=jsonprints itWhat it does. It sets up PHP at
php-versionwith a coverage driver, installs the project’s Composer dependencies, restores the proof ledgers from the Actions cache and runs the gate with the job’s token asGITHUB_TOKEN. It checks that the project’s installed gate is of its own release line, the line whose tag it moves, and stops if not.- Without
shardit runs the whole gate in one job: plan, run and verdict. It writes line annotations and the step summary, posts the sticky PR comment, and saves the ledger when the run may write it (ADR-0007). - With
shardit runs that one shard of the plan in.mutation-gate/, which is how the reusable workflow uses it. Its outputs are then empty, because the verdict comes later.
- Without
-
A reusable workflow,
.github/workflows/mutation-gate.yml, called withworkflow_call, for sharded runs.- Inputs are the action’s less
shard, with the same types and defaults. ADR-0035 adds two of its own:coverage, the map another job made, andruns-on, the runner every job runs on. - Secrets come from two environments, never from the caller, and
reach only jobs that run none of the project’s code (ADR-0007).
mutation-gate-read, with no branch policy, holdsMUTATION_GATE_READ_AWS_ACCESS_KEY_IDandMUTATION_GATE_READ_AWS_SECRET_ACCESS_KEY, a key that reads the default branch’s prefix alone, forfetch.mutation-gate-store, whose deployment-branch policy admits the default branch alone, holdsAWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEYandAWS_SESSION_TOKEN, which write the store, andMUTATION_GATE_SLACK_URL,MUTATION_GATE_DISCORD_URL,MUTATION_GATE_WEBHOOK_URL,MUTATION_GATE_WEBHOOK_SECRET,OTEL_EXPORTER_OTLP_ENDPOINTandOTEL_EXPORTER_OTLP_HEADERS, which alert and trace (ADR-0016), fordeliveron a trusted run. The store’s location comes from the repository variablesMUTATION_GATE_STOREandMUTATION_GATE_STORE_*. ADR-0029 supersedes “never from the caller”: a caller passes each of these by name, since a called job reads an environment’s secret only under a name its caller passes, and the values stay in the two environments. - Outputs are
verdict,scoresandplan, as the action’s. The reports are uploaded as the artifactmutation-gate-reports, and a baseline measured for trees with no floor asmutation-gate-baseline(ADR-0017). - Jobs:
fetchruns whereMUTATION_GATE_STOREnames a store. It checks out this repository alone atjob.workflow_sha, installs the gate there with no scripts and no plugins, runsmutation-gate fetchwith the read key, and uploads the default branch’s ledger as the artifactmutation-gate-fetched-<attempt>;plansets up as the action does, restores the ledgers, downloads whatfetchread, runsplan --ci=github --deliver-laterand uploads the plan, the coverage maps and the delivery it left. The action has no plan-only or verdict-only mode, so this job and the verdict job run the CLI after the same setup steps;deliver-planinstalls the gate asfetchdoes and runsmutation-gate deliverover the plan’s delivery, which posts the comment’s planned state (ADR-0009);survivors, on a pull request, beside the shards, runsmutation-gate survivors --plan --deliver-laterafter the setup the plan has, patching Pest where the config asks, and uploads the delivery it left (ADR-0020);deliver-survivorsinstalls the gate asfetchdoes and delivers it, which writes the comment over its planned state alone;shard, one matrix job per shard, checks out the calling repository, and this repository atjob.workflow_sha(the commit the workflow was called at) into a directory of its own. It downloads the plan’s artifact into.mutation-gate/, and runs the action from the checkout of this repository withshard, so the workflow and the action are always the same commit, and uploads its result file;verdictruns whenever the run was not cancelled, even after a failed shard. It restores the ledgers and the files published last time, downloads whatfetchread, runs the verdict with--deliver-later, writes the annotations and the step summary, saves the ledger to the Actions cache and uploads the delivery it left. It is the check a branch protects, shown as<calling job> / verdict;deliverinstalls the gate asfetchdoes and runsmutation-gate deliverover the verdict’s delivery: it posts the comment, and on a trusted run, a push, schedule or dispatch on the default branch, it entersmutation-gate-store, writes the ledger, alerts and traces;publishpushes the badge and trend to themutation-gatebranch (ADR-0009). It runs only on the default branch, and it is the only job that asks forcontents: write.
- Permissions. Every job has
contents: read, andverdictalsoactions: read. No job that runs the project’s code may write.deliver-plananddeliverhavepull-requests: write, for the comment, andpublishhascontents: write. A step that holds the token in a job that runs the project’s code comes before its dependencies install, and no step after it holds one. The action needscontents: readandactions: readin the job that runs the gate, andcontents: readandpull-requests: writein itsdeliverjob. A job that reaches an S3 store through an OIDC role addsid-token: write, and the role that can write the default branch’s prefix trusts only an environment restricted to the default branch, or this workflow’sjob_workflow_ref, never a bareref(ADR-0007, ADR-0019).
- Inputs are the action’s less
-
Pinning. Every action either one uses is pinned by a full commit SHA with its tag in a comment, and Dependabot moves the pins. The README’s examples pin this repository the same way.
-
Versions. The action and the workflow are versioned with the package: each release tag (
v0.1.0) is theirs too. A release workflow runs the gate over the package inmode: full, and only when that passes moves the tag of the release’s line to it:vMAJOR.MINORwhile the major is 0 (v0.1), andvMAJORfrom 1.0.0. -
Dogfooding. The package’s own CI runs its self-gate through the local reusable workflow, whose shard jobs run the action from the same commit. So the workflow and the action’s shard mode are exercised on every pull request by the code in that pull request. The action’s one-job mode runs the same setup steps and the same CLI.
-
-
Commits and releases.
- Every commit uses a conventional-commit subject.
- Every commit on
mainis signed.maintakes only squash commits, which GitHub signs, so a contributor’s own commits need not be (ADR-0018). - A commit that implements a decision names it in a
Spec:trailer:Spec: 0006, or several numbers. The commit-msg hook checks that each number is an ADR in.docs/decisions. - The first release is 0.1.0, and the only one planned. It holds every
feature the README lists (ADR-0013), and is tagged only when
each is implemented, tested, gated at 100% and documented in the README.
Nothing is tagged before that: no release candidates. Until then a
project can require
dev-main. - No package registry. The gate is published to no registry, Packagist
included. A project requires a release’s tag, or a commit, from this
repository through a Composer
vcsrepository, as the README’s quick start does. - Each release is a signed tag on
mainand a GitHub release with notes drawn from the conventional commits: the version’sCHANGELOG.mdsection, generated and then edited before the tag (ADR-0018). The release workflow publishes nothing for a tag whose signature the repository’s allowed signers do not verify, or that points offmain, and a tag ruleset lets only the maintainer createv*tags (ADR-0019).
-
Supported versions at 0.1.0.
Dependency Supported Tested in CI PHP 8.5 and later 8.x 8.5; each later minor added when it is released and green Pest pestphp/pest^5.1 withpestphp/pest-plugin-mutate^5.0 (conflictoutside the range the contract suite has passed), on the PHPUnit 13 release each Pest version pinslowest and highest in range Infection infection/infection~0.35.0, with PHPUnit 12 or 130.35.x lowest and highest, each with PHPUnit 12 and 13 Native runners PHPUnit 13.2.0 and later (ADR-0023); PhpSpec 8.2.0 and later and Codeception 5.3.6 and later, each with php-code-coverage 14 (ADR-0027); Testo (ADR-0027), at the versions its contract suite has passed lowest and highest in range Coverage driver pcov or Xdebug pcov symfony/console,symfony/process,symfony/http-client,psr/clock^7.4 || ^8.0 for Symfony, ^1.0 for psr/clocklowest and highest Optional: symfony/yaml,nette/neon,async-aws/s3^7.4 || ^8.0, ^3.4 and ^3 lowest and highest ADR-0041 amends this table: pest-plugin-mutate is allowed from 5.0.2 to below 6.0, and
doctoradvises on a release newer than the newest the contract suite has passed.ADR-0042 amends this table: PHP 8.4 and later 8.x are supported, and CI runs the suite on 8.4 with the oldest dependencies and on 8.5.
A runner release outside these ranges is added in a minor release, once its contract suite passes. Infection is 0.x, so each of its minor releases is treated as a potential break.
Alternatives considered
| Option | Why it lost |
|---|---|
| Gate the package with a released version of itself | The gate would judge each change with the previous code, so a change to the gate would only be proved one release later. Using the same commit proves a change by itself. |
| A floor below 100 for the package | It would ask users for a rigour the package does not keep. The in-house project declares 100 for all its trees but four, and each of those four says in its manifest why it is 0. |
| Calling the in-house project’s shared workflows for hygiene, security and commitlint | Ties this package’s CI to another organisation’s repository: a change there would change what this repository’s checks do, with no commit here. Own copies cost keeping them current, which Dependabot does for their actions. |
| Ship the generic PHPStan rules and arch presets in this package | Makes them public API of a mutation tool, and ties their versioning to the gate’s. A rules package of their own is the place, if they are shared. |
Renaming the copied rules to slugs (no-else, method-cap) instead of rule IDs (C5, H3) | TheRulesAreRealTest and Guards match on <ID> — at the start of each message, and the rules are copied as they are, so IDs stay. They identify code rules, not requirements: the widened check refuses requirement IDs (<AREA>-R<n>), and a rule ID in a comment beside an expectation stays allowed. |
| Deptrac for layer rules | Pest arch and PHPStan already run in the suite, and Guards proves each of their rules refuses a violation. |
| Release candidates before 0.1.0 | The approved decision is no release before every feature the README lists. A release candidate is a release people depend on. |
| A PHAR instead of a Composer package | Would avoid Symfony version conflicts in consuming projects, but the Pest adapter’s plugin, the #[Holds] attribute and extension discovery all need the package to be in the project’s autoloader. Broad Symfony ranges are the answer to conflicts. ADR-0022 supersedes this row: a signed PHAR and a container image ship beside the Composer package, and the PHAR refuses a Pest project, whose plugin only the Composer package installs. |
Referring to the action from the reusable workflow by tag (nightworksio/php-mutation-gate@v0.1) | The workflow and the action could then be different commits, and the package’s own CI would judge a change to the action with the released one. Checking out the workflow’s own commit keeps them one version. |
Consequences
The package is its own first user. Every rule it asks of users (100% floor, ratchet, proofs, reach) is exercised on its own code on every pull request.
Contributors meet the in-house project’s bar, with the same tools, scripts, hooks and failure messages. Someone who has worked in one repository can work in the other.
The package stands alone. Its CI and tooling change only through commits to this repository.
The features the README lists gate the first release, not a date. Each points at the ADR that decides it.
Related
- ADR-0001: the layers the arch rules enforce
- ADR-0003: the floors the package holds itself to
- ADR-0004: the runner contract suite and
pest:patch - ADR-0006: what the reusable workflow runs
- ADR-0009: what the workflow posts and publishes
- ADR-0013: the release gate covers every feature the README lists
- ADR-0015: the problems output as public API, and the CI templates pinned to the package’s own workflows
- ADR-0016: the reusable workflow’s secrets for chat alerts and OpenTelemetry
- ADR-0017: the runner canary, the benchmark,
doctor’s JSON and the measured-baseline artifact - ADR-0018: the
docsjob, message slugs, signed commits onmain, and the changelog and release notes - ADR-0019: the
prandscriptsjobs, zizmor, the contributor bot, tag verification, and the OIDC roles - ADR-0021: the plugins’ trees, and the mutator SDK as public API
- ADR-0022: the PHAR and the image, the
pharjob, and what a release publishes - ADR-0029: the reusable workflow’s secrets, passed by name
- ADR-0035: the reusable workflow’s own inputs,
coverageandruns-on - ADR-0023: the native PHPUnit runner
- ADR-0024: the
.pre-commit-hooks.yamlids - ADR-0027: the Codeception, PhpSpec and Testo runners
- ADR-0043: what a 0.x release may break, and the marked boundary, which amend the public API