Skip to main content

fermut

Agent-first mutation testing for Python — Rust-fast, ty-aware.

Line coverage tells you which lines run. fermut tells you which lines your tests actually check.

CI PyPI Python Docs License: MIT OR Apache-2.0 Rust 1.83+

$ fermut run src/ --tests tests/

SURVIVED  src/auth.py:42 [boundary-shift] `age >= 18` → `age > 18`
TIMEOUT   src/slow.py:88 [arith-op-swap]  `n * 2`    → `n / 2`

152 mutants — killed: 140, survived: 8, timeout: 1, skipped: 3 (coverage 3), equivalent: 0, errored: 0  | score: 94.6%

Each SURVIVED line is a real gap: a change to your source that your tests didn't notice. fermut makes thousands of these small edits (<= → <, + → -), re-runs your suite against each, and reports the ones that slipped through. In short — it answers "are my tests any good?"

  • ⚡ Fast — native-Rust hot loop, ty pre-filter drops type-invalid mutants before they ever reach pytest, per-test coverage selection runs only the tests that touch each mutant.
  • 🤖 Agent-first — machine-readable JSON reports, deterministic mutant IDs, next/explain/score subcommands built for a coding agent in the loop.
  • 🔁 Incremental — cache-friendly warm runs (~35× on unchanged code), --diff-only scopes mutation to lines changed vs main.
  • 🚦 CI-ready — non-zero exit when any mutant survives, wire it straight into a pull-request gate.

Hot loop is native Rust; the test runner stays Python (pytest or unittest). Built on Astral's ruff_python_parser for mutant generation and ty for type-awareness. Humans welcome too.

Quickstart

# install — pick the path that matches you
uv tool install fermut                                             # prebuilt wheel from PyPI, no Rust needed
cargo install --git https://github.com/KovantAI/fermut --locked    # from source: needs Rust + ~2 min first compile

# in your project (needs pytest, coverage, pytest-cov, ty on the same PATH — see Installation)
fermut init                     # detect source/tests/runner, write fermut.toml

# fermut init wires per-test coverage when pytest-cov is present;
# generate it before the first run (skip if your config has no `coverage` key):
pytest --cov=src --cov-context=test    # writes .coverage; fermut auto-discovers it at the project root
# (or, manually: coverage json -o coverage.json --show-contexts, then --coverage coverage.json)

fermut run src/ --tests tests/  # first mutation report (add -q to silence progress logs)

For a CI gate, generate the opinionated profile instead — diff-only + coverage + a narrow operator set, tuned to fail fast on pull requests:

fermut init --profile pr-gate   # writes a CI-shaped fermut.toml (needs git + .coverage)

It scopes mutation to lines changed vs main, so run it inside a git checkout with that base available — see CI quickstart.

Install paths. Prebuilt wheels ship to PyPI, so uv tool install fermut (or pipx/pip install fermut) is the no-Rust path. The cargo install --git path (Rust required) builds from source — for hacking on fermut or platforms without a prebuilt wheel. Full prerequisites in Installation.

Why fermut

On typer (~2,200 mutants, cold run, same machine):

Tool Time Mutation score
fermut 164s 71.5%
mutmut 298s 70.5%

fermut is faster and higher-scoring here — its ty pre-filter and per-test coverage selection cut wall-clock without dropping rigor. The win is suite-shaped: on tiny pure-Python libraries with fast full suites (e.g. more-itertools) mutmut's simpler model still wins. Full numbers, the repos where mutmut wins, and methodology: benchmarks.

Documentation

Full documentation lives at https://fermut.readthedocs.io/, sourced from the docs/ directory in this repo.

Start here:

Status

fermut is pre-1.0. The CLI, config schema, and JSON report shape may change between 0.MINOR releases. See VERSIONING.md for the full contract.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.

Metadata

Release files for fermut 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fermut 0.5.0
File Size Uploaded Provenance Actions
fermut-0.5.0.tar.gz 445.8 kB With provenance Details for fermut-0.5.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fermut 0.5.0
File Actions
fermut-0.5.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for fermut-0.5.0-py3-none-win_amd64.whl
fermut-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for fermut-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
fermut-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for fermut-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
fermut-0.5.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for fermut-0.5.0-py3-none-macosx_11_0_arm64.whl
fermut-0.5.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for fermut-0.5.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 66.1 MB

Release files / fermut-0.5.0.tar.gz

Download URL fermut-0.5.0.tar.gz
Size 445.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9482e5fea12fc9c2c889c7de76db598a81f5de3c43bb06fcbf15b8b260a22f27
BLAKE2b-256 checksum
How to use checksums
2e257974d7aeb964cfb26414c0a24d0696099c34f52ce0dfb10dce19a8a9d8c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / fermut-0.5.0-py3-none-win_amd64.whl

Download URL fermut-0.5.0-py3-none-win_amd64.whl
Size 13.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a57e0ad1700a0aa3704227269d5dfedacbe865e416e2dcc8c3021c17cb693e0c
BLAKE2b-256 checksum
How to use checksums
dc52acc4c9b2969902d205d99e590c31c2f682a9e428e0cc40b5cc3ac5cea642
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / fermut-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL fermut-0.5.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 13.4 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
cc53fe299f847046cba95638465645fe29c5f059d317e3290aed173f4aeb65d5
BLAKE2b-256 checksum
How to use checksums
4f79f69eb9787af4118f93f1af1d3223faee87e5109c2880755da527ce9f4c1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / fermut-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL fermut-0.5.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 12.8 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
0ddfe4a7c5a6ee9d52335d737775a2f81c5708ac17fb03a25fa0b8699646d0ca
BLAKE2b-256 checksum
How to use checksums
d91a5b51897b74ce52d162ac0549110ab16cf17eba94f5f0dfc97cd1fb3e6e1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / fermut-0.5.0-py3-none-macosx_11_0_arm64.whl

Download URL fermut-0.5.0-py3-none-macosx_11_0_arm64.whl
Size 12.5 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
252f7133c72f139707c4f11cf26914476025f555d7eec9fa1a7e9ae8ebcb6c8a
BLAKE2b-256 checksum
How to use checksums
309ec2ead32137b9681051a95d4845fb26abd0f9306760ae6c5e1d89917723b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / fermut-0.5.0-py3-none-macosx_10_12_x86_64.whl

Download URL fermut-0.5.0-py3-none-macosx_10_12_x86_64.whl
Size 13.2 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
885d9f32f5b4800cbd5f3eab2510fbd5af9c96c274aee17e3d7c57645b1b7bbc
BLAKE2b-256 checksum
How to use checksums
b1c3e24c50c74909c67165295d05464ac726f72bdeeadd2b91613865206fb89a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Security for fermut 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for fermut-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page