Skip to main content

Cordis (cordis-verify)

Adversarial AI-PR verification engine: catches hollow assertions, test tampering, mock abuse, and surviving AST mutants before code reaches human review.

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 demo

Or from a local checkout:

python -m cordis.cli demo

This 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 432 tests ... OK on this checkout with Python 3.13.4 (baseline 373 tests 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.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 cordis-verify 0.4.0
File Size Uploaded Provenance Actions
cordis_verify-0.4.0.tar.gz 231.5 kB With provenance Details for cordis_verify-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 358.6 kB

Release files / cordis_verify-0.4.0.tar.gz

Download URL cordis_verify-0.4.0.tar.gz
Size 231.5 kB
Tags Source
SHA-256 checksum
How to use checksums
34eb924357a95283d1ddb897d3a0d1a7c51df72f4e2f2c09347b3ba2e6ec8256
BLAKE2b-256 checksum
How to use checksums
3e485923ba673bc33fa83ea097a7bf025c5f1ad845d1890b42e2021babea2a85
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 30, 2026.

Transparency log

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

Download URL cordis_verify-0.4.0-py3-none-any.whl
Size 127.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d12ad3e320933e2dc76a418d7772b419d1df979f110e5fbbbd4cc83d6d6ef1b5
BLAKE2b-256 checksum
How to use checksums
2e27ba6bac6f0ce9b7b1b37f9707af138afdf0cad15bd1ad71ad9465e8b70544
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 30, 2026.

Transparency log

Security for cordis-verify 0.4.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cordis_verify-0.4.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 Nov 30, 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