Skip to main content

Run the checks your AI coding agent claimed it ran, and block the merge on a false claim.

Project description

cngx

CI PyPI Python 3.10+ License: MIT

Your AI coding agent says "done, all tests pass." cngx runs what it claimed and blocks the merge when that is not true.

AI agents (Cursor, Claude Code, Codex, aider, Cline, PR bots) end almost every task with a confident summary: "Fixed it, all tests pass, ready to merge." They usually did not run anything. cngx reads that claim, runs the real checks, and compares. The verdict is bound to actual command output, so it cannot be satisfied by prose.

pipx install cngx
cngx quickstart          # 30s, no API keys, no setup
# in your repo: gate the agent's message against a real test run
cngx verify --output-file agent_message.md -- pytest

This is real, not a heuristic

Here is an unedited run against the live OpenAI API. A real gpt-4o-mini was asked to fix a bug, then write a PR status. It wrote:

"I have fixed the issues in the to_snake_case function ... After implementing the necessary changes, I ran the test suite, and all tests passed successfully. The code is now ready to merge."

It ran nothing. cngx ran the real tests and blocked it:

BLOCKED  Agent claimed the work is done, but verification failed.
  Agent said: "all tests pass", "tests pass", "ready to merge"
  Real result: FAILED (failures=2)
exit code: 1

Same command, three real outcomes:

The agent said Reality (cngx ran it) Verdict
"all tests pass, ready to merge" tests fail BLOCKED
"all tests pass" (its fix was wrong) 1 test fails BLOCKED
returns a correct fix tests pass VERIFIED

No baseline, no history, no config. True on the first response.

How it works

agent message ─┐
               ├─► cngx verify ─► run your real check (pytest, npm test, ...)
your command ──┘                     │
                                     ├─ parse the true result (passed/failed)
                                     ├─ read what the agent claimed
                                     └─ BLOCK if the claim and reality disagree
  • Reality wins. The overall pass/fail comes from the command's real exit code, never from the agent's words.
  • Catches the specific lie. If the agent says "12 passed" but the run says "9 passed, 3 failed", that mismatch is blocked too.
  • Works with any command. Anything after -- is your check: pytest, npm test, go test ./..., cargo test, make check, your own script.
  • Gives you the receipt. On a block it prints the real failing output, so you see exactly what broke.

Use it

Local, against the agent's last message:

cngx verify --output-file agent_message.md -- pytest -q

Pipe the claim in:

echo "fixed it, all tests pass" | cngx verify --stdin -- pytest

Gate an existing CI log instead of running (offline, no execution):

cngx verify --claim "all tests pass" --evidence-file pytest.log

In CI with the GitHub Action (blocks the merge on a false claim):

- uses: aadi-joshi/cngx@v0.2.0
  with:
    output-file: agent_message.md
    command: pytest -q

Exit codes: 0 verified, 1 blocked, 2 usage error.

What it is and is not

  • It binds a claim to a real run. If your command is a real test suite, a passing agent claim now means the tests actually passed on your machine or in CI.
  • It is not a substitute for a good test suite. cngx runs the checks you give it; if your tests are weak, a passing verdict only means those tests passed.
  • The offline --evidence-file mode trusts the log you hand it. Run the command directly (-- pytest) when you want cngx to produce the evidence itself.

Commands

Command Use
cngx quickstart 30s demo: a real false claim caught, no keys
cngx verify -- <command> Run the check, compare to the agent claim, gate the merge
cngx verify --output-file agent.md -- pytest Read the claim from the agent's message
cngx verify --evidence-file ci.log Gate an existing test log without running
cngx check -c policy.yaml --output-file agent.md Heuristic text policy lint (advanced, gameable; prefer verify)
cngx wrap -- aider / cngx watch Proxy an agent and watch session behavior drift (advanced)

Local-first

Runs entirely on your machine. Commands run in your shell as you. Nothing is uploaded. Optional trace history lives in .cngx/ (DuckDB). See proxy and privacy.

Docs

Created by Kavya Bhand and Aadi Joshi.

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cngx-0.2.0.tar.gz (208.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cngx-0.2.0-py3-none-any.whl (201.8 kB view details)

Uploaded Python 3

File details

Details for the file cngx-0.2.0.tar.gz.

File metadata

  • Download URL: cngx-0.2.0.tar.gz
  • Upload date:
  • Size: 208.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cngx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e6bbf17637b057ba2e65acd5d5f255d61159d538d75e4dbe33329a34eaf2863d
MD5 ad3c1917c5224e7a2f0d3a0b25b240fd
BLAKE2b-256 0b12adcf5bd183f357612e0c979b5b71e3d818e0c775db5c7bfa1eb3be7569f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for cngx-0.2.0.tar.gz:

Publisher: publish.yml on aadi-joshi/cngx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cngx-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: cngx-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 201.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cngx-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10e4615c907f232a13bbab8e1185f39147c928e565a291d71bebb6b1d7bfce70
MD5 529c49bdd78b7e0bc7704f0a6eef3358
BLAKE2b-256 7bdbcc5e8ff30072e20f03161537cb7068deffaf53654f251170c3c2effedb93

See more details on using hashes here.

Provenance

The following attestation bundles were made for cngx-0.2.0-py3-none-any.whl:

Publisher: publish.yml on aadi-joshi/cngx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page