Repository navigation
fix: detect short gold SQL in fairness audits - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fairness audit skipped gold SQL shorter than 40 characters. A prompt containing the exact answer
SELECT 1was therefore classified asfairand remained score-eligible. Audit every non-empty normalized gold query, regardless of length, and require text boundaries soSELECT 10,SELECT 1.0, andSELECT 1e3are not mistaken for an exactSELECT 1leak.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:
uv run --python 3.13.7 --no-project --no-sync --offline python -m compileall -q scripts testsuv 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