Metadata-Version: 2.4
Name: tenthcheck
Version: 0.2.1
Summary: Tenthcheck, from Tenthlook: see what an AI coding agent's edit could break before it lands. Blast radius and Z3 counterexamples for Python. CLI, MCP server and editor hook.
License-Expression: MIT
Project-URL: Homepage, https://tenthlook.com
Project-URL: Repository, https://github.com/axiom-csc/tenthcheck
Project-URL: Issues, https://github.com/axiom-csc/tenthcheck/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: sqlglot>=25
Requires-Dist: z3-solver>=4.12
Requires-Dist: tomli>=2; python_version < "3.11"
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.3; extra == "mcp"
Provides-Extra: receipt
Requires-Dist: tenthlook-core>=0.1; extra == "receipt"
Dynamic: license-file

# Tenthcheck

Tenthcheck, from Tenthlook. When an AI coding agent edits your Python, it shows **what the edit touches** (the blast radius of
the changed symbols) and checks **numeric invariants you write with Z3**, returning the exact counterexample when one breaks.
It runs as a CLI, an editor hook / MCP server and a GitHub Action. No LLM and no network: it runs offline and no API key is involved.
Python only.

## Quickstart (60 seconds)

```
pipx install tenthcheck        # or: uvx tenthcheck
cd your-repo && tenthcheck     # blast radius of your uncommitted diff, plus any Z3 invariants in tenthcheck.toml
tenthcheck install --claude    # optional: register the MCP server and the Claude Code hook
```

`tenthcheck` with no arguments looks at your uncommitted diff, prints the changed symbols and every symbol that depends on
them, then checks any Z3 invariants in `tenthcheck.toml` (`tenthcheck init` writes a template). On a one-line edit to
starlette's `HTTPConnection.url_for` it found 2 changed symbols, 469 dependents of `HTTPConnection` and 7 of `url_for`
(`results/impact_timing.jsonl`).

## Example output

An invariant in `tenthcheck.toml` for `bank.py::withdraw`, checked with Z3:

```
$ tenthcheck verify bank.py::withdraw "final_balance >= 0" --assume "balance >= 0" --assume "amount > 0" --assume "fee >= 0"
VIOLATED withdraw  [final_balance >= 0]: counterexample found, Z3, 31 ms
        inputs: balance=0, amount=1, fee=0
        then:   final_balance=-1
```

## What Tenthcheck does not do

- **Python only.** No TypeScript, JavaScript or SQL files (SQL is read only from Python string literals).
- Z3 checks **only simple numeric functions**: no loops, calls, I/O, `//`, `%`, strings or containers; floats are modelled as exact reals.
- **Mined invariants are candidates, not proofs.** Many are intentional, and a guard written in another form (inside the function
  body, in middleware, in a framework hook) is not recognised, which causes false positives.
- It does not guarantee your code is correct, and a receipt only records what was checked.
- It does not fix code. It tells you (or your agent) where and, for Z3, with what inputs.
- `tenthcheck impact` is still slow after an edit on very large repositories (see Measured).
- The GitHub Action has not been run on GitHub.

---

## More

- [Reference](https://github.com/axiom-csc/tenthcheck/blob/main/docs/REFERENCE.md): every command, the Z3 subset, agents and hook setup, the GitHub Action, receipts, limits.
- [Measurements](https://github.com/axiom-csc/tenthcheck/blob/main/docs/MEASUREMENTS.md): timings, precision on real repositories, the mining negative result, with sources.
- [Changelog](https://github.com/axiom-csc/tenthcheck/blob/main/CHANGELOG.md)

MIT licensed.
