This release is a pre-release and may not be stable for production use.
isitright
isitright is an evidence-first tool for stress-testing text-to-SQL evaluations.
Given reference and candidate SQL, the v0.1 engine will search for a valid
database state on which their outputs differ and emit a minimized, replayable
counterexample. A disagreement is evidence, not automatic attribution of fault.
Current status: Stage 4 review gate
The v0.1 candidate safely compares queries on the supplied SQLite database and runs a deterministic, schema-aware generated-state search. Search harvests referenced tables, columns, and literals and tries boundary, NULL, duplicate, join, filtering, and aggregation mutations in priority order.
Every generated state is checked against SQLite integrity and foreign-key rules,
an optional JSON Schema constraints document, and an optional trusted validator.
Finding no divergence is reported as AGREEMENT_ON_TESTED_STATES; it is not a
claim of equivalence. Findings are minimized across generated and background rows,
revalidated, and exported as deterministic counterexample.sql files. Suite mode,
ranked reports, and opt-in --fail-on policies are active.
Quick start
from isitright import check
result = check(
database="example.sqlite",
reference_sql="SELECT province FROM tribute ORDER BY province",
candidate_sql="SELECT DISTINCT province FROM tribute ORDER BY province",
)
print(result.headline)
print(result.original_state.outputs_match)
print(result.search.model_dump())
The CLI reads each query from a UTF-8 file and writes versioned JSON plus a concise Markdown rendering by default:
isitright check --database example.sqlite --reference gold.sql \
--candidate agent.sql --output-dir artifacts/check
When a counterexample is found, replay the emitted fixture and verify both recorded outputs without touching the source database:
cd artifacts/check
python -m isitright.replay --report case_report.json --fixture counterexample.sql
Development
Python 3.11 or newer is required. With uv installed:
uv sync --extra dev
uv run ruff check .
uv run mypy src
uv run pytest
uv build
The package exposes single-case and JSONL suite commands:
isitright --version
isitright check --help
isitright suite --help
isitright suite --database example.sqlite --cases cases.jsonl \
--output-dir artifacts/suite --fail-on domain-counterexample
Suite cases run independently and are ranked with domain-validated findings first,
then schema-only findings, inconclusive/unsupported cases, and observed agreement.
Both commands accept --fail-on none, domain-counterexample, or
any-counterexample; a matched opt-in policy exits with code 3 after artifacts
have been written.
The Stage 4 preview is versioned 0.1.0.dev5. It is intentionally a development
release and must not be presented as the complete v0.1 search engine.
Contract highlights
- Result statuses keep observed equivalence, state validity, and attribution separate.
- Unordered query results are compared as multisets, preserving duplicates.
- Automatic ordering honors a top-level
ORDER BYon either query; otherwise results are unordered. - Engine-native values are normalized into explicit, portable canonical kinds.
- JSON Schema and trusted callback validation are applied before generated states are admitted, and every rejection is counted by reason.
- Reports use schema version
0.1; package versioning remains pre-release until the v0.1 engine is complete.
Generation is intentionally bounded and lightweight. It creates small
insertions by adapting existing rows or synthesizing complete rows for empty
referenced tables, including required foreign-key parent rows. It does not perform
AST-diff-guided search or prove that exhausted candidates cover every admissible
state. Minimization is also bounded; if its budget is exhausted, the smallest
verified state found so far is returned with minimization_complete: false.
See the contract reference and the fixture proposal. The precise supported SQL surface and known limitations are documented in Supported SQL and limitations.
Contributions are welcome; see CONTRIBUTING.md. Security issues should follow the private reporting process in SECURITY.md.
License
MIT
Metadata
Release files for isitright 0.1.0.dev5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| isitright-0.1.0.dev5.tar.gz | 173.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| isitright-0.1.0.dev5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 213.6 kB
Release files / isitright-0.1.0.dev5.tar.gz
| Download URL | isitright-0.1.0.dev5.tar.gz |
|---|---|
| Size | 173.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0552d9a4d6019f60a88dedf0ffb0e79d98da743966b48a415f3b8f9d69616720
|
|
BLAKE2b-256 checksum How to use checksums |
716df41079aba5ee66b9e2ce38a0e8d08d94c0be4b551ac1e9733cb735318ce4
|
| 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 Oct 23, 2026.
Transparency logRelease files / isitright-0.1.0.dev5-py3-none-any.whl
| Download URL | isitright-0.1.0.dev5-py3-none-any.whl |
|---|---|
| Size | 40.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ea0f2c32ccde10ae23844dc3a76ca5dd1c7c6562459cb4ba3d495e08a45eb8f
|
|
BLAKE2b-256 checksum How to use checksums |
3ec566e543d3f73481b2fd797eededd33fa4150e6f9db62bec95f24c4967706d
|
| 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 Oct 23, 2026.
Transparency logSecurity for isitright 0.1.0.dev5
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for isitright-0.1.0.dev5.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 Oct 23, 2026.
Transparency logA 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.