Python quality workflow for agentic AI-driven development (CRAP, mutation, Gherkin gates)
Project description
agentic-test-forge
Python quality enforcement for AI-generated and legacy codebases. Implements Uncle Bob Martin's workflow: CRAP analysis, mutation testing, and Gherkin scenario mutation, optimized for agentic development and CI gates.
Status
v1.1 Phase A — PyPI publish in progress (#64).
| Command | Status |
|---|---|
forge crap |
Available |
forge mutate |
Available (Linux/WSL; mutmut does not run natively on Windows) |
forge mutate-gherkin |
Available |
forge check |
Available (includes optional advisory DRY scan) |
Install
pip install agentic-test-forge
Pin a version:
pip install agentic-test-forge==1.0.0
For local development of this repo:
pip install -e ".[dev]"
Alternative (VCS install):
pip install "agentic-test-forge @ git+https://github.com/cheezd/agentic-test-forge.git"
Usage
forge --help
forge crap --path src/ --threshold 30
forge mutate --path src/ --base main --threshold 80
forge mutate-gherkin --path features/ --base main --threshold 80
forge check --path src/ --features-path features/
Run tests with coverage, then the full quality gate:
pytest --cov=src
forge check --path src/ --json report.json
Differential mutation uses git diff against --base (default main) and skips unchanged files tracked in .forge/mutation-manifest.json. Use --full to ignore the manifest.
Gherkin mutation mutates Examples table cells in changed .feature scenarios, runs the configured acceptance test command, and tracks results in .forge/gherkin-manifest.json.
Thresholds are gate cutoffs, not comparable scales: crap_threshold is a maximum CRAP score per function; mutation_threshold and gherkin_threshold are minimum mutation kill rates (0–100%). See score interpretation for what the numbers mean.
Configure per-project thresholds in pyproject.toml:
[tool.forge]
paths = ["src"]
crap_threshold = 30
crap_formula = "standard" # standard | simplified
manifest_dir = ".forge"
mutation_threshold = 80
mutation_base_ref = "main"
mutation_test_cmd = "pytest"
gherkin_threshold = 80
gherkin_base_ref = "main"
gherkin_test_cmd = "behave"
gherkin_runner = "behave" # behave | pytest
gherkin_paths = ["features"]
[tool.forge.gates]
crap = true
mutation = false
gherkin = false
dry = true # advisory — does not fail forge check
Optional local override: you do not need forge.toml for normal use — [tool.forge] in
pyproject.toml is enough (including consumer repos). If present, a forge.toml in the
current working directory is merged on top of pyproject.toml (useful for uncommitted
experiments, e.g. stricter thresholds on your machine). Unlike pyproject.toml, forge does
not search parent directories for forge.toml; run from the directory that contains it, or
rely on pyproject.toml only.
Consumer CI integration: see docs/consumer-ci.md.
Development
pip install -e ".[dev]"
pytest
ruff check .
mypy src
Domain language
Architecture decisions
Package layout, dependency direction, and refactor conventions: docs/adr/0001-package-boundaries-and-refactor-conventions.md.
License
Licensed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later).
What this means in practice:
- Modifications to forge must be shared under LGPL when you distribute them.
- Using forge to check your code — via CLI in CI, locally, or on build servers — does not require your application or SaaS product to become open source.
- Importing forge as a library in a proprietary product is generally permitted under LGPL (unlike GPL), subject to LGPL’s requirements (e.g. allowing replacement of the library).
We deliberately use LGPL, not AGPL, so network/SaaS deployment of your product does not trigger additional copyleft beyond the library itself. This is not legal advice; consult counsel for your specific deployment.
Roadmap
- Foundation & CLI shell — done
- CRAP analyzer (radon + coverage.py) — done
- Differential code mutation (mutmut) — done
- Gherkin mutation — done
- Quality gate orchestrator (
forge check) — done - DRY flagging, consumer CI guide, polish — done
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentic_test_forge-1.0.0.tar.gz.
File metadata
- Download URL: agentic_test_forge-1.0.0.tar.gz
- Upload date:
- Size: 56.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbf5699d7bb1c4b20bd98cf3c5dd2edddb342d341891c246303424ecbb3ca619
|
|
| MD5 |
c8bbbc25263f7083de5f36370b25dd63
|
|
| BLAKE2b-256 |
e63ace74a3b73299bb27ef881051f130ae3e6e1384524ecc24e89f92f3b0753c
|
Provenance
The following attestation bundles were made for agentic_test_forge-1.0.0.tar.gz:
Publisher:
publish.yml on cheezd/agentic-test-forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_test_forge-1.0.0.tar.gz -
Subject digest:
dbf5699d7bb1c4b20bd98cf3c5dd2edddb342d341891c246303424ecbb3ca619 - Sigstore transparency entry: 1643810150
- Sigstore integration time:
-
Permalink:
cheezd/agentic-test-forge@df778af82bd18e54cf89a3e92b7a2c0ce008d98b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/cheezd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df778af82bd18e54cf89a3e92b7a2c0ce008d98b -
Trigger Event:
push
-
Statement type:
File details
Details for the file agentic_test_forge-1.0.0-py3-none-any.whl.
File metadata
- Download URL: agentic_test_forge-1.0.0-py3-none-any.whl
- Upload date:
- Size: 49.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd43cc9d8d5eb160013df3675b6ffeb79934211a4a7f8f037951e6d7bc056bd8
|
|
| MD5 |
f182b98908b8fe7d35d10525d5147066
|
|
| BLAKE2b-256 |
0ee57f9177b39362fe3974da623aecdd671207f812063a6c8046a18b9dfe43a0
|
Provenance
The following attestation bundles were made for agentic_test_forge-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on cheezd/agentic-test-forge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_test_forge-1.0.0-py3-none-any.whl -
Subject digest:
cd43cc9d8d5eb160013df3675b6ffeb79934211a4a7f8f037951e6d7bc056bd8 - Sigstore transparency entry: 1643810231
- Sigstore integration time:
-
Permalink:
cheezd/agentic-test-forge@df778af82bd18e54cf89a3e92b7a2c0ce008d98b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/cheezd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@df778af82bd18e54cf89a3e92b7a2c0ce008d98b -
Trigger Event:
push
-
Statement type: