Repository navigation
Seed Search images: bring the deny rules and cache keys to main - #624
Merged
Merged
Conversation
This was referenced Nov 10, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Nov 10, 2026
…search branch Seed Search keeps rules.query_verdict in front of image search (#610), and the judge's per-file NSFW cache keys come from verdict_cache.cache_key. Both live on wikicommons_image_search, which will not be merged, so this ports rules.py as it is there, the Verdict it returns, and cache_key (without the pixel-verdict functions only that branch's pipeline uses), with their tests. One change from the port: underscores and digits now separate words before matching. Commons file names join words with underscores, and \b treats both as word characters, so "topless_beach" or "Woman_nude.jpg" slipped past the rules. Part of #610 No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daoudclarke
force-pushed
the
seed-images-prod-rules
branch
from
November 11, 2026 07:03
13408b2 to
02aa9f6
Compare
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.
From Claude:
Stack: builds on #623 (
seed-images-prod-commons, the Commons client). #620 builds on this one.Why
This is the second half of bringing over from
wikicommons_image_search(the never-merged #607 image search and evaluation branch) the part production Seed Search images need. It's split from #623 to keep each PR under 500 added lines. The plan keepsrules.query_verdictin front of image search, and #620's NSFW judge keys its per-file cache withverdict_cache.cache_key.What changed
mwmbl/imagesearch/rules.py, ported from the image branch: the sexual and nudity deny terms, folded through NFKD with invisible characters removed, plusquery_verdictandimage_verdict.\bcounts both as word characters, sotopless_beach,Woman_nude.jpgand2nakedgot past the rules. The review found this. It has tests.Verdictintypes.py.mwmbl/imagesearch/verdict_cache.py: onlycache_keyand its prefix. The pixel-verdict functions anddigest_filesstay behind, since only the image branch's pipeline uses them. The docstring has been rewritten to drop the pixel specifics.query_verdict, the file-name cases and cache keys.How it was verified
make checkpasses.make testpasses (1841 passed with Seed Search images: move the image questions into imagesearch, with a fail-closed NSFW judge #620 on top, run before the underscore fix). After the fix, the image search, judge and jev_rank tests pass (82).seminude,nacktanddesnudopass);p0rn, a Cyrillicо).Part of #610
🤖 Generated with Claude Code