diff --git a/scripts/build_catalog.py b/scripts/build_catalog.py index ffda3e84..02caa31f 100644 --- a/scripts/build_catalog.py +++ b/scripts/build_catalog.py @@ -152,7 +152,11 @@ def build_apps_html(t, apps, n): t = sub1(r'(
(?:\d+ free apps on Google Play|Explore our mobile app catalog)", "
Explore our mobile app catalog", t, + # The localized catalog keeps a stable ID on the intro paragraph. + # Preserve that ID when normalizing the legacy text, otherwise the + # catalog-language controller cannot find the translated introduction. + t = sub1(r'(
)(?:\d+ free apps on Google Play|Explore our mobile app catalog)', + lambda m: m.group(1) + "Explore our mobile app catalog", t, "apps.html の見出し文") return t diff --git a/scripts/test_sitemap_growth_freshness.py b/scripts/test_sitemap_growth_freshness.py index a8b56a11..98e9d6e4 100644 --- a/scripts/test_sitemap_growth_freshness.py +++ b/scripts/test_sitemap_growth_freshness.py @@ -2,7 +2,7 @@ Run with: python3 -m unittest discover -s scripts -p 'test_sitemap_growth_freshness.py' -v """ -from datetime import date +from datetime import date, datetime, timedelta, timezone from pathlib import Path import unittest import xml.etree.ElementTree as ET @@ -10,6 +10,16 @@ ROOT = Path(__file__).resolve().parent.parent NS = "{http://www.sitemaps.org/schemas/sitemap/0.9}" BASE = "https://appdevelopsk.com" +# Sitemap lastmod dates are authored in Japan Standard Time (UTC+09:00). +# GitHub-hosted runners use UTC, so date.today() wrongly rejects JST updates +# during 00:00–08:59 in Japan. +JST = timezone(timedelta(hours=9)) + + +def publication_today(now=None): + current = now if now is not None else datetime.now(timezone.utc) + return current.astimezone(JST).date() + CHANGED_2026_11_07 = ( "/", "/apps", "/support/taletime/", "/support/debate-me/", @@ -65,7 +75,14 @@ def test_sitemap_dates_are_valid_and_not_future(self): for url, stamp in entries(): with self.subTest(url=url): parsed = date.fromisoformat(stamp) - self.assertLessEqual(parsed, date.today()) + self.assertLessEqual(parsed, publication_today()) + + def test_jst_publication_date_is_not_utc_runner_date(self): + # At 15:30 UTC on Nov 12 it is already Nov 13 in Japan. + before_jst_midnight = datetime(2026, 11, 12, 14, 59, tzinfo=timezone.utc) + after_jst_midnight = datetime(2026, 11, 12, 15, 30, tzinfo=timezone.utc) + self.assertEqual(publication_today(before_jst_midnight), date(2026, 11, 12)) + self.assertEqual(publication_today(after_jst_midnight), date(2026, 11, 13)) def test_filtered_catalog_urls_are_not_indexed_separately(self): urls = [url for url, _ in entries()] diff --git a/support/debate-me/index.html b/support/debate-me/index.html index ab001f5c..d1abc11a 100644 --- a/support/debate-me/index.html +++ b/support/debate-me/index.html @@ -5,7 +5,7 @@ - + diff --git a/tests/debate-me-support-growth.test.mjs b/tests/debate-me-support-growth.test.mjs index 921aace7..baf081c2 100644 --- a/tests/debate-me-support-growth.test.mjs +++ b/tests/debate-me-support-growth.test.mjs @@ -11,8 +11,8 @@ function dictionary(name, after) { return runInNewContext('('+match[1]+')'); } test('first paint shows real AI debate and never a food spinner', () => { - assert.match(html, /