Skip to main content

Prove AI-written code, refute it with the exact failing input, or honestly abstain. Never guesses. Runs locally.

Project description

ishvacerto

CI License: MIT Python 3.9+ Zero dependencies

Prove your AI-written code — or get the exact input that breaks it. Never a guess.

AI coding assistants are fast, but they ship confident bugs and hallucinated behavior. ishvacerto is the gate that sits on top of them: give it a function and a way to check it (its own doctests, your tests, or a reference implementation), and it returns one of three answers — never a plausible-sounding maybe:

  • VERIFIED — it passed the spec (with a witness).
  • REFUTED — it fails, and here is the exact input that breaks it.
  • 🤷 ABSTAIN — no checkable spec could be captured, so it says so honestly instead of rubber-stamping.

It runs entirely on your machine. Your code never leaves it. No account, no cloud, no telemetry. Pure standard library — zero dependencies.

Why

A code suggestion you can't verify is a liability. ishvacerto does the one thing an LLM structurally cannot: it proves or refutes by execution, and when it can't, it abstains rather than bluff. It doesn't compete with your AI coder — it makes its output safe to ship.

Honest scope: ishvacerto verifies what it can check (functions with doctests, tests, or a reference), and abstains on the rest — it never false-alarms on correct code. "Never wrong, sometimes silent." Coverage grows as you give it more to check against.

Install

pip install ishvacerto

Use

Verify against the code's own doctests:

ishvacerto my_function.py

In Python:

from ishvacerto import verify, verify_against_reference

verify(open("f.py").read())                     # uses doctests if present
verify(code, tests=[("f(3)", "9"), "assert f(0) == 0"])   # against your tests
verify_against_reference(ai_code, known_good_code, "f")   # where does the AI code diverge?

Differential — the high-leverage mode (no tests needed, just a reference):

ishvacerto --ref reference.py --entry my_func ai_generated.py

ishvacerto generates inputs, runs both, and shows the first input where they disagree.

In CI (exit code 1 on REFUTED):

# .github/workflows/verify.yml
- run: pip install ishvacerto
- run: ishvacerto changed_function.py

Example

$ ishvacerto buggy.py
REFUTED [doctest]  fn=square  counterexample: square(3)  (got 6, expected 9)

There's the bug — square(3) returned 6, not 9. Not "looks suspicious." The exact failing input.

How it decides

  • VERIFIED only if the captured spec passed on every input it could exercise.
  • REFUTED only on a clean mismatch — and it tells you the input.
  • ABSTAIN if it couldn't capture a usable spec (the discipline that keeps it from false-alarming on good code).

Differential runs are sandboxed in a separate process with a timeout. The timeout guards against hangs; it is not a security sandbox for hostile code — verify code whose source you trust (e.g. your own assistant's output), or run it in a container.

License

MIT — see LICENSE.

Status

v0.1 — the verify-or-abstain core. On the way: richer spec capture (a reference proposer so it covers code that ships with no tests), more language targets, and an editor extension. Contributions welcome.

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

ishvacerto-0.1.1.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

ishvacerto-0.1.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file ishvacerto-0.1.1.tar.gz.

File metadata

  • Download URL: ishvacerto-0.1.1.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for ishvacerto-0.1.1.tar.gz
Algorithm Hash digest
SHA256 30a2686cb1e443852986f049a4f32b1f4292adc8c5b7599e8ac6124e6295221a
MD5 2c5c3785d59fbbdd2c6a2f780e0d722a
BLAKE2b-256 c6fd33ae30affede75f20d50e459ac4508c0a57730769bef8bd49a676134a7e2

See more details on using hashes here.

File details

Details for the file ishvacerto-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ishvacerto-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for ishvacerto-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33f845815974aac6485b264603e43059b6694c954826df43808499579d38936c
MD5 b45ca1645469b4515d5cc82e4c607ad1
BLAKE2b-256 9d09f57c40a7cfa76cbcdda10c0dd7388012c21c663f696f6d031da7d731b5d6

See more details on using hashes here.

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