isitright 0.1.0.dev0__tar.gz → 0.1.0.dev5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/.github/workflows/ci.yml +5 -2
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/.github/workflows/publish.yml +3 -1
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/.gitignore +1 -0
- isitright-0.1.0.dev5/.hypothesis/.gitignore +9 -0
- isitright-0.1.0.dev5/.hypothesis/constants/138e20931e4591f0 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/13bb09d05f9f2565 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/2ce41665bf5d28a0 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/5a4eb57a5003d8fd +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/60aa59f228998242 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/6212aba6bd141f0d +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/62ee6945b12f58df +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/6d9a121e66990019 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/73fff1d137b8fc55 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/8852c69b1b671205 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/8c7d64892d6df551 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/932c5ef926e9db10 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/95e21ddbbfc96db7 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/a535a77ea503a2af +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/b279a7097109fb82 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/ba4514884b02f405 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/e28b89c0245e60b9 +4 -0
- isitright-0.1.0.dev5/.hypothesis/constants/e8b7cda348f27b24 +4 -0
- isitright-0.1.0.dev5/CHANGELOG.md +31 -0
- isitright-0.1.0.dev5/CONTRIBUTING.md +33 -0
- isitright-0.1.0.dev5/PKG-INFO +168 -0
- isitright-0.1.0.dev5/README.md +117 -0
- isitright-0.1.0.dev5/SECURITY.md +21 -0
- isitright-0.1.0.dev5/docs/contracts.md +218 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/docs/releasing.md +10 -6
- isitright-0.1.0.dev5/docs/supported-sql.md +47 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/pyproject.toml +11 -0
- isitright-0.1.0.dev5/schemas/case-report-0.1.schema.json +635 -0
- isitright-0.1.0.dev5/schemas/suite-report-0.1.schema.json +713 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/src/isitright/__about__.py +1 -1
- isitright-0.1.0.dev5/src/isitright/__init__.py +57 -0
- isitright-0.1.0.dev5/src/isitright/api.py +595 -0
- isitright-0.1.0.dev5/src/isitright/cli.py +188 -0
- isitright-0.1.0.dev5/src/isitright/comparison.py +191 -0
- isitright-0.1.0.dev5/src/isitright/constraints.py +147 -0
- isitright-0.1.0.dev5/src/isitright/generation.py +499 -0
- isitright-0.1.0.dev5/src/isitright/minimize.py +402 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/src/isitright/models.py +78 -40
- isitright-0.1.0.dev5/src/isitright/replay.py +117 -0
- isitright-0.1.0.dev5/src/isitright/reports.py +163 -0
- isitright-0.1.0.dev5/src/isitright/schema.py +132 -0
- isitright-0.1.0.dev5/src/isitright/search.py +206 -0
- isitright-0.1.0.dev5/src/isitright/sql_analysis.py +127 -0
- isitright-0.1.0.dev5/src/isitright/sqlite_sandbox.py +223 -0
- isitright-0.1.0.dev5/src/isitright/validation.py +52 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/tests/factories.py +3 -3
- isitright-0.1.0.dev5/tests/fixtures/proposals/README.md +28 -0
- isitright-0.1.0.dev5/tests/fixtures/proposals/constraints.yaml +76 -0
- isitright-0.1.0.dev0/tests/fixtures/proposals/expected_semantics.yaml → isitright-0.1.0.dev5/tests/fixtures/proposals/fixture_expectations.yaml +12 -9
- isitright-0.1.0.dev5/tests/fixtures/proposals/null_count_minimal_counterexample.sql +14 -0
- isitright-0.1.0.dev5/tests/fixtures/proposals/synthetic_acceptance_cases.jsonl +18 -0
- isitright-0.1.0.dev5/tests/fixtures/proposals/synthetic_logistics.sql +41 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/tests/snapshots/case_report.json +4 -1
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/tests/snapshots/suite_report.json +1 -1
- isitright-0.1.0.dev5/tests/test_api.py +157 -0
- isitright-0.1.0.dev5/tests/test_cli.py +182 -0
- isitright-0.1.0.dev5/tests/test_comparison.py +160 -0
- isitright-0.1.0.dev5/tests/test_constraints.py +60 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/tests/test_contract_snapshots.py +15 -1
- isitright-0.1.0.dev5/tests/test_generation.py +59 -0
- isitright-0.1.0.dev5/tests/test_models.py +122 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/tests/test_packaging.py +1 -1
- isitright-0.1.0.dev5/tests/test_properties.py +69 -0
- isitright-0.1.0.dev5/tests/test_reports.py +48 -0
- isitright-0.1.0.dev5/tests/test_sandbox.py +127 -0
- isitright-0.1.0.dev5/tests/test_sql_analysis.py +46 -0
- isitright-0.1.0.dev5/tests/test_sqlite_regressions.py +102 -0
- isitright-0.1.0.dev5/tests/test_stage2_search.py +301 -0
- isitright-0.1.0.dev5/tests/test_stage3.py +285 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/tests/test_suite.py +27 -13
- isitright-0.1.0.dev5/tests/test_validation.py +68 -0
- isitright-0.1.0.dev5/tools/export_schemas.py +45 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/uv.lock +291 -0
- isitright-0.1.0.dev0/PKG-INFO +0 -105
- isitright-0.1.0.dev0/README.md +0 -56
- isitright-0.1.0.dev0/docs/contracts.md +0 -78
- isitright-0.1.0.dev0/src/isitright/__init__.py +0 -34
- isitright-0.1.0.dev0/src/isitright/api.py +0 -46
- isitright-0.1.0.dev0/src/isitright/cli.py +0 -105
- isitright-0.1.0.dev0/tests/fixtures/proposals/README.md +0 -32
- isitright-0.1.0.dev0/tests/fixtures/proposals/constraints.yaml +0 -22
- isitright-0.1.0.dev0/tests/fixtures/proposals/roman_tribute.sql +0 -37
- isitright-0.1.0.dev0/tests/fixtures/proposals/roman_tribute_minimal_counterexample.sql +0 -15
- isitright-0.1.0.dev0/tests/fixtures/proposals/synthetic_22.jsonl +0 -23
- isitright-0.1.0.dev0/tests/test_api.py +0 -16
- isitright-0.1.0.dev0/tests/test_cli.py +0 -69
- isitright-0.1.0.dev0/tests/test_models.py +0 -87
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/LICENSE +0 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/src/isitright/suite.py +0 -0
- {isitright-0.1.0.dev0 → isitright-0.1.0.dev5}/tests/__init__.py +0 -0
|
@@ -9,10 +9,11 @@ permissions:
|
|
|
9
9
|
|
|
10
10
|
jobs:
|
|
11
11
|
test:
|
|
12
|
-
runs-on:
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
13
|
strategy:
|
|
14
14
|
fail-fast: false
|
|
15
15
|
matrix:
|
|
16
|
+
os: [ubuntu-latest, windows-latest]
|
|
16
17
|
python-version: ["3.11", "3.12", "3.13"]
|
|
17
18
|
steps:
|
|
18
19
|
- uses: actions/checkout@v4
|
|
@@ -20,12 +21,14 @@ jobs:
|
|
|
20
21
|
with:
|
|
21
22
|
python-version: ${{ matrix.python-version }}
|
|
22
23
|
enable-cache: true
|
|
23
|
-
- run: uv sync --extra dev
|
|
24
|
+
- run: uv sync --locked --extra dev
|
|
24
25
|
- run: uv run ruff check .
|
|
25
26
|
- run: uv run mypy src
|
|
27
|
+
- run: uv run python tools/export_schemas.py --check
|
|
26
28
|
- run: uv run pytest
|
|
27
29
|
- run: uv build
|
|
28
30
|
- name: Verify wheel imports without network
|
|
31
|
+
if: runner.os == 'Linux'
|
|
29
32
|
shell: bash
|
|
30
33
|
run: |
|
|
31
34
|
uv pip install --reinstall --no-deps dist/*.whl
|
|
@@ -16,9 +16,10 @@ jobs:
|
|
|
16
16
|
with:
|
|
17
17
|
python-version: "3.11"
|
|
18
18
|
enable-cache: true
|
|
19
|
-
- run: uv sync --extra dev
|
|
19
|
+
- run: uv sync --locked --extra dev
|
|
20
20
|
- run: uv run ruff check .
|
|
21
21
|
- run: uv run mypy src
|
|
22
|
+
- run: uv run python tools/export_schemas.py --check
|
|
22
23
|
- run: uv run pytest
|
|
23
24
|
- run: uv build
|
|
24
25
|
- run: uv run python -m twine check dist/*
|
|
@@ -65,6 +66,7 @@ jobs:
|
|
|
65
66
|
- name: Install runtime dependencies from PyPI
|
|
66
67
|
run: >-
|
|
67
68
|
python -m pip install
|
|
69
|
+
"jsonschema>=4.23,<5"
|
|
68
70
|
"pydantic>=2.10,<3"
|
|
69
71
|
"pyyaml>=6.0.2,<7"
|
|
70
72
|
"sqlglot>=27,<29"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# This .gitignore file was automatically created by Hypothesis. Hypothesis gitignores
|
|
2
|
+
# .hypothesis by default, because we generally recommend that .hypothesis not be checked
|
|
3
|
+
# into version control.
|
|
4
|
+
#
|
|
5
|
+
# If you *would* like to check .hypothesis into version control, you should delete this
|
|
6
|
+
# file. Hypothesis will not re-create this .gitignore unless .hypothesis is deleted (and
|
|
7
|
+
# if it does, that's a bug - please report it!)
|
|
8
|
+
|
|
9
|
+
*
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/sql_analysis.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
[', ', 'Alter', 'Attach', 'Command', 'Commit', 'Create', 'Delete', 'Detach', 'Drop', 'Insert', 'Merge', 'Pragma', 'Rollback', 'Transaction', 'Update', 'Use', 'distinct', 'order', 'sqlite']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/models.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
[1e-12, 1e-09, 30.0, 100, 500, 10000, '0.1', 'AMBIGUOUS_TASK', 'BOTH_DEFECTIVE', 'CANDIDATE_DEFECT', 'COUNTEREXAMPLE_FOUND', 'DOMAIN_VALIDATED', 'INCONCLUSIVE', 'INDETERMINATE', 'INVALID', 'NOT_ASSESSED', 'REFERENCE_DEFECT', 'SCHEMA_VALID_ONLY', 'UNDETERMINED', 'UNSUPPORTED', 'after', 'any-counterexample', 'auto', 'before', 'binary', 'boolean', 'both', 'by_name', 'candidate_sql', 'case_id', 'date', 'datetime', 'decimal', 'engine_specific', 'exact', 'float', 'forbid', 'headline', 'integer', 'isclose', 'json', 'markdown', 'metadata', 'names_and_positions', 'none', 'null', 'ordered', 'positional', 'question', 'reference_sql', 'text', 'time', 'unordered']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/reports.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
['## Errors', '## Ranked cases', '## Totals', '### Candidate output', '### Reference output', '-_', '_', '```', '```json', 'case_report.json', 'case_report.md', 'cases', 'counterexample.sql', 'json', 'not determined', 'suite_report.json', 'suite_report.md', 'utf-8']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/sqlite_sandbox.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
[100, 10000, ':memory:', 'BLOB', 'INTEGER', 'NULL', 'REAL', 'SQLITE_ALTER_TABLE', 'SQLITE_ANALYZE', 'SQLITE_ATTACH', 'SQLITE_CREATE_INDEX', 'SQLITE_CREATE_TABLE', 'SQLITE_CREATE_VIEW', 'SQLITE_CREATE_VTABLE', 'SQLITE_DELETE', 'SQLITE_DETACH', 'SQLITE_DROP_INDEX', 'SQLITE_DROP_TABLE', 'SQLITE_DROP_TRIGGER', 'SQLITE_DROP_VIEW', 'SQLITE_DROP_VTABLE', 'SQLITE_INSERT', 'SQLITE_PRAGMA', 'SQLITE_REINDEX', 'SQLITE_SAVEPOINT', 'SQLITE_TRANSACTION', 'SQLITE_UPDATE', 'SQLiteSandbox', 'TEXT', 'ascii', 'interrupted', 'load_extension', 'ok', 'unknown']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/__init__.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
['AttributionStatus', 'CandidateStateView', 'CanonicalValue', 'CanonicalValueKind', 'CaseResult', 'CheckConfig', 'EffectiveOrdering', 'EquivalenceStatus', 'FailOnPolicy', 'FloatComparisonMode', 'InputError', 'OrderingPolicy', 'ReportFormat', 'StateValidityStatus', 'SuiteCase', 'SuiteResult', 'ValidationFinding', 'ValidatorResult', 'ValidatorStatus', '__version__', 'check', 'check_suite']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/generation.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
[100, '"', '""', '.', '0123456789', 'A', 'BLOB', 'CHAR', 'CLOB', 'DEC', 'DOUB', 'FLOA', 'INT', 'NUM', 'REAL', 'TEXT', '\\^\\[A-Z\\]\\{(\\d+)\\}\\$', 'aggregation', 'boundary', 'const', 'duplicate', 'enum', 'filtering', 'integer', 'isitright', 'items', 'join', 'minLength', 'minimum', 'null', 'number', 'pattern', 'properties', 'string', 'type']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/api.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
[1024, '-', 'AMBIGUOUS_COMPARISON', 'CASE_INTERNAL_ERROR', 'QUERY_ERROR', 'QUERY_RESOURCE_LIMIT', 'QUERY_TIMEOUT', 'UNSUPPORTED_SQL', '_', 'candidate', 'case', 'case_id', 'cases', 'cases_file', 'comparison', 'constraints', 'counterexample.sql', 'database', 'domain-validated', 'effective_ordering', 'input', 'metadata', 'original_state', 'query results differ', 'rb', 'reference', 'schema-valid', 'seed', 'utf-8']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/replay.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
['--fixture', '--report', ':memory:', 'SQLITE_ALTER_TABLE', 'SQLITE_ANALYZE', 'SQLITE_ATTACH', 'SQLITE_CREATE_VIEW', 'SQLITE_CREATE_VTABLE', 'SQLITE_DELETE', 'SQLITE_DETACH', 'SQLITE_DROP_INDEX', 'SQLITE_DROP_TABLE', 'SQLITE_DROP_TRIGGER', 'SQLITE_DROP_VIEW', 'SQLITE_DROP_VTABLE', 'SQLITE_REINDEX', '__main__', 'candidate_result', 'defer_foreign_keys', 'foreign_keys', 'json', 'load_extension', 'reference_result', 'reproduced', 'utf-8']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# file: /home/runner/work/isitright/isitright/src/isitright/cli.py
|
|
2
|
+
# hypothesis_version: 6.170.8
|
|
3
|
+
|
|
4
|
+
[1e-12, 1e-09, 0.001, 30.0, 100, 500, 10000, '--candidate', '--constraints', '--format', '--reference', '--version', 'Show version.', '__main__', 'artifacts/check', 'artifacts/suite', 'check', 'isitright', 'suite', 'utf-8']
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes are documented here. The project follows semantic versioning;
|
|
4
|
+
development releases may still refine the versioned `0.1` report contract before
|
|
5
|
+
the stable `0.1.0` release.
|
|
6
|
+
|
|
7
|
+
## 0.1.0.dev5 — Stage 4 candidate
|
|
8
|
+
|
|
9
|
+
- Added SQLite authorizer defense in depth and configurable result-row limits.
|
|
10
|
+
- Added property-based comparator tests and SQLite schema regression coverage.
|
|
11
|
+
- Added checked-in JSON Schemas with automated freshness verification.
|
|
12
|
+
- Expanded CI to Python 3.11–3.13 on Linux and Windows.
|
|
13
|
+
- Documented the supported SQL surface, known limitations, contribution workflow,
|
|
14
|
+
security policy, and release process.
|
|
15
|
+
|
|
16
|
+
## 0.1.0.dev4 — Stage 3
|
|
17
|
+
|
|
18
|
+
- Added constraint-preserving minimization, suites, deterministic reproduction,
|
|
19
|
+
offline replay, ranked reports, and `--fail-on` policies.
|
|
20
|
+
|
|
21
|
+
## 0.1.0.dev3 — Stage 2
|
|
22
|
+
|
|
23
|
+
- Added constraint-aware generated-state search across six mutation families.
|
|
24
|
+
|
|
25
|
+
## 0.1.0.dev2 — Stage 1
|
|
26
|
+
|
|
27
|
+
- Added safe SQLite execution and policy-driven result comparison.
|
|
28
|
+
|
|
29
|
+
## 0.1.0.dev0 — Stage 0
|
|
30
|
+
|
|
31
|
+
- Established package, CLI, report contracts, fixtures, tests, and CI.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thank you for helping improve `isitright`.
|
|
4
|
+
|
|
5
|
+
## Development setup
|
|
6
|
+
|
|
7
|
+
Python 3.11 or newer and `uv` are required.
|
|
8
|
+
|
|
9
|
+
```console
|
|
10
|
+
uv sync --locked --extra dev
|
|
11
|
+
uv run ruff check .
|
|
12
|
+
uv run mypy src
|
|
13
|
+
uv run python tools/export_schemas.py --check
|
|
14
|
+
uv run pytest
|
|
15
|
+
uv build
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Tests must run offline after dependencies are installed and must not require API
|
|
19
|
+
keys. Add a regression test for every bug fix. Changes to report models require
|
|
20
|
+
running `uv run python tools/export_schemas.py` and committing the updated files in
|
|
21
|
+
`schemas/`.
|
|
22
|
+
|
|
23
|
+
## Pull requests
|
|
24
|
+
|
|
25
|
+
- Branch from the current `main` branch and keep changes focused.
|
|
26
|
+
- Preserve the separation between observed disagreement, state validity, and defect
|
|
27
|
+
attribution.
|
|
28
|
+
- Do not describe bounded agreement as equivalence.
|
|
29
|
+
- Document user-visible behavior and known limitations.
|
|
30
|
+
- Confirm Ruff, strict mypy, tests, schema freshness, and package builds locally.
|
|
31
|
+
|
|
32
|
+
Fixture semantics require owner review because they define expected behavior rather
|
|
33
|
+
than merely exercising implementation details.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: isitright
|
|
3
|
+
Version: 0.1.0.dev5
|
|
4
|
+
Summary: Evidence-first stress testing for text-to-SQL evaluations
|
|
5
|
+
Project-URL: Repository, https://github.com/isitright-ai/isitright
|
|
6
|
+
Author: isitright contributors
|
|
7
|
+
License: MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 isitright contributors
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
36
|
+
Requires-Python: >=3.11
|
|
37
|
+
Requires-Dist: jsonschema<5,>=4.23
|
|
38
|
+
Requires-Dist: pydantic<3,>=2.10
|
|
39
|
+
Requires-Dist: pyyaml<7,>=6.0.2
|
|
40
|
+
Requires-Dist: sqlglot<29,>=27
|
|
41
|
+
Requires-Dist: typer<1,>=0.15
|
|
42
|
+
Provides-Extra: dev
|
|
43
|
+
Requires-Dist: build<2,>=1.2.2; extra == 'dev'
|
|
44
|
+
Requires-Dist: hypothesis<7,>=6.115; extra == 'dev'
|
|
45
|
+
Requires-Dist: mypy<2,>=1.14; extra == 'dev'
|
|
46
|
+
Requires-Dist: pytest-cov<8,>=6; extra == 'dev'
|
|
47
|
+
Requires-Dist: pytest<9,>=8.3; extra == 'dev'
|
|
48
|
+
Requires-Dist: ruff<1,>=0.9; extra == 'dev'
|
|
49
|
+
Requires-Dist: twine<7,>=6.1; extra == 'dev'
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# isitright
|
|
53
|
+
|
|
54
|
+
`isitright` is an evidence-first tool for stress-testing text-to-SQL evaluations.
|
|
55
|
+
Given reference and candidate SQL, the v0.1 engine will search for a valid
|
|
56
|
+
database state on which their outputs differ and emit a minimized, replayable
|
|
57
|
+
counterexample. A disagreement is evidence, not automatic attribution of fault.
|
|
58
|
+
|
|
59
|
+
## Current status: Stage 4 review gate
|
|
60
|
+
|
|
61
|
+
The v0.1 candidate safely compares queries on the supplied SQLite database and runs
|
|
62
|
+
a deterministic, schema-aware generated-state search. Search harvests referenced
|
|
63
|
+
tables, columns, and literals and tries boundary, NULL, duplicate, join, filtering,
|
|
64
|
+
and aggregation mutations in priority order.
|
|
65
|
+
|
|
66
|
+
Every generated state is checked against SQLite integrity and foreign-key rules,
|
|
67
|
+
an optional JSON Schema constraints document, and an optional trusted validator.
|
|
68
|
+
Finding no divergence is reported as `AGREEMENT_ON_TESTED_STATES`; it is not a
|
|
69
|
+
claim of equivalence. Findings are minimized across generated and background rows,
|
|
70
|
+
revalidated, and exported as deterministic `counterexample.sql` files. Suite mode,
|
|
71
|
+
ranked reports, and opt-in `--fail-on` policies are active.
|
|
72
|
+
|
|
73
|
+
## Quick start
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from isitright import check
|
|
77
|
+
|
|
78
|
+
result = check(
|
|
79
|
+
database="example.sqlite",
|
|
80
|
+
reference_sql="SELECT province FROM tribute ORDER BY province",
|
|
81
|
+
candidate_sql="SELECT DISTINCT province FROM tribute ORDER BY province",
|
|
82
|
+
)
|
|
83
|
+
print(result.headline)
|
|
84
|
+
print(result.original_state.outputs_match)
|
|
85
|
+
print(result.search.model_dump())
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The CLI reads each query from a UTF-8 file and writes versioned JSON plus a concise
|
|
89
|
+
Markdown rendering by default:
|
|
90
|
+
|
|
91
|
+
```console
|
|
92
|
+
isitright check --database example.sqlite --reference gold.sql \
|
|
93
|
+
--candidate agent.sql --output-dir artifacts/check
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
When a counterexample is found, replay the emitted fixture and verify both recorded
|
|
97
|
+
outputs without touching the source database:
|
|
98
|
+
|
|
99
|
+
```console
|
|
100
|
+
cd artifacts/check
|
|
101
|
+
python -m isitright.replay --report case_report.json --fixture counterexample.sql
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
Python 3.11 or newer is required. With `uv` installed:
|
|
107
|
+
|
|
108
|
+
```console
|
|
109
|
+
uv sync --extra dev
|
|
110
|
+
uv run ruff check .
|
|
111
|
+
uv run mypy src
|
|
112
|
+
uv run pytest
|
|
113
|
+
uv build
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The package exposes single-case and JSONL suite commands:
|
|
117
|
+
|
|
118
|
+
```console
|
|
119
|
+
isitright --version
|
|
120
|
+
isitright check --help
|
|
121
|
+
isitright suite --help
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
```console
|
|
125
|
+
isitright suite --database example.sqlite --cases cases.jsonl \
|
|
126
|
+
--output-dir artifacts/suite --fail-on domain-counterexample
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Suite cases run independently and are ranked with domain-validated findings first,
|
|
130
|
+
then schema-only findings, inconclusive/unsupported cases, and observed agreement.
|
|
131
|
+
Both commands accept `--fail-on none`, `domain-counterexample`, or
|
|
132
|
+
`any-counterexample`; a matched opt-in policy exits with code `3` after artifacts
|
|
133
|
+
have been written.
|
|
134
|
+
|
|
135
|
+
The Stage 4 preview is versioned `0.1.0.dev5`. It is intentionally a development
|
|
136
|
+
release and must not be presented as the complete v0.1 search engine.
|
|
137
|
+
|
|
138
|
+
## Contract highlights
|
|
139
|
+
|
|
140
|
+
- Result statuses keep observed equivalence, state validity, and attribution separate.
|
|
141
|
+
- Unordered query results are compared as multisets, preserving duplicates.
|
|
142
|
+
- Automatic ordering honors a top-level `ORDER BY` on either query; otherwise results
|
|
143
|
+
are unordered.
|
|
144
|
+
- Engine-native values are normalized into explicit, portable canonical kinds.
|
|
145
|
+
- JSON Schema and trusted callback validation are applied before generated states
|
|
146
|
+
are admitted, and every rejection is counted by reason.
|
|
147
|
+
- Reports use schema version `0.1`; package versioning remains pre-release until the
|
|
148
|
+
v0.1 engine is complete.
|
|
149
|
+
|
|
150
|
+
Generation is intentionally bounded and lightweight. It creates small
|
|
151
|
+
insertions by adapting existing rows or synthesizing complete rows for empty
|
|
152
|
+
referenced tables, including required foreign-key parent rows. It does not perform
|
|
153
|
+
AST-diff-guided search or prove that exhausted candidates cover every admissible
|
|
154
|
+
state. Minimization is also bounded; if its budget is exhausted, the smallest
|
|
155
|
+
verified state found so far is returned with `minimization_complete: false`.
|
|
156
|
+
|
|
157
|
+
See [the contract reference](docs/contracts.md) and
|
|
158
|
+
[the fixture proposal](tests/fixtures/proposals/README.md). The precise supported
|
|
159
|
+
SQL surface and known limitations are documented in
|
|
160
|
+
[Supported SQL and limitations](docs/supported-sql.md).
|
|
161
|
+
|
|
162
|
+
Contributions are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md). Security issues
|
|
163
|
+
should follow the private reporting process in [SECURITY.md](SECURITY.md).
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
MIT
|
|
168
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# isitright
|
|
2
|
+
|
|
3
|
+
`isitright` is an evidence-first tool for stress-testing text-to-SQL evaluations.
|
|
4
|
+
Given reference and candidate SQL, the v0.1 engine will search for a valid
|
|
5
|
+
database state on which their outputs differ and emit a minimized, replayable
|
|
6
|
+
counterexample. A disagreement is evidence, not automatic attribution of fault.
|
|
7
|
+
|
|
8
|
+
## Current status: Stage 4 review gate
|
|
9
|
+
|
|
10
|
+
The v0.1 candidate safely compares queries on the supplied SQLite database and runs
|
|
11
|
+
a deterministic, schema-aware generated-state search. Search harvests referenced
|
|
12
|
+
tables, columns, and literals and tries boundary, NULL, duplicate, join, filtering,
|
|
13
|
+
and aggregation mutations in priority order.
|
|
14
|
+
|
|
15
|
+
Every generated state is checked against SQLite integrity and foreign-key rules,
|
|
16
|
+
an optional JSON Schema constraints document, and an optional trusted validator.
|
|
17
|
+
Finding no divergence is reported as `AGREEMENT_ON_TESTED_STATES`; it is not a
|
|
18
|
+
claim of equivalence. Findings are minimized across generated and background rows,
|
|
19
|
+
revalidated, and exported as deterministic `counterexample.sql` files. Suite mode,
|
|
20
|
+
ranked reports, and opt-in `--fail-on` policies are active.
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from isitright import check
|
|
26
|
+
|
|
27
|
+
result = check(
|
|
28
|
+
database="example.sqlite",
|
|
29
|
+
reference_sql="SELECT province FROM tribute ORDER BY province",
|
|
30
|
+
candidate_sql="SELECT DISTINCT province FROM tribute ORDER BY province",
|
|
31
|
+
)
|
|
32
|
+
print(result.headline)
|
|
33
|
+
print(result.original_state.outputs_match)
|
|
34
|
+
print(result.search.model_dump())
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The CLI reads each query from a UTF-8 file and writes versioned JSON plus a concise
|
|
38
|
+
Markdown rendering by default:
|
|
39
|
+
|
|
40
|
+
```console
|
|
41
|
+
isitright check --database example.sqlite --reference gold.sql \
|
|
42
|
+
--candidate agent.sql --output-dir artifacts/check
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
When a counterexample is found, replay the emitted fixture and verify both recorded
|
|
46
|
+
outputs without touching the source database:
|
|
47
|
+
|
|
48
|
+
```console
|
|
49
|
+
cd artifacts/check
|
|
50
|
+
python -m isitright.replay --report case_report.json --fixture counterexample.sql
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
Python 3.11 or newer is required. With `uv` installed:
|
|
56
|
+
|
|
57
|
+
```console
|
|
58
|
+
uv sync --extra dev
|
|
59
|
+
uv run ruff check .
|
|
60
|
+
uv run mypy src
|
|
61
|
+
uv run pytest
|
|
62
|
+
uv build
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The package exposes single-case and JSONL suite commands:
|
|
66
|
+
|
|
67
|
+
```console
|
|
68
|
+
isitright --version
|
|
69
|
+
isitright check --help
|
|
70
|
+
isitright suite --help
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```console
|
|
74
|
+
isitright suite --database example.sqlite --cases cases.jsonl \
|
|
75
|
+
--output-dir artifacts/suite --fail-on domain-counterexample
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Suite cases run independently and are ranked with domain-validated findings first,
|
|
79
|
+
then schema-only findings, inconclusive/unsupported cases, and observed agreement.
|
|
80
|
+
Both commands accept `--fail-on none`, `domain-counterexample`, or
|
|
81
|
+
`any-counterexample`; a matched opt-in policy exits with code `3` after artifacts
|
|
82
|
+
have been written.
|
|
83
|
+
|
|
84
|
+
The Stage 4 preview is versioned `0.1.0.dev5`. It is intentionally a development
|
|
85
|
+
release and must not be presented as the complete v0.1 search engine.
|
|
86
|
+
|
|
87
|
+
## Contract highlights
|
|
88
|
+
|
|
89
|
+
- Result statuses keep observed equivalence, state validity, and attribution separate.
|
|
90
|
+
- Unordered query results are compared as multisets, preserving duplicates.
|
|
91
|
+
- Automatic ordering honors a top-level `ORDER BY` on either query; otherwise results
|
|
92
|
+
are unordered.
|
|
93
|
+
- Engine-native values are normalized into explicit, portable canonical kinds.
|
|
94
|
+
- JSON Schema and trusted callback validation are applied before generated states
|
|
95
|
+
are admitted, and every rejection is counted by reason.
|
|
96
|
+
- Reports use schema version `0.1`; package versioning remains pre-release until the
|
|
97
|
+
v0.1 engine is complete.
|
|
98
|
+
|
|
99
|
+
Generation is intentionally bounded and lightweight. It creates small
|
|
100
|
+
insertions by adapting existing rows or synthesizing complete rows for empty
|
|
101
|
+
referenced tables, including required foreign-key parent rows. It does not perform
|
|
102
|
+
AST-diff-guided search or prove that exhausted candidates cover every admissible
|
|
103
|
+
state. Minimization is also bounded; if its budget is exhausted, the smallest
|
|
104
|
+
verified state found so far is returned with `minimization_complete: false`.
|
|
105
|
+
|
|
106
|
+
See [the contract reference](docs/contracts.md) and
|
|
107
|
+
[the fixture proposal](tests/fixtures/proposals/README.md). The precise supported
|
|
108
|
+
SQL surface and known limitations are documented in
|
|
109
|
+
[Supported SQL and limitations](docs/supported-sql.md).
|
|
110
|
+
|
|
111
|
+
Contributions are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md). Security issues
|
|
112
|
+
should follow the private reporting process in [SECURITY.md](SECURITY.md).
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
MIT
|
|
117
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Please report suspected vulnerabilities privately through GitHub's **Security →
|
|
6
|
+
Report a vulnerability** workflow for `isitright-ai/isitright`. Do not open a public
|
|
7
|
+
issue before maintainers have had an opportunity to investigate.
|
|
8
|
+
|
|
9
|
+
Include the affected version, a minimal reproduction, expected impact, and any known
|
|
10
|
+
workarounds. Maintainers will acknowledge the report, assess severity, and coordinate
|
|
11
|
+
disclosure and a patched release.
|
|
12
|
+
|
|
13
|
+
## Security boundary
|
|
14
|
+
|
|
15
|
+
`isitright` treats SQL and database files as untrusted inputs, but programmatic
|
|
16
|
+
validator callbacks as trusted local code. It does not load Python callbacks from
|
|
17
|
+
constraint documents. Analysis uses disposable in-memory SQLite copies with parser,
|
|
18
|
+
query-only, authorizer, deadline, and result-size controls. These controls reduce
|
|
19
|
+
risk. Replay separately authorizes only the DDL and inserts needed by generated
|
|
20
|
+
fixtures and denies database attachment and extension loading. These controls are
|
|
21
|
+
not a general sandbox for hostile native SQLite extensions.
|