Skip to content

fix: detect short gold SQL in fairness audits - #5

Merged
th3nolo merged 1 commit into
mainfrom
fix/audit-short-gold-sql
Oct 14, 2026
Merged

th3nolo merged 1 commit into
mainfrom
fix/audit-short-gold-sql

Conversation

@th3nolo

@th3nolo th3nolo commented Oct 14, 2026

Copy link
Copy Markdown
Owner

The fairness audit skipped gold SQL shorter than 40 characters. A prompt containing the exact answer SELECT 1 was therefore classified as fair and remained score-eligible. Audit every non-empty normalized gold query, regardless of length, and require text boundaries so SELECT 10, SELECT 1.0, and SELECT 1e3 are not mistaken for an exact SELECT 1 leak.

Add five regression tests covering short and long queries, case/whitespace normalization, clean prompts and empty gold SQL, tool/agentic classifications, and propagation through the real evaluator's saved audit and report row. Update the regression documentation. Detection remains a normalized text check; this change does not claim semantic-equivalence detection or recalculate historical benchmark results.

Validation with Python 3.13.7 and uv 0.11.19, without dependency changes:

  • Confirmed the new short-query regressions fail against the original implementation.
  • uv run --python 3.13.7 --no-project --no-sync --offline python -m compileall -q scripts tests
  • uv run --python 3.13.7 --no-project --no-sync --offline python -m unittest discover -s tests -v — all 17 tests pass.
  • git diff --check HEAD^ HEAD

@th3nolo
th3nolo merged commit 7cc8a67 into main Oct 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant