From a7159867641eff6bd64d319a20902e1471151db4 Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:18:13 +0900 Subject: [PATCH 1/3] ci: inventory all stale app-site public routes when the first live smoke check fails --- .github/workflows/live-acquisition-smoke.yml | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/live-acquisition-smoke.yml b/.github/workflows/live-acquisition-smoke.yml index b5d7472f..96d485b4 100644 --- a/.github/workflows/live-acquisition-smoke.yml +++ b/.github/workflows/live-acquisition-smoke.yml @@ -36,6 +36,59 @@ jobs: set -euo pipefail echo 'Checking public appdevelopsk.com, NOT source on GitHub main.' bash scripts/check_app_discovery_live.sh + - name: Inventory all stale public routes (read-only, after failed smoke) + if: failure() + shell: bash + run: | + set -uo pipefail + # Diagnostic GETs are explicitly labeled bots. They never fire GA4 + # browser events and do not add campaign UTMs or mutate the VPS. + python3 scripts/diagnose_growth_routes.py --timeout 7 --output growth-route-diagnosis.json || true + python3 scripts/diagnose_growth_deploy.py --timeout 7 --output growth-deploy-diagnosis.json || true + python3 - <<'PY' + import json + import os + from pathlib import Path + routes = Path('growth-route-diagnosis.json') + deploy = Path('growth-deploy-diagnosis.json') + lines = ['## Independent public route inventory', ''] + if routes.exists(): + data = json.loads(routes.read_text(encoding='utf-8')) + lines += [ + f"Catalog locale deployed: {not data.get('catalog_locale_needs_review', True)}", + f"Catalog /apps and /apps.html aliases agree: {not data.get('apps_alias_needs_review', True)}", + 'Press page readiness (HTTP, canonical, lang, tracking & sitemap):', + ] + for path, ready in data.get('press_routes_ready', {}).items(): + lines.append(f"- {path}: {'PASS' if ready else 'STALE or unverified'}") + else: + lines.append('Route diagnostic could not create a report.') + if deploy.exists(): + data = json.loads(deploy.read_text(encoding='utf-8')) + lines += [ + '', + 'Source/live HTML SHA-256 comparison (not exact release-SHA proof):', + f"{data.get('identical_pages', 0)}/{data.get('checked_pages', 0)} byte-identical routes", + ] + for path, result in data.get('pages', {}).items(): + if not result.get('bytes_equal'): + lines.append(f"- {path}: HTTP {result.get('http_status')}, mismatch or error") + else: + lines.append('Source/live diagnostic could not create a report.') + lines += ['', 'This diagnostic never deploys, requests indexing, posts to SNS or verifies GA4/store installs.'] + with open(os.environ['GITHUB_STEP_SUMMARY'], 'a', encoding='utf-8') as f: + f.write('\n'.join(lines) + '\n') + PY + - name: Attach machine-readable public route diagnostics + if: failure() + uses: actions/upload-artifact@v4 + with: + name: appsite-live-route-inventory-${{ github.run_id }} + path: | + growth-route-diagnosis.json + growth-deploy-diagnosis.json + if-no-files-found: warn + retention-days: 7 - name: Summarize release blockers and recovery if: failure() run: | From 28fbe15606dfc0db00b4ccc4c91c3c69780b0a7a Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:18:38 +0900 Subject: [PATCH 2/3] test: guard read-only, fail-closed live route inventory after failed smoke --- scripts/test_live_smoke_diagnostics.py | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 scripts/test_live_smoke_diagnostics.py diff --git a/scripts/test_live_smoke_diagnostics.py b/scripts/test_live_smoke_diagnostics.py new file mode 100644 index 00000000..d0437415 --- /dev/null +++ b/scripts/test_live_smoke_diagnostics.py @@ -0,0 +1,60 @@ +"""Read-only CI workflow contract for public app site release diagnostics.""" +from pathlib import Path +import unittest + +ROOT = Path(__file__).resolve().parents[1] +WORKFLOW = ROOT / ".github" / "workflows" / "live-acquisition-smoke.yml" +SOURCE_FILES = ( + ROOT / "scripts" / "diagnose_growth_routes.py", + ROOT / "scripts" / "diagnose_growth_deploy.py", +) + + +class LiveFailureInventoryTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.yaml = WORKFLOW.read_text(encoding="utf-8") + + def test_diagnostics_only_after_failed_public_smoke(self): + source = self.yaml + smoke = source.index(" - name: Check actual VPS HTTP pages") + inventory = source.index(" - name: Inventory all stale public routes") + upload = source.index(" - name: Attach machine-readable public route diagnostics") + summary = source.index(" - name: Summarize release blockers and recovery") + self.assertLess(smoke, inventory) + self.assertLess(inventory, upload) + self.assertLess(upload, summary) + self.assertIn("if: failure()", source[inventory:upload]) + self.assertIn("if: failure()", source[upload:summary]) + + def test_inventory_runs_only_existing_readonly_public_checkers(self): + source = self.yaml.split(" - name: Inventory all stale public routes", 1)[1] + block = source.split(" - name: Attach machine-readable public route diagnostics", 1)[0] + self.assertIn("python3 scripts/diagnose_growth_routes.py --timeout 7 --output growth-route-diagnosis.json", block) + self.assertIn("python3 scripts/diagnose_growth_deploy.py --timeout 7 --output growth-deploy-diagnosis.json", block) + self.assertIn("GITHUB_STEP_SUMMARY", block) + self.assertIn("press_routes_ready", block) + self.assertIn("bytes_equal", block) + for command in ("--apply", "workflow_dispatch", "rsync ", "git push", "indexnow", "curl --request POST"): + self.assertNotIn(command, block) + for path in SOURCE_FILES: + self.assertTrue(path.exists(), str(path)) + + def test_failures_are_not_masked_and_structured_logs_retained(self): + source = self.yaml + self.assertIn("bash scripts/check_app_discovery_live.sh", source) + self.assertIn("actions/upload-artifact@v4", source) + self.assertIn("appsite-live-route-inventory-", source) + self.assertIn("growth-route-diagnosis.json", source) + self.assertIn("growth-deploy-diagnosis.json", source) + self.assertIn("retention-days: 7", source) + self.assertNotIn("continue-on-error: true", source) + + def test_never_confuse_release_diagnostics_with_genuine_traffic(self): + source = self.yaml + self.assertIn("This diagnostic never deploys, requests indexing, posts to SNS or verifies GA4/store installs.", source) + self.assertIn("Source/live HTML SHA-256 comparison (not exact release-SHA proof)", source) + + +if __name__ == "__main__": + unittest.main() From fcb8e30e98e66da500479925088716776a6fdefe Mon Sep 17 00:00:00 2001 From: appdevelopsk Date: Fri, 13 Nov 2026 21:18:47 +0900 Subject: [PATCH 3/3] ci: run live failure inventory contract tests in app-site QA --- .github/workflows/app-discovery-qa.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/app-discovery-qa.yml b/.github/workflows/app-discovery-qa.yml index f0219b0e..6026625a 100644 --- a/.github/workflows/app-discovery-qa.yml +++ b/.github/workflows/app-discovery-qa.yml @@ -29,6 +29,7 @@ on: - scripts/build_catalog.py - scripts/test_sitemap_route_integrity.py - scripts/test_sitemap_growth_freshness.py + - scripts/test_live_smoke_diagnostics.py - site_counts.json - tests/catalog-growth.test.mjs - tests/japanese-quick-games-discovery.test.mjs @@ -68,6 +69,7 @@ on: - scripts/build_catalog.py - scripts/test_sitemap_route_integrity.py - scripts/test_sitemap_growth_freshness.py + - scripts/test_live_smoke_diagnostics.py - site_counts.json - tests/catalog-growth.test.mjs - tests/catalog-positioning-regression.test.mjs @@ -95,6 +97,8 @@ jobs: run: python3 scripts/build_catalog.py --check - name: Verify sitemap URLs, source HTML and canonical integrity 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 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