Generic fallback: a country-code TLD corroborates the page's stated venue country - #752
Merged
missingbulb merged 3 commits intoJul 26, 2026
Merged
Conversation
…enue country The ctz derivation refuses to name a zone unless two independent page-declared hints agree. A very common shape cleared every bar but one: a local/municipal site that publishes its venue address in JSON-LD (addressCountry) but whose <html lang> is a country-less "en" — one hint, so nothing was derived. Read the host's country-code TLD as the weakest LOCALE-kind hint (.co.il -> IL, .co.uk -> GB), consulted only when <html lang>/og:locale named no country. It is deliberately not a country hint: a ccTLD describes the site, not the venue, so it can only corroborate a venue country the page itself stated — which is also what bounds a ccTLD in vanity use (.co/.io/.fm), since the country always comes from the page's own address. Fallback coverage: allFieldsPct 55.9 -> 56.9 (ctz 12/32 -> 14/32); criticalFieldsPct unchanged. livenation.de, stubhub and seetickets — whose dedicated sources deliberately set no ctz — still come out empty. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AHCptFbq5GK4HpnK8PR5jA
This was referenced Jul 26, 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.
Weekly
gcec/fallback-extractor-improvementsrun (dispatch #741). Refs #366.Hypothesis
helpers/derive-timezone.jsnames a zone only when two independent page-declared hints agree. Scanning the✗column of the fallback-coverage matrix,ctzwas the largest gap (20 of 32 gradeable cases missing), and one shape recurred: a page that does state its venue country in JSON-LD (location.address.addressCountry) but whose<html lang>is a country-less"en"— so the country stood alone and nothing was derived, even though the site is published under a country's own TLD.visit.tel-aviv.gov.ilis the exemplar:addressCountry: "Israel", floating times,<html lang="en">.The change
localeCountry()gains a last-resort signal: the host's country-code TLD (.co.il→ IL,.co.uk→ GB via the one ISO/TLD divergence worth encoding).Two properties keep it inside the existing contract rather than weakening it:
locale-kind hint, never acountryone. A ccTLD describes the site, exactly like<html lang>— a Tel Aviv cinema's.co.ilsays nothing about where any particular screening happens. So it can only corroborate a venue country the page itself stated, never name one. That is also what bounds a ccTLD in vanity use (.co,.io,.fm): since the country always comes from the page's own address, a bogus TLD→country mapping can never point at a wrong country — at worst it agrees with a country the page already claimed, which is the residual risk thecountry+localerule already documents and accepts.<html lang>/og:localenamed no country at all — so a vanity ccTLD can never contradict or override a locale the page actually declared.Every refusal rule is untouched: still no zone without a stated venue country, still nothing for a multi-zone country on locale agreement alone, still nothing when the country is ambiguous across a page's events.
Why it's generic (which unseen sites it helps)
The pattern "regional/municipal/venue site on its country's ccTLD, JSON-LD venue address, English-language chrome" is everywhere outside the tested corpus — tourism boards, city event calendars, national theatres and museums, regional ticketing on
.co.uk/.fr/.de/.jp/.au/.nz/.ie. Nothing here keys off a host, a path, or a per-site DOM shape; the two files that carry site knowledge (custom/*.js) are untouched.How the jsdom trap was ruled out
No value passed through the body-text scan — there is nothing to submit to the postcondition's jsdom check. The two inputs are
document.querySelectorAll('script[type="application/ld+json"]')content (a Chrome-readable attribute/JSON signal, already howvenueCountry()works) andlocation.hostname.document.body.textContentis not involved, no scan-window cap was touched, and no new text matching was added, so the "matched a<script>blob Chrome'sinnerTextnever exposes" failure mode cannot arise.postconditions.shexits 0.Before → after
ctzfieldNon-regressing: no gated % moved down, no exemplar cell moved from ✓. The two cells that flipped are
visit-tel-avivandvisit-tel-aviv-timed,ctz✗ → ✓.Deliberate-empty cases verified still empty, per the routine's rule:
stubhub(venue country Israel, buten-USlocale wins over the.comnon-hint),seetickets(GB venues,Z-serialized times,.com), and — the sharpest guard —livenation.de, a real ccTLD page: itsde-DElang already names DE so the TLD is never consulted, and its JSON-LD spans several countries sovenueCountry()refuses anyway. All three still derive"", and their starts are unchanged.Also unchanged: the
cinema.co.il/thinkdrink.co.il/ticketmaster.co.il/barby.co.ilcases. They sit on.ilbut state no venue country anywhere, and a locale hint alone must never pick a zone — so they correctly stay empty rather than being guessed at.The covering test
Added to
extension-test/event-extractors/extraction.test.js(the end-to-end home the helper's own unit tests point at for "events actually gaining a ctz"), red before green. One test, three assertions:.co.ilhost + JSON-LDaddressCountry+ country-lesslang="en"→Asia/Jerusalem, times placed by it..comhost →""(pins that the ccTLD is what did the work, and that a generic TLD mints nothing)..co.ilwithlang="en-US"→""(pins that a declared locale outranks the ccTLD).npm testis green (468 passed / 8 skipped).Heads-up for review: an unmerged sibling branch
claude/fallback-coverage/2026-07-26(a00:00–23:59all-day-range change) also editsderive-timezone.js; whichever lands second may need a trivial rebase.🤖 Generated with Claude Code
https://claude.ai/code/session_01AHCptFbq5GK4HpnK8PR5jA
Generated by Claude Code