Repository navigation
Show Seed Search's images on Combined Search with images=true - #631
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
daoudclarke
force-pushed
the
seed-images-prod-api
branch
from
November 11, 2026 07:03
fdd4618 to
0474ef8
Compare
daoudclarke
force-pushed
the
seed-images-prod-api
branch
2 times, most recently
from
November 11, 2026 10:49
8858aca to
c8c3724
Compare
Adds an images query parameter (JWT and API keys alike) and the image_outcome, images_display_count and images response fields. The first phase of image search starts before Staan, the second runs alongside web ranking, and images shown in the strip are left out of the web results. IMAGE_SEARCH_ENABLED is the kill switch, off by default until the safety benchmark is re-run with captions. Outcome and latency are logged without the query or the images, and the httpx logger, whose INFO lines carry the Commons query URL, is pinned to WARNING. The API description tells front ends what the safety check covers, that queries go to Wikimedia Commons, and how to render images safely. Part of #610. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… at the root From review: the API description now says the query goes to a third-party LLM service as well as to Commons, and how to link uploader-set licence URLs; the image log no longer depends on callback order to time web ranking; the strip's host set derives from the Commons client's; the privacy test captures every logger. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Commons captions are now part of each image's text (#628), so the questions say so. The caption eval (#630) measured the NSFW rewording on the safety benchmark: an identical table, and the 1.0 threshold holds. The relevance rewording was not measured. The NSFW question's fingerprint changes, so cached verdicts are asked again. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daoudclarke
force-pushed
the
seed-images-prod-api
branch
from
November 11, 2026 11:00
c8c3724 to
f55d852
Compare
The safety benchmark and injection probes held with captions (#630), so the kill switch no longer needs to default to off. Only requests sending images=true search images, and an instance without JEV_API_KEY still answers unavailable without calling Commons or the judge. No functional changes to the crawler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 #628 (
seed-images-prod-pipeline), which builds on #622 -> #620 -> #624 -> #623 -> main.What changed
PR 4 of the #610 plan wires Seed Search's image flow (
mwmbl/imagesearch/seed_images.py, #628) into Combined Search.images=trueonGET /api/v2/combined-search/, for JWT and API keys alike, at no extra cost. Phase 1 (seed_images.start) starts before Staan is fetched. Phase 2 (seed_images.finish) is awaited alongside web ranking, which now runs as a task, together with the Staan index write.image_outcome:shown | query_refused | not_needed | none_relevant | unavailable, null withoutimages=true.images_display_count:settings.IMAGES_DISPLAY_COUNT, 4.images: the ImageResult fields ported from the eval branch'simagesearch/api.py, plusrelevance, best first.File:URL, so percent-encoding, spaces and the mobile host don't defeat it.IMAGE_SEARCH_ENABLED(env), on by default. When it is off,images=trueanswersunavailableand never calls Commons or the judge. It was off by default until the safety benchmark and injection probes had been re-run with captions; Re-measure image safety, gate and minimum with Commons captions #630 did that and the thresholds held, so it now defaults to on. That changes nothing for requests that don't sendimages=true, and an instance withoutJEV_API_KEYstill answersunavailablewithout calling anything. SetIMAGE_SEARCH_ENABLED=falseto stop image search without a deploy.images=truerequest with the outcome, the image count, the total image latency and the time beyond web ranking. It never includes the query, titles or SHA-1s. Thehttpxlogger is pinned to WARNING, because its INFO lines contain the Commons query URL.images=truedoes;not_neededoutcomes);images_display_countimages and put the rest behind "More";referrerpolicy="no-referrer"and come from Wikimedia, which sees the viewer's IP;license_urlmay be empty and should be linked withrel="noopener noreferrer nofollow";mwmbl/imagesearch/prompt.pynow say "file name, caption, description and categories", because captions are shown to the judge. This follows the caption eval, Re-measure image safety, gate and minimum with Commons captions #630:Why
This is the API half of showing Commons images with Seed Search results (#610), so the front end can build the strip. It stays switched off until the safety re-run.
Verification
make checkpasses.make testpasses (1882 passed after the review fixes; the image tests were re-run after the wording commit).seed_images.start/finish. They cover:IndexErrorpath);Nonekey can't drop web results;Image:alias orindex.php?title=URLs (worst case, an image appears twice);setLevelrather than aLOGGINGentry (the project has noLOGGINGdict);Part of #610
🤖 Generated with Claude Code