From fce0c530d3f93e52323f02ee222cd643c44a2e22 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:53:36 +0900 Subject: [PATCH 1/4] test: stage exact relative rsync file paths to isolate press release layout --- scripts/test_publish_app_discovery_staging.py | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 scripts/test_publish_app_discovery_staging.py diff --git a/scripts/test_publish_app_discovery_staging.py b/scripts/test_publish_app_discovery_staging.py new file mode 100644 index 00000000..e72fcc31 --- /dev/null +++ b/scripts/test_publish_app_discovery_staging.py @@ -0,0 +1,100 @@ +"""Offline deployment-layout tests for the exact manual appsite rsync manifest. + +These tests DO NOT contact or publish to appdevelopsk.com or a VPS. +Requires the rsync binary shipped with GitHub's ubuntu-latest runner. + +Run: python3 -m unittest scripts.test_publish_app_discovery_staging -v +""" +import re +import shlex +import shutil +import subprocess +import tempfile +import unittest +from pathlib import Path, PurePosixPath + +ROOT = Path(__file__).resolve().parents[1] +PUBLISH = ROOT / "scripts" / "publish_app_discovery.sh" +PRESS = { + "press/index.html", + "press/es/index.html", + "press/pt-br/index.html", + "press/ja/index.html", + "press/id/index.html", +} + + +def manifest(): + script = PUBLISH.read_text(encoding="utf-8") + match = re.search(r"(?m)^files=\(([^)]*)\)$", script) + if match is None: + raise AssertionError("Publisher's explicit files=(...) manifest was not found") + paths = shlex.split(match.group(1)) + if not paths or len(paths) != len(set(paths)): + raise AssertionError("Publisher has no paths, or duplicates") + for filename in paths: + value = PurePosixPath(filename) + if value.is_absolute() or ".." in value.parts or str(value) != filename: + raise AssertionError("Unsafe source path: " + filename) + if not (ROOT / filename).is_file(): + raise AssertionError("Missing checked-in release file: " + filename) + return paths + + +def rsync_to(directory, paths, dry_run=False): + if shutil.which("rsync") is None: + raise AssertionError("rsync is required to prove the VPS staging layout") + cmd = ["rsync", "-rlcvR", "--itemize-changes"] + if dry_run: + cmd += ["--dry-run"] + cmd += ["--", *paths, str(directory) + "/"] + return subprocess.run(cmd, cwd=ROOT, text=True, capture_output=True, check=True) + + +class AppPublishStagingTests(unittest.TestCase): + def test_real_relative_rsync_layout_matches_exact_allowlist(self): + paths = manifest() + self.assertTrue(PRESS.issubset(set(paths)), "Every press locale must deploy") + self.assertIn("apps.html", paths) + self.assertIn("support/brain-burst/index.html", paths) + with tempfile.TemporaryDirectory() as tmp: + dest = Path(tmp) / "www" + dest.mkdir() + rsync_to(dest, paths) + actual = { + p.relative_to(dest).as_posix() + for p in dest.rglob("*") if p.is_file() + } + self.assertEqual(actual, set(paths)) + for filename in paths: + with self.subTest(filename=filename): + self.assertEqual((dest / filename).read_bytes(), + (ROOT / filename).read_bytes()) + self.assertFalse(any(p.is_symlink() for p in dest.rglob("*"))) + + def test_dry_run_never_copies_any_published_page(self): + paths = manifest() + with tempfile.TemporaryDirectory() as tmp: + dest = Path(tmp) / "www" + dest.mkdir() + preview = rsync_to(dest, paths, dry_run=True) + self.assertEqual(list(dest.iterdir()), []) + self.assertIn("press/", preview.stdout) + + def test_production_script_is_opt_in_and_non_destructive(self): + script = PUBLISH.read_text(encoding="utf-8") + self.assertIn('mode="${1:---dry-run}"', script) + self.assertIn("python3 scripts/preflight_app_discovery.py", script) + lines = [s.strip() for s in script.splitlines() + if s.lstrip().startswith("rsync $rsync_flags")] + self.assertEqual(len(lines), 1) + self.assertNotIn("--delete", lines[0]) + self.assertNotIn("--remove-source-files", lines[0]) + self.assertIn('"${files[@]}"', lines[0]) + self.assertIn("APP_SITE_DEPLOY_ROOT", script) + self.assertIn('dest="$root/"', script) + self.assertFalse(any(x.startswith("privacy-policy/") for x in manifest())) + + +if __name__ == "__main__": + unittest.main() From a4d62de270cfa43b68243c4fc4359a0ebd8c6f5d Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:53:57 +0900 Subject: [PATCH 2/4] ci: run appsite 5-locale press source preflight and real isolated rsync staging tests --- .github/workflows/app-discovery-qa.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/app-discovery-qa.yml b/.github/workflows/app-discovery-qa.yml index 6026625a..650c85fd 100644 --- a/.github/workflows/app-discovery-qa.yml +++ b/.github/workflows/app-discovery-qa.yml @@ -30,6 +30,11 @@ on: - scripts/test_sitemap_route_integrity.py - scripts/test_sitemap_growth_freshness.py - scripts/test_live_smoke_diagnostics.py + - scripts/preflight_app_discovery.py + - scripts/test_preflight_app_discovery.py + - scripts/test_press_kit.py + - scripts/test_publish_app_discovery_staging.py + - press/** - site_counts.json - tests/catalog-growth.test.mjs - tests/japanese-quick-games-discovery.test.mjs @@ -70,6 +75,11 @@ on: - scripts/test_sitemap_route_integrity.py - scripts/test_sitemap_growth_freshness.py - scripts/test_live_smoke_diagnostics.py + - scripts/preflight_app_discovery.py + - scripts/test_preflight_app_discovery.py + - scripts/test_press_kit.py + - scripts/test_publish_app_discovery_staging.py + - press/** - site_counts.json - tests/catalog-growth.test.mjs - tests/catalog-positioning-regression.test.mjs @@ -99,6 +109,8 @@ jobs: run: python3 -m unittest scripts.test_sitemap_route_integrity scripts.test_sitemap_growth_freshness -v - name: Verify live failure inventory stays read-only and fail-closed run: python3 -m unittest scripts.test_live_smoke_diagnostics -v + - name: Verify multilingual press and real local rsync release staging + run: python3 -m unittest scripts.test_preflight_app_discovery scripts.test_press_kit scripts.test_publish_app_discovery_staging -v - name: Verify non-destructive release scripts have valid shell syntax run: bash -n scripts/publish_app_discovery.sh scripts/check_app_discovery_live.sh scripts/publish_stale_policy_pages.sh - name: Verify search, referral links and guide listings From 84d2015cb53fde6e11b5648b3a1a10c5dff3bc3d Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:55:40 +0900 Subject: [PATCH 3/4] test: validate dynamic press locale loop and current Debate Me OG release contract --- scripts/test_press_kit.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/test_press_kit.py b/scripts/test_press_kit.py index 0c2afc26..eefc43d2 100644 --- a/scripts/test_press_kit.py +++ b/scripts/test_press_kit.py @@ -76,10 +76,24 @@ def test_press_pages_in_manual_vps_publish_manifest(self): def test_live_smoke_checks_all_press_locales_and_latest_support(self): smoke = (ROOT / "scripts" / "check_app_discovery_live.sh").read_text(encoding="utf-8") - for code in ("en", "es", "pt-br", "ja", "id"): - self.assertIn("press-" + code + ".html", smoke) + # Live shell code expands $code from the loop; the literal per-locale + # filenames do not appear in source. Check each tuple and that the + # dynamic fetch actually uses the tuple's route and output name. + for code, route, lang in ( + ("en", "press/", "en"), + ("es", "press/es/", "es"), + ("pt-br", "press/pt-br/", "pt-BR"), + ("ja", "press/ja/", "ja"), + ("id", "press/id/", "id"), + ): + self.assertIn(f"'{code}:{route}:{lang}'", smoke) + self.assertIn('fetch "/$route" "press-$code.html"', smoke) + self.assertIn("'press_app_click'", smoke) + self.assertIn("'download_click'", smoke) self.assertIn("BrainBurst: Daily Trivia & 1v1 Quiz Battles | Android", smoke) self.assertIn("Debate Me: AI Debate Practice App for Android | SK APPS", smoke) + self.assertIn('', smoke) + self.assertNotIn("Debate Me: Practice Arguments with AI | Android App", smoke) self.assertNotIn("Debate Me – Free AI Debate App for Android | SK APPS", smoke) def test_homepage_and_sitemap_discoverable(self): From 8e330b6c877658bc1a1bd4130acd0eaf7984ae14 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:55:51 +0900 Subject: [PATCH 4/4] release: compare deployed Debate Me OG title with current approved source metadata --- scripts/check_app_discovery_live.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check_app_discovery_live.sh b/scripts/check_app_discovery_live.sh index b04ce007..e86be2b6 100644 --- a/scripts/check_app_discovery_live.sh +++ b/scripts/check_app_discovery_live.sh @@ -105,7 +105,7 @@ fetch '/support/debate-me/' 'debate-me.html' # title prevents a GitHub merge from being mistaken for a published change. grep -Fq 'Debate Me: AI Debate Practice App for Android | SK APPS' "$tmp/debate-me.html" || { echo 'FAIL Debate Me new SEO title not live' >&2; exit 1; } grep -Fq 'content="Practice debates against an AI opponent in Debate Me for Android' "$tmp/debate-me.html" || { echo 'FAIL Debate Me new search description not live' >&2; exit 1; } -grep -Fq '' "$tmp/debate-me.html" || { echo 'FAIL Debate Me OG title not live' >&2; exit 1; } +grep -Fq '' "$tmp/debate-me.html" || { echo 'FAIL Debate Me OG title not live' >&2; exit 1; } grep -Fq 'data-position="hero"' "$tmp/debate-me.html" || { echo 'FAIL Debate Me first-screen Play CTA not live' >&2; exit 1; } grep -Fq 'data-position="details"' "$tmp/debate-me.html" || { echo 'FAIL Debate Me details Play CTA missing' >&2; exit 1; } grep -Fq 'support_debate_me_hero' "$tmp/debate-me.html" || { echo 'FAIL Debate Me Play attribution missing' >&2; exit 1; }