# ADR-0108: No shortcut stands on a result its tests or its evidence no longer hold

**Status:** Accepted
**Date:** 2026-11-06
**Amends:** [0025](/docs/decisions/unchanged-code-is-pruned-and-tests-are-judged-by-their-assertions): item 1, which results pruning carries
**Amends:** [0062](/docs/decisions/a-change-that-reaches-no-unit-keeps-the-verdict-it-is-read-since): when a verdict stands for a plan that runs no unit
**Amends:** [0014](/docs/decisions/every-test-is-judged-by-what-it-kills): rule 17, for a run that fails before any test
**Amends:** [0008](/docs/decisions/a-run-spends-its-time-on-the-riskiest-code-first): which mutants are judged in parts, and that their survivors are screened
**Amends:** [0005](/docs/decisions/what-a-change-reaches-is-what-is-mutated): rule 7, how modules are found; rule 12, which release a standing verdict was judged by
**Amends:** [0073](/docs/decisions/a-limit-can-be-learned-from-what-earlier-runs-measured): item 3, a learned multiple is rounded up and keyed

## Context

Shortcuts could let a change through that the gate would otherwise catch, and
one could fail a run that passes.

- **Pruning checked only a unit's source and mutant set** (ADR-0025). A pull
  request that weakened or deleted the test that killed a mutant carried the
  old kill. The mutant that now survives never ran, and the verdict passed
  until the next full run.
- **A plan that runs no unit kept the verdict it was read since** (ADR-0062)
  even where its change reached units that earlier results proved. Those
  results may be older than the verdict that stands, which never judged
  them. A pull request that restored an old, weaker test could pass on them.
- **A run that failed before any test ran counted as a kill** with no killer,
  no ending and no control, in the PHPUnit-family runners and under
  Infection. A bootstrap that failed for its own reasons, such as a database
  that timed out, recorded kills nothing evidenced.
- **Modules were never found.** ADR-0005 rule 7 and ADR-0065 item 6 reach
  every tree of a module from a changed test inside it, but no layout the
  gate built held a module.
- **A heavy mutant's survivor skipped the screening** every other survivor
  gets. Parts that all pass make a timed-out mutant a survivor after the
  static check and the second run had gone by, so it went unchecked and
  could doom a run that static analysis would have passed. A mutant was also
  judged in parts where its silence limit or a test's own limit had stopped
  it, which no part judges sooner.
- **A verdict stood for any release.** A project on a moving tag kept an
  older patch's verdict on every change no tree holds, however long, and
  nothing advised the scheduled full run that catches up.
- **A learned `timeouts.multiple` changed results and moved no key** (ADR-0073),
  so a mutant could be carried from a run under a longer limit than this one's.
- **Timeout triage kept no margin.** A control that took 9.8 s of a 10 s limit
  made a timeout a kill.

## Decision

1. **A proof records the digest of every test file that covers its unit**, as
   the coverage map the verdict read says, beside those that killed one of
   its mutants. **Pruning carries a result only where each of those files
   reads now as it did**, so a unit is judged whole again whenever a test
   covering it changes or goes. A result that records none, from before
   this, is held to its killers alone until a full run replaces it.
   Pruning stays on by default.

2. **A verdict stands for a plan that runs no unit only where the plan proves
   none it reaches.** Where the change reaches a unit that an earlier result
   proves, the run's own verdict judges that result.

3. **A run that fails before any test runs is a kill no test is named for.**
   Its ending is its evidence: it stands on a fatal error PHP recorded or a
   signal, and otherwise on an unmutated control of its covering tests, as
   rule 17 of ADR-0014 says for every unnamed kill. Infection's `errored`
   list is read the same way. A mutant that does not parse stays an error,
   the parser being its evidence.

4. **A module is every directory with a `composer.json` of its own inside a
   package that is not a package itself**, among the files version control
   lists. The layout that reach reads holds each one.

5. **A survivor a control leaves is screened as every survivor is.** After the
   controls, each mutant that survives there and did not before is proven
   equivalent where the settings ask, checked by static analysis, and run a
   second time, each step passing over the mutants already settled. A
   mutant is judged in parts only where `timeouts.most` stopped it, not its
   silence limit or a test's own limit.

6. **A verdict stands only for the release that judged it.** `Passed` records
   the release of the gate, as its version spells it, and a plan that runs
   nothing stands on it only where the release that runs now is that one, or
   both are builds of a branch: moving such a build changes the gate's PHP or
   the project's lock, either of which refuses the verdict by itself. A ledger
   that does not say which release passed stands for nothing.

7. **`doctor` advises a schedule.** A GitHub workflow runs the gate and none
   has a `schedule` trigger: a full run on a schedule is what reaches the units
   no change does (`no-scheduled-run`).

8. **A learned `timeouts.multiple` is in the key.** It is rounded up to a whole
   number, and the plan hands every shard that number and keys every unit with
   it. A result is keyed by the limit it ran under, and a key moves only when
   the 99th percentile crosses a whole number, not with each kill the ledger
   learns.

9. **A timeout is a kill only with headroom.** `timeouts.headroom`, a tenth of
   the limit unless written, is the share of a timed-out mutant's limit its
   tests must leave unused when run unmutated. Tests that take 9.8 s of a 10 s
   limit may time out by chance, so the mutant is too slow to judge.

## Alternatives considered

- **Check only the killers' digests.** A carried kill by a timeout, by static
  analysis or by a run that failed names no test, so a weakened test would
  still be carried for it.
- **Read what changed since each proof's commit from git.** It needs every
  file the proof's commit held, and a proof whose commit is gone could not be
  checked at all; the digests are already in the ledger.
- **Let a verdict stand where each proof it would keep is the newest of its
  path at the passing instant.** It is narrower but needs the default
  branch's history of every proof; refusing the shortcut costs one verdict
  job.
- **Leave a run that failed before any test unjudged.** Most such runs are a
  fatal error the mutant caused, and the kill stands on that.

## Consequences

**A weakened test is caught on the push that weakens it.** The units it
covers run every mutator, so a mutant it no longer kills survives in that
run's verdict.

**The ledger grows by one index per covering test file per proof.** Each
test file's digest is held once in the ledger's table of inputs.

**A monorepo's module reaches its own trees.** A changed test under a
module's directory reaches every tree of that module, as ADR-0005 says.

**A heavy mutant can be killed by static analysis or found flaky**, as any
survivor can, and one whose check could not run dooms no run.

## Related

- [ADR-0007](/docs/decisions/a-proof-is-keyed-by-everything-its-verdict-reads): what a proof records
- [ADR-0020](/docs/decisions/a-change-lists-its-tests-an-analyser-can-kill-and-a-huge-repository-can-be-sampled): survivors checked by static analysis
- [ADR-0065](/docs/decisions/a-changed-test-file-reaches-what-its-changed-tests-run): item 6, a changed test in a module
- [ADR-0103](/docs/decisions/a-doomed-shard-fails-fast): a survivor not yet checked dooms nothing
- [ADR-0106](/docs/decisions/carried-survivors-are-judged-again-and-their-re-check-is-bounded-and-shared): pruning never carries a survivor
