Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,28 @@ Before claiming a live release, verify the hosting provider deployed SHA and ope
cards, filters, language switching, console errors, real store destinations,
and exactly one catalog_language_selected per manual choice in GA4 DebugView.
Record source-vs-live evidence in GitHub issue #51. A merge is not deployment.


## VPS production publish gate for the five-language app catalog

Source-only PRs are not production deployments. The repository now contains
scripts/publish_app_discovery.sh (dry-run by default) and
scripts/check_app_discovery_live.sh (read-only production smoke). The catalog
locale selector is part of apps.html and is in the publish file allowlist.

On the **authorized deployment machine** with the correct SSH alias,
verified domain mapping and a clean checkout of the intended main commit:

bash scripts/publish_app_discovery.sh --dry-run

Review every destination/changed file and the current public host configuration.
Only after approving that exact deploy, invoke:

bash scripts/publish_app_discovery.sh --apply
bash scripts/check_app_discovery_live.sh

The live smoke now requires the five catalog languages and their browser-side
event contract, plus previously released growth pages. Check mobile browser
behavior, GA4 DebugView and Play acquisition data separately. This workflow
cannot be run against the owner's VPS from a disconnected ChatGPT container;
no source merge or local test proves that /apps is updated on the public host.
11 changes: 11 additions & 0 deletions scripts/check_app_discovery_live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ if grep -Fq 'href="support/face-reaction-battle/"' "$tmp/index.html"; then
fi
fetch '/apps' 'apps.html'
grep -Fq 'id="find-app"' "$tmp/apps.html" || { echo 'FAIL catalog search is stale' >&2; exit 1; }

# The new UI is browser-side only; these assertions confirm deployed source,
# NOT that user interactions/GA4 events have been executed in a real browser.
grep -Fq 'id="catalog-language"' "$tmp/apps.html" || { echo 'FAIL five-language catalog selector not deployed' >&2; exit 1; }
grep -Fq 'CATALOG_LOCALE_START' "$tmp/apps.html" || { echo 'FAIL catalog locale controller missing' >&2; exit 1; }
grep -Fq 'catalog_language_selected' "$tmp/apps.html" || { echo 'FAIL catalog language analytics contract missing' >&2; exit 1; }
for language in en ja es pt-BR id; do
grep -Fq "option value=\"$language\"" "$tmp/apps.html" || { echo "FAIL $language catalog option not deployed" >&2; exit 1; }
done
grep -Fq 'catalogSearchAliases' "$tmp/apps.html" || { echo 'FAIL localized pilot discovery aliases missing' >&2; exit 1; }

grep -Fq 'catalog_store_click' "$tmp/apps.html" || { echo 'FAIL store-click attribution is stale' >&2; exit 1; }
grep -Fq '日本語でゲームを探す' "$tmp/apps.html" || { echo 'FAIL Japanese guide missing from live app catalog' >&2; exit 1; }
grep -Fq 'Dotchi: This or That Polls' "$tmp/apps.html" || { echo 'FAIL Dotchi catalog still presents an anime-only app' >&2; exit 1; }
Expand Down
35 changes: 35 additions & 0 deletions scripts/test_catalog_deploy_contract.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use strict';
const test = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');

const root = path.join(__dirname, '..');
const catalog = fs.readFileSync(path.join(root, 'apps.html'), 'utf8');
const releaseSmoke = fs.readFileSync(path.join(__dirname, 'check_app_discovery_live.sh'), 'utf8');

test('the live gate checks all five source locale choices', () => {
for (const lang of ['en', 'ja', 'es', 'pt-BR', 'id']) {
assert.ok(catalog.includes('option value="' + lang + '"'), lang + ' missing from source');
}
assert.ok(releaseSmoke.includes('for language in en ja es pt-BR id'));
assert.ok(releaseSmoke.includes('catalog_language_selected'));
assert.ok(releaseSmoke.includes('id="catalog-language"'));
assert.ok(releaseSmoke.includes('CATALOG_LOCALE_START'));
});

test('catalog remains complete and existing analytics are preserved', () => {
assert.equal((catalog.match(/class="app-card"/g) || []).length, 92);
assert.match(catalog, /"numberOfItems": 92/);
for (const event of ['download_click', 'catalog_store_click', 'catalog_search_used']) {
assert.ok(catalog.includes(event), event);
}
assert.ok(catalog.includes('catalog_language_selected'));
});

test('the live gate is read-only and preserves fail-fast behavior', () => {
assert.ok(releaseSmoke.includes("fetch '/apps' 'apps.html'"));
assert.ok(releaseSmoke.includes('exit 1'));
assert.ok(!releaseSmoke.includes('rsync '), 'live smoke must not deploy');
assert.ok(!releaseSmoke.includes('ssh '), 'live smoke must not mutate remote host');
});
Loading