Conversation
Reviewer takeover of stale PR aiming-lab#15 for issue aiming-lab#14. Search forms now emit known upstream URL shapes while keeping /search?q=... as compatibility aliases for existing tasks and health checks. Co-authored-by: Xuanrui Li <xuanrui.li@se24.qmul.ac.uk>
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.
Reviewer takeover of stale author PR #15 for issue #14 (search URL shapes). Reimplemented against current
maininstead of rebasing the May patch.Fixes #14.
Problem
Mirror search UIs emitted generic
/search?q=...even when the upstream site uses a more specific path or query key. That still works for local tasks, but it is less realistic when an agent inspects, copies, or navigates search URLs.What changed
Canonical search URLs are now what the site UI emits. Legacy
/search?q=...(and/thesaurus?q=...on Cambridge) stay registered as aliases for existing tasks, health checks, and old trajectories./s?k=<query>/search?q=<query>/searchresults.html?ss=<query>/search?q=<query>/maps/search/<query>/search?q=<query>/search/_/q/<query>/search?q=<query>/search/<query>/search?q=<query>/search?query=<query>/search?q=<query>/search/full-text?q=<query>/search?q=<query>/search/direct/?datasetsearch=english&q=<query>/search?q=<query>/search/english-thesaurus/direct/?datasetsearch=english-thesaurus&q=<query>/thesaurus?q=<query>Path-based shapes (Maps, ESPN, Apple) use a small submit handler so the browser location becomes the upstream path. No-JS still posts the query string at the canonical prefix, and the old alias still resolves.
Documented as already matching (no code change): Google Search, GitHub, BBC, arXiv, WolframAlpha, Google Flights (
/flights?...is the primary search).Also adds:
docs/search-url-realism.mdscripts/check_search_url_realism.pyCoordination (files not rewritten here)
/flights?...already canonicalrequest.urlnext fields, share boxes,example.comseeds). This PR only changes search path/query shapes. Bookingindex.htmlsearch form is a small adjacent edit; thenext=save buttons are unchanged.base.html/index.htmlleft alone; only the search route, search form, andmain.jssubmit handler changed.Lineage
hqhq1025, May 2026, 0 review comments, based on outdated main)Salvaged from #15: the canonical URL table, alias policy, path-search JS pattern, docs, and regression script. Reapplied as a fresh diff on current main (Amazon/ESPN/Maps/Apple/Booking handlers have all moved since May).
Verification
Both passed.
Flask
test_clientagainst local apps (empty/fresh sqlite; no HF asset fetch):/s?k=xbox200/search?q=xbox200/hasaction="/s"name="k"/searchresults.html?ss=Paris200/search?q=Paris200/hasaction="/searchresults.html"name="ss"/maps/search/central%20park200/search?q=central+park200/hasaction="/maps/search/"/search/_/q/lakers200/search?q=lakers200/searchhasaction="/search/_/q/"/search/iphone200/search?q=iphone200/searchhasaction="/search/"/search?query=python200/search?q=python200/hasname="query"/search/direct/?q=hello200/search?q=hello200/has/search/direct/+datasetsearch/searchalias keptNot re-run here: Docker image rebuild,
/resetbyte-identity (no seed DB or handler write-path change), Playwright._health.pyprobes that hit/search?q=...remain valid aliases.Please close or supersede #15 once this lands so the stale May PR is not merged on top of it.