Stop baking language redirects into the dataset - #22
Merged
Conversation
Google's documentation redirects to whichever locale it infers from the client. The checker followed those redirects and recorded the destination as canonical, so a --fix pass pinned English rows to whatever language the runner looked like that day: 212 URLs across the dataset carried ?hl=pt-br, ?hl=ar, ?hl=he and similar. None were there before #17 — this was my regression, and the first automated PR (#21) was about to add six more. Two changes. Requests now send Accept-Language: en-US,en;q=0.9, so the redirect mostly does not happen. And normalise() drops language-selection parameters, so a redirect that only picks a translation classifies as `ok` rather than `moved` and never produces a correction. A genuine move that happens to land on a localised URL still counts as moved, with the language stripped before it is written. --fix now also strips language parameters an earlier pass baked in: 212 cleaned, zero remaining. Side effect worth noting: `moved` drops from 41.7% at the baseline to 0.1%. Some of that fall was the redirect repair working, but part of the original figure was this bug counting translations as moves. Co-Authored-By: Claude Opus 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.
The first automated freshness PR (#21) surfaced a regression I introduced in #17.
Google's documentation redirects to whichever locale it infers from the client. The checker followed that redirect and recorded the destination as canonical — so a
--fixpass pinned rows of an English dataset to whatever language the runner happened to look like.212 URLs were affected. Zero carried a locale parameter before #17, so this is mine, not inherited.
?hl=pt-br(39),?hl=ar(34),?hl=he,?hl=zh-cn,?hl=bn, and a dozen more. #21 was about to add six more and is closed in favour of this.Fix
Accept-Language: en-US,en;q=0.9, so the redirect mostly stops happening.normalise()drops language-selection parameters (hl,lang,locale,setlang,ui_locales), so a redirect that only picks a translation classifies asokand never generates a correction.moved, with the language stripped before it is written.--fixalso cleans locale parameters an earlier pass baked in: 212 stripped, zero remaining.Worth flagging in the numbers
moveddrops from 41.7% at the baseline to 0.1%. Some of that fall is the redirect repair genuinely working — but part of the original 41.7% was this bug counting translations as moves, so the baseline overstated drift. Theokrate is now 93.9%.npm test→ 31 passing, including a case asserting that a real move carrying a locale is still detected as a move.🤖 Generated with Claude Code