bug-age
Measures how long fixed bugs lived in a git repository, using only its history. A bug counts only when the commit that fixed it says so in its message (fix, bug, hotfix); a bug fixed under any other message, or never fixed, is not counted. For each counted bug it reports commits elapsed, calendar days, releases shipped, and churn between the commit that introduced it and the fix.
It uses two independent methods and compares them:
- Method A, blame-based (SZZ-style). Runs
git blameon the lines a fix changed and names the commit that last touched them as the likely introducer. This is fast and needs only git, but it can be wrong. Known failure cases: ghost commits, formatting-only changes, and introducers that were not the latest toucher. - Method B, behavioral sweep. Takes a regression test that fails before the fix and passes after it, then replays that test across history in a hermetic per-commit Docker environment. The result is the first failing commit, the last passing commit, and every untestable commit with a reason.
Every number comes from scripts. AI helped write the code, the Method B regression tests and the article prose, but no model produces or changes a number. See What is deterministic and what uses AI. bug-age supports Rust crates and Python projects.
What you get, and the three names the documentation uses for it:
- Report. What a run produces: the result files in
results/<name>/and one bundle,dist/<name>/bundle.json, which holds every number. Each repository you run gets its own report. - Explorer. A viewer. It is a static HTML page you build from one or more bundles to browse their reports. It holds no results of its own and runs no analysis.
- Live example. One explorer, built from the reports of the two example runs and published online. It is a snapshot: running bug-age on other repositories does not change it.
To see the output first, open the live example.
Requirements
- Python 3.11 or later, standard library only.
- git.
- Docker, only for the feasibility check and Method B.
- Linux or macOS, both tested in CI.
- It measures Rust crates and Python projects.
Install
From PyPI:
pip install bug-age
From a clone:
git clone https://github.com/jacob-adm/bug-age
cd bug-age
pip install .
Either way pip installs bug-age as a console script.
How it works
- Find the fixes. bug-age reads the commit history and lists every commit whose message says it fixes a bug (fix, bug, hotfix). A fix whose message doesn't say so is not counted.
- Find where each bug came from. For each fix, git shows which earlier commit last wrote the lines the fix changed. That commit is the likely cause (Method A).
- Count how long it lived. From that commit to the fix, bug-age counts the days, the commits and the releases that shipped with the bug.
- Check with a test, if you want. Write a test that fails before the fix and passes after it. bug-age runs it at older commits, in Docker, to see where it starts failing (Method B).
- Write one report. Everything goes into one file,
bundle.json, with every name and email removed.
Commands
bug-age catalog --repo DIR --path DIR [--profile rust|python (default rust)] [--head REV] [--out FILE]
bug-age szz --repo DIR --catalog FILE [--window-start YYYY-MM-DD] [--release-tags GLOB] [--out FILE]
bug-age sweep --repo DIR --path CRATE --fix SHA --overlay DIR --test CMD
[--build CMD] [--start SHA] [--runner docker|local] [--repeats N] [--image IMG]
[--time-travel-script FILE|none] [--scratch DIR] [--logs DIR] [--out FILE]
[--namespace NAME] [--bucket N (toolchain minor rounding, default 4; 0 = exact)]
[--step-timeout SECONDS (per fetch, build or test step; default 3600)]
[--search bisection|exhaustive (exhaustive tests every commit; only it can report located)]
[--profile rust|python] [--install SPEC (python, docker runner; default .)] [--test-deps A,B (python, docker runner; default pytest)]
bug-age probe --repo DIR --path CRATE --commits SHA,SHA,... --overlay DIR --test CMD [same options]
bug-age bundle --repo DIR --results DIR --repo-url URL --out DIR [--spike DIR] [--out-of-scope 'STAGE|EVIDENCE|DOES_NOT_PROVE']
bug-age explorer [--page FILE] --targets NAME=DIR,NAME=DIR --out DIR (DIR = a bundle output dir)
bug-age mcp --bundles NAME=FILE,NAME=FILE (read-only MCP server on stdio over bundle.json files)
bug-age pipeline TARGET.toml [--fresh] [--skip-feasibility] (every stage for one target)
bug-age dockerfile (print the Method B image's Dockerfile: bug-age dockerfile | docker build -t bug-age-spike:4 -)
Every command accepts only its own options; see Commands for what each one does.
Quick start
pip install bug-age
mkdir -p targets && curl -so targets/myrepo.toml https://raw.githubusercontent.com/jacob-adm/bug-age/main/targets/rust-sdk.toml
# edit targets/myrepo.toml: name, repo_url, head, crate_path (see Getting started)
bug-age pipeline targets/myrepo.toml --skip-feasibility # Method A only, no Docker
The report is results/myrepo/PIPELINE.md, and every number is in dist/myrepo/bundle.json.
Getting started walks through each step, Method B included.
Documentation
- Getting started: install, describe your repository in a config file, run every stage, read the report and browse it.
- Commands: what each command does, the pipeline and its config file, and unattended sweeps.
- Example runs: the tokenizers and rust-sdk runs, what the explorer shows, and how to read Method B verdicts.
- Method: how bugs are found, what is deterministic and what uses AI, and the rigor rules.
- Timings: how long each stage takes on the example runs.
- Security: what the local and Docker runners isolate and what they do not.
- Versions: 1.0.2, the last Rust version; 2.x, the Python package.
- Contributing: tests and how changes reach
main.
License
Licensed under either of Apache License, Version 2.0 or MIT License, at your option, as declared in pyproject.toml.
Metadata
Release files for bug-age 2.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bug_age-2.2.2.tar.gz | 581.8 kB | With provenance | Details for bug_age-2.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bug_age-2.2.2-py3-none-any.whl | Python 3 | none | any | Details for bug_age-2.2.2-py3-none-any.whl |
Total release size: 684.5 kB
Release files / bug_age-2.2.2.tar.gz
| Download URL | bug_age-2.2.2.tar.gz |
|---|---|
| Size | 581.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6b33955b713f4d60071817e5ec0555c316a2a7812c65fe27469dd6981fb49c3
|
|
BLAKE2b-256 checksum How to use checksums |
d95719e665a7f931cafa6d2deae138405eb00317fbe6022e79bbd87dea3aade3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logRelease files / bug_age-2.2.2-py3-none-any.whl
| Download URL | bug_age-2.2.2-py3-none-any.whl |
|---|---|
| Size | 102.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86ef8d16d7333df22557504ef85150715654020bc6f553dd5374ef5da039c4c7
|
|
BLAKE2b-256 checksum How to use checksums |
0ce8c3407a248d3144cc2787b95201c9343a3758eb5bae6b3f07e4b59c95d385
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 24, 2026.
Transparency logSecurity for bug-age 2.2.2
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
Both files in this release have been uploaded with provenance metadata.
Attestation for bug_age-2.2.2.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 Nov 24, 2026.
Transparency logA 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.