fix: check_generated_files_current.py now rebuilds from source, not f… - #508
Merged
yakew7 merged 1 commit intoSep 9, 2026
Merged
Conversation
…rom HEAD It only ever diffed the working tree against 'git show HEAD:<path>' - so editing a source .md without running 'make build-explainers' afterward still reported "up to date", as long as nothing was committed yet. Confirmed exactly the issue's repro (git worktree add + append a line to explainers/demographic-parity.md) now correctly fails with 'content differs from a fresh regeneration' where it used to pass. _fresh_build_dir() now does the real regeneration: a git worktree checked out to HEAD (shares this repo's object database/history, so git-log-derived dates resolve identically to a build done in ROOT itself), with every currently-tracked file's *working-tree* content copied on top before running build_explainers.py, generate_og_images.py, and freeze_paper_results.mirror_for_mcp() inside it - the same sequence build-explainers.yml runs, now run by this script itself instead of assumed to have already happened. The worktree is cleaned up via ExitStack regardless of what happens after. Updated tests/test_check_generated_files_current.py to monkeypatch _fresh_build_dir directly (pre-populated stub directory) instead of faking 'git show', per the file's own stated testing philosophy of avoiding a real git repo in unit tests. Added a regression test for the exact scenario in the bug report. Verification: reproduced the issue's exact repro against the unmodified script (confirmed it passed when it shouldn't), then against the fixed script (confirmed it now fails with the right reason). All 9 tests/test_check_generated_files_current.py tests pass; full suite is 402 passed, 1 skipped, 4 failed - the 4 failures are tests/test_xlsx_edge_cases.py, confirmed identical on unmodified main (SheetJS CDN returns HTTP 403 in this sandbox), unrelated to this change. Fixes yakew7#502
Contributor
|
@propcgamer20-png is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel. A member of the Team first needs to authorize it. |
yakew7
added a commit
that referenced
this pull request
Sep 10, 2026
They wrote the Makefile originally (#125) and added the 'audits' target (#506), and are the most active external contributor to scripts/ after the maintainer (check_em_dash.py extensions in #362, check_generated_files_current.py's rebuild-from-source fix in #508 and its follow-up regen in #540). Write access accepted.
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.
…rom HEAD
It only ever diffed the working tree against 'git show HEAD:' - so editing a source .md without running 'make build-explainers' afterward still reported "up to date", as long as nothing was committed yet. Confirmed exactly the issue's repro (git worktree add + append a line to explainers/demographic-parity.md) now correctly fails with 'content differs from a fresh regeneration' where it used to pass.
_fresh_build_dir() now does the real regeneration: a git worktree checked out to HEAD (shares this repo's object database/history, so git-log-derived dates resolve identically to a build done in ROOT itself), with every currently-tracked file's working-tree content copied on top before running build_explainers.py, generate_og_images.py, and freeze_paper_results.mirror_for_mcp() inside it - the same sequence build-explainers.yml runs, now run by this script itself instead of assumed to have already happened. The worktree is cleaned up via ExitStack regardless of what happens after.
Updated tests/test_check_generated_files_current.py to monkeypatch _fresh_build_dir directly (pre-populated stub directory) instead of faking 'git show', per the file's own stated testing philosophy of avoiding a real git repo in unit tests. Added a regression test for the exact scenario in the bug report.
Verification: reproduced the issue's exact repro against the unmodified script (confirmed it passed when it shouldn't), then against the fixed script (confirmed it now fails with the right reason). All 9 tests/test_check_generated_files_current.py tests pass; full suite is 402 passed, 1 skipped, 4 failed - the 4 failures are tests/test_xlsx_edge_cases.py, confirmed identical on unmodified main (SheetJS CDN returns HTTP 403 in this sandbox), unrelated to this change.
Fixes #502
Summary
Type
Audit checklist
unfair.pyincludes protected attributes and prints the required output formatfair.pyremoves protected attributes and identified proxy variablesrandom_state=42and an 80/20 train/test splitunfair.pngandfair.pngare included as PNG screenshotsDATA.mdis included if the file is too largeREADME.mdincludes the new results row and audit sectionBefore fairness gap:
After fairness gap:
Reduction:
Protected attribute(s):
Proxy variables dropped:
Explainer checklist
explainers/and uses lowercase hyphenated namingREADME.mdwas updatedLinked issue
Closes #