Repository navigation
Recheck stored Commons files against Commons and the NSFW judge - #634
Open
daoudclarke wants to merge 1 commit into
Open
daoudclarke wants to merge 1 commit into
daoudclarke wants to merge 1 commit into
Conversation
recheck_images re-fetches the files checked longest ago, ten titles a request with the shared back-off honoured, up to IMAGE_STORE_RECHECK_LIMIT a run. It revokes deleted, moved, nominated, denied and rule-flagged files; when the SHA-1 or judged text changed, the NSFW fingerprint is stale or a revocation said nothing about the content, it asks the judge again and revokes unless the file still passes. Each batch is locked and re-read, so a revocation made during a run is never written over, and a judge failure revokes the batch recoverably rather than stopping every later run. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Nov 11, 2026
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 #633 (
seed-images-prod-store), which builds on #631. PR 5 of the #610 plan, part 2 of 2: the recheck.What changed
recheck_imagesmanagement command (mwmbl/imagesearch/recheck.py). It rechecks the files checked longest ago, up toIMAGE_STORE_RECHECK_LIMIT(2000) a run, so it can run on a schedule.commons.fetch_files), through the existing client with the shared back-off honoured. A back-off or refusal stops the run, leaving the unfinished batch first in line for the next one.gone), or moved (itsdescriptionurlcanonicalises to another key; the new name gets its own row when Seed Search finds it)unusable)nominated)IMAGE_SEARCH_DENIED_FILES(denied)rules)IMAGE_SEARCH_MIN_REVISION_AGE(unsettled)nsfw) unless it still passes.unsettled,unusableandunjudgedare lifted by any fresh pass. Operator revocations are never rechecked.select_for_update) after the Commons request, so a revocation made during a run, by an operator or by a search, is never written over.unjudged. It is retried next time, and one bad file can no longer wedge every later run.commons.FILE_PARAMSis shared by search and title fetches.parse_pageaccepts pages without a search rank.seed_images.is_eligibleis split intois_settled,is_deniedandis_nominated, so the recheck applies exactly Seed Search's checks.Why
Approval is a one-time judgment of text that anyone can edit. The store needs to follow deletions, deletion nominations, the denylist, changes to the file or its text, and changes to the NSFW question. Only then can PR 6 index from it and PR 9 drop revoked files at serve time.
Verification
make checkpasses;make testpasses: 1924 passed, 10 skipped.test/test_image_recheck.py, with Commons and the judge mocked) cover every path:fetch_files: one request for all titles, missing pages left out, unusable pages returned as Noneunusableand recoverable, and onlymissingcounts asgone.gone.Not done (raised for the user)
gone,deniedorrulesstay revoked while unchanged, even if the denylist or rules change. An operator restores one by deleting its row.uv run manage.py recheck_imagesfrom cron, or wrap it in a background task when indexing is switched on.Part of #610
🤖 Generated with Claude Code