ADR-0076: A ledger tallies what each mutator costs and finds, and config:suggest proposes changes
Status: Accepted
Date: 2026-11-04
Amends: 0007: what a ledger holds beside its proofs; 0024: what summary.json and the dashboard show
Context
A mutator costs runner time on every run and is worth that time only when its mutants find gaps. The gate keeps what each mutator's newest mutants came to for pruning (ADR-0025), but only as a window of outcomes: it knows nothing of the time a mutator takes, of how many of its mutants an ignore left out, or of its history past that window. A team that wants to know which mutators to turn off, or which code needs a longer timeout, reads logs and guesses.
Decision
The ledger tallies each mutator's mutants under each runner. An optional
tallysection holds, by the runner's name and then the mutator's, how many mutants it made, how many were killed, survived (a survivor or an uncovered mutant) or were ignored (by the ignore list, the runner's own marker or proof of equivalence), and the runner seconds they took. Every run that writes a ledger and judges every mutant itself, with no narrowing, adds the mutants of each shard to it, each as the verdict judged it. A mutant's seconds are its share of the time its shard spent mutating, weighted as the cost model weights units, so a runner whose mutants carry no duration of their own, as Infection's do not, is still timed. Losing the section loses the report, never a verdict, so the ledger's format does not count it: an older ledger reads as tallying nothing and keeps its proofs.The ledger's learned sections are one value. The kill history, what the static analysers came to, the pruning windows and the tally are
Learned, which a ledger holds beside its proofs, timings, bases and runs.mutation-gate mutatorsreports the tally. One row for each mutator of each runner, the costliest first: mutants, kill rate (killed over judged), survivors, seconds, seconds per kill and share of every mutator's time.--format=jsonis"format": 1, whichresources/mutators.schema.jsondescribes. It reads the default branch's ledger, or theledger.json.gzthat--ledgernames, and runs and writes nothing.summary.jsonnames the ten costliest mutators, and the dashboard shows them. An optionalmutatorsfield holds each one's runner, name, seconds, survivors and kill rate, as the default branch's ledger tallied them when the publishing run began. The dashboard shows each repository's in a collapsed list under its row. A summary without the field renders as before, so the summary keeps"format": 1.config:suggestproposes changes by three rules, and never applies them. The mutator rules read the tallies of the runner the config chooses, and share out only that runner's time.- An idle mutator, with at least
suggest.idle.judged(500) mutants judged, at mostsuggest.idle.survivors(0) survivors and at leastsuggest.idle.share(5) percent of every mutator's time, costs time and finds nothing:mutators.exceptturns it off. - A noisy mutator, with at least
suggest.ignored.mutants(50) mutants of which at leastsuggest.ignored.share(80) percent were ignored or equivalent, makes noise:mutators.exceptturns it off. - A slow directory, where at least
suggest.timeouts.cluster(3) mutants of the newest proof of each unit ran out of time, gets apathsentry (ADR-0074) that doubles its files'timeouts.seconds, raisingtimeouts.mostwhere it would fall below.
Each suggestion prints with its evidence. A change the config cannot say, such as turning off a mutator only the runner's own set holds, is named with why, and left out. Then the config file, with every other change laid over it, prints as a unified diff in the file's own format, as the gate writes that format; a project with no config file sees
mutation-gate.jsonadded. It writes nothing and exits 0.- An idle mutator, with at least
Alternatives considered
- Reading cost from the proofs. A proof keeps a killed mutant as a kill, without its duration, and holds only the newest results, so the history and the time of the mutators that matter most would be lost.
- Applying suggestions with a
--writeflag. A suggestion rests on history that a change of code or tests can make stale, and a config change re-keys proofs; a person reads the evidence and applies the diff. - Publishing the whole tally. The dashboard needs only the costliest
few, and
summary.jsonis public, read by every dashboard.
Consequences
A team sees what each mutator is worth. The report and the dashboard name the mutators that cost the most and how much they find.
The tally grows with history. It holds one entry for each mutator of each runner, never one for each mutant, so a ledger grows by a few kilobytes at most.
Suggestions are only as good as the history. A new project, or a
ledger without the section, tallies nothing, and config:suggest suggests
nothing until runs have written one.