Skip to main content

Cordis (cordis-verify)

Cordis (cordis-verify) catches weakened assertions, test tampering, mock abuse, and surviving AST mutants in AI pull requests with zero LLM tokens and zero code egress.

Zero external runtime dependencies on Python 3.11+ (pyproject.toml declares dependencies = []; Python 3.10 has an optional tomli fallback with a built-in minimal TOML parser if tomli is absent). Runs offline with zero LLM tokens.

The Problem

AI coding agents optimize for one signal: making the test command exit 0. Standard CI (pytest, unittest, line coverage) and Fail-to-Pass checks still report green when an agent:

  • Weakens an equality check into a hollow assertion (assert result is not None or assert True)
  • Tampers with tests (@pytest.mark.skip, deleted assertions, assert x == x)
  • Abuses mocks (@patch on the function under test so real logic never executes)
  • Overfits a single input or drops boundary guards while leaving AST mutants alive

Cordis runs deterministic AST anti-tampering checks, diff-scoped AST mutation testing, and differential edge-case fuzzing against your base commit.

Try It in One Command

uvx cordis-verify verify-git --base-ref HEAD~1

Run it inside a git repository with at least two commits. The published v0.4.0 wheel does not ship the demo fixtures, so the self-contained demo needs a source checkout (python -m cordis.cli demo) until the next release; wheels built from main now bundle those fixtures.

From a local source checkout:

python -m cordis.cli demo

python -m cordis.cli demo runs a self-contained comparison between a counterfeit AI patch (single-input overfit + weakened assertion) and a verified fix across Gates 1–3, then prints a terminal scorecard and writes cordis_report.html.

Honest Proof

Every metric below is tracked with its exact reproduction command in docs/CLAIMS.md:

  • 5-archetype synthetic benchmark (python -m cordis.cli benchmark, fixtures in experiments/benchmark_suite.py):
    • Standard pytest / coverage: 0/5 caught
    • SWE-bench Fail-to-Pass (git revert): 1/5 caught
    • Cordis 4-Gate AST Prosecutor: 5/5 caught (128.34 ms on the recorded run; LLM Diff Reviewers: 0/5 in the report is a methodological characterization, not an executed tool run)
  • Engine test suite (python -m unittest discover -s tests -q): Ran 440 tests ... OK on this checkout with Python 3.13.4 (earlier v0.3.0 baseline recorded in docs/CLAIMS.md)
  • Upstream catches (verified via GitHub API on 2026-11-30 in docs/audits/UPSTREAM_PR_STATUS.md):
    • anthropics/anthropic-sdk-python#2053 — submitted PR, open / unmerged (state=open, merged=false)
    • 567-labs/instructor#2878 — closed without merge on 2026-11-05, with its test-gap content consolidated into merged 567-labs/instructor#2912 (merged=true, 2026-11-05)

See docs/BENCHMARKS.md for the full breakdown and scope caveats.

Install & Verify Your Repo

# Install the CLI (`cordis` and `cordis-verify`)
uv tool install cordis-verify
# or:
pip install cordis-verify
# Initialize optional cordis.toml + git pre-commit / Claude Code hooks
cordis init --dry-run
cordis init

# Prosecute local working-tree or branch changes against HEAD~1
python -m cordis.cli verify-git --base-ref HEAD~1

# Probe a single Python function and suggest mutant-killing assertions
python -m cordis.cli probe --source path/to/module.py --test tests/test_module.py --func target_fn --suggest-test

Pipeline & Current Scope (v0.4.0)

Gate / Module Scope & Status What It Verifies
Gate 0: ForgeGuard & Hooks (cordis/forge_guard.py, cordis/policy_guard.py, cordis/hooks.py) Production CI actor provenance, repo contributor policy checks, and local pre-commit / PreToolUse / Stop anti-bypass guards.
Gate 1: AST Anti-Tamper & MAR (cordis/ast_gate.py) Production (Python) 64-bit BLAKE2b structural anchors, deleted/weakened assertions, target mocking, @skip, and Weighted Mock-to-Assertion Ratio.
Gate 2: Diff-Scoped AST Mutation (cordis/mutator.py, cordis/repair.py) Production (Python) Mutates modified functions, runs repo tests (or in-memory fallback), and flags surviving mutants as hollow tests.
Gate 3A: Differential Fuzzing (cordis/fuzzer.py) Production (Python) 200-input edge-case matrix (NaN, -0.0, boundaries, empty collections) comparing base_ref vs. candidate; reports SKIPPED if non-importable in-process.
Gate 3B: Mann-Whitney U Latency (cordis/fuzzer.py) Demo / Library Available in demo and library API; intentionally marked SKIPPED in verify-git to avoid shared-CI timing noise.
TS / JS / Go / Rust Gate 1 (cordis/ts_gate.py, cordis/polyglot_gate.py) Experimental (Lexical) Regex/lexical tampering scanners only — not full AST parsers. Gate 2 mutation in verify-git is Python-only.

Project Configuration (cordis.toml) & CI

Optional cordis.toml at your repository root (generated by cordis init):

exclude_paths = ["migrations/", "generated/", "docs/"]
mar_threshold = 0.25
enabled_gates = ["gate0", "gate1", "gate2", "gate3a"]
# test_command = ["pytest", "-q"]

For GitHub Actions, see action.yml, .github/workflows/cordis.yml, and docs/CI_CD_INTEGRATION.md.

Documentation

License

MIT

Metadata

Release files for cordis-verify 0.4.1

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

Source distribution (sdist)

Source distribution for cordis-verify 0.4.1
File Size Uploaded Provenance Actions
cordis_verify-0.4.1.tar.gz 234.2 kB With provenance Details for cordis_verify-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cordis-verify 0.4.1
File Interpreter ABI Platform Actions
cordis_verify-0.4.1-py3-none-any.whl Python 3 none any Details for cordis_verify-0.4.1-py3-none-any.whl

Total release size: 362.5 kB

Release files / cordis_verify-0.4.1.tar.gz

Download URL cordis_verify-0.4.1.tar.gz
Size 234.2 kB
Tags Source
SHA-256 checksum
How to use checksums
66b2a94cde86eac51755523841ea033cb021963dde6a22546a87f3905f26ae35
BLAKE2b-256 checksum
How to use checksums
2a3dd3f3cd40a4786e59fce8b9692ce33c16afa2240fe4777dd0af75164f046f
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 Dec 1, 2026.

Transparency log

Release files / cordis_verify-0.4.1-py3-none-any.whl

Download URL cordis_verify-0.4.1-py3-none-any.whl
Size 128.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbbd3800b6fbdbf4b68d63dc4008471e2b3376441f83bcda285e7ab4a374bbff
BLAKE2b-256 checksum
How to use checksums
a7401a4ac8f8ee6e4891cf711ecf5f970bbe6a1ca6179deb65b2f1ca18eb0b78
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 Dec 1, 2026.

Transparency log

Security for cordis-verify 0.4.1

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.

Select from 2 files

Attestation for cordis_verify-0.4.1.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 Dec 1, 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