Files
open-design-crew[bot] 1765dd0b0b [OPEND-5936] OpenGame Stage 1 Cloud Launch: read-only MCP catalog, cookieless static play, 21-section skill & Game Studio (#1198)
* feat(game-static-play): add 274-template R2 zip packaging, cookieless static play deploy, and verification pipeline

* feat(game-skill): port 21-section OpenGame skill with dual-mode workflow and fast-play path

* feat(onboarding): upgrade Cloud MCP install guide and add shared OpenGame prompt builders

* feat(game-catalog): sync 274 official templates, 4 kits, downloads manifest, and game contract

* feat(cloud-mcp): add read-only game catalog, free asset search, guest catalog API, redirects, and Docker packaging

* feat(opengame): enable Stage 1 Game Studio routing, feature flags, and analytics

* feat(opengame): add Stage 1 market, multi-client modal, Cursor HTTP fix, SuperAgent prompt, and i18n

* fix(opengame): align nullable GameCardWithMeta fields and add opengame-catalog MCP capability

* test(mcp-onboarding): update registered public tool count from 22 to 24 for Stage 1 game tools

* chore(game-catalog): register 26 verified live R2 in-repo template bundles in game-downloads.json

* fix(opengame): address Stage 1 review feedback and failing CI lanes

- Send no play URL when GAME_PLAY_PUBLIC_ORIGIN is unset instead of a main-site
  path that no route serves; Studio falls back to bundled in-repo templates
- Keep legacy-host 301 redirects on the configured origin for network-path inputs
- Correct the BlenderKit page host in the asset search allowlist
- Reuse the shared withdrawn list, TOP earning tag, curated order and comparator in Studio
- Remove the unused shared prompt module; the shipped builders stay covered by Studio tests
- Drop the blurred launch backdrop and the in-dialog copy notices in favour of Toasts
- Describe the shipped read-only Game Studio boundary and 24-tool MCP contract in the architecture
- Schedule the game skill and static play suites in CI and budget the three OpenGame events

* fix(game-static-play): retry stalled template bundle downloads before failing the run

* fix(game-asset-search): size the pagination cursor limit for every supported query

A 200-unit query with non-ASCII, control or lone-surrogate characters produced a
cursor longer than the 512-character limit, so nextCursor was rejected by both
the decoder and the public schema. Share one limit derived from the worst-case
JSON/base64url expansion and add a round-trip test for maximum-length queries.

* fix(game-asset-search): accept BlenderKit pages on www.blendkit.com and guide licence checks

www.blenderkit.com now redirects to www.blendkit.com and the upstream catalog
returns that host, so requiring www.blenderkit.com dropped every BlenderKit
result. Restore the live host, pin a real upstream row in tests, and tell
Agents to confirm the licence on the source page when a source omits it.

* fix(deploy): forward game play origin and legacy redirect hosts to the API

deploy/.env.example and deploy/k8s/configmap.yaml declared GAME_PLAY_PUBLIC_ORIGIN
and APP_REDIRECT_FROM_HOSTS, but neither the compose api service nor the reference
api Deployment passed them to the process. Wire both and assert that every
reference ConfigMap key is read by a workload.

* Address review: keep legacy-host writes, enforce play-origin isolation, share catalog constants

- Legacy-host redirects answer GET/HEAD with 301 and every other method with 308,
  so MCP and API writes keep their method and body.
- parseConfig rejects a GAME_PLAY_PUBLIC_ORIGIN that is not https (loopback http
  excepted), carries a path, or shares or sits under the APP_PUBLIC_ORIGIN host.
- The template id pattern, bundle key prefix, withdrawn set and TOP tag predicate
  live in shared/game-contract.ts; static play, deploy/verify scripts and the
  catalog service reuse them and the shared bundle URL builder.
- Remove unused game-contract and model-catalog exports.
- Update the MCP contract, AGENTS.md, README and docs to the 24-name phase-one
  surface and document the read-only OpenGame tools and guest catalog routes.

* fix(game-static-play): make the full play-site upload resumable

Upload through the S3 SDK instead of one aws CLI process per file, skip
objects whose ETag already matches the local MD5, retry each request with
backoff, and write assets before entry pages and the manifest. Give large
bundle downloads time for a slow link. Record the provisioned bucket,
domain and remaining header rule in the runbook.

* feat(game-static-play): harden live play verification and add manual R2 publish workflow

* fix(opengame): raise prompt/remix maxLength for >4k OG-13 test and reset notes on target change

* fix(mcp): register resources/templates/list handler for Codex MCP compliance

* chore(game-catalog): register uploaded tidebreaker bundle for 274/274 R2 CDN parity

---------

Co-authored-by: heggria <bshengtao@gmail.com>
2026-11-30 23:39:22 -08:00

303 lines
12 KiB
YAML

name: Motion standalone checks
# OpenMotion container-first CI: validates repository policy, design system,
# Studio UI, cloud backend (PostgreSQL + Redis + S3 CAS), MCP Streamable HTTP,
# and multi-target container definitions.
on:
workflow_call:
pull_request:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: motion-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
template-library:
name: Template library policy
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout source and contribution history without LFS media
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
lfs: false
persist-credentials: false
- name: Setup pinned Node
uses: actions/setup-node@v6
with:
node-version: '26.11.1'
- name: Require Squash merges for sanitized media history
env:
GH_TOKEN: ${{ github.token }}
run: |
# GraphQL variables are passed through gh fields, not expanded by the shell.
# shellcheck disable=SC2016
gh api graphql -f owner="$GITHUB_REPOSITORY_OWNER" -f repo="${GITHUB_REPOSITORY#*/}" \
-f query='query($owner: String!, $repo: String!) { repository(owner: $owner, name: $repo) { squashMergeAllowed mergeCommitAllowed rebaseMergeAllowed } }' \
--jq '.data.repository | if .squashMergeAllowed and (.mergeCommitAllowed | not) and (.rebaseMergeAllowed | not) then "Squash-only merge policy confirmed" else error("Enable Squash merge only before accepting cleaned media PRs") end'
- name: Check the final merge tree and media policy
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
if [[ "$BASE_SHA" =~ ^0+$ ]]; then unset BASE_SHA; fi
npm run templates:check -- --final-tree
npm run storage:check -- --final-tree
node --test tests/repository-storage.test.ts tests/media-transfer.test.ts tests/studio-preview-release.test.ts
node --test tests/template-library.test.ts tests/ci-scope.test.mjs tests/source-update-guidance.test.mjs
maintainability:
name: Maintainability report
if: github.event_name == 'pull_request' && github.base_ref == 'main'
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Checkout PR merge result
uses: actions/checkout@v6.0.2
with:
fetch-depth: 2
persist-credentials: false
- name: Setup pinned Node
uses: actions/setup-node@v6
with:
node-version: '26.11.1'
cache: npm
cache-dependency-path: |
package-lock.json
.github/maintainability/package-lock.json
- name: Select checks for the changed boundary
id: scope
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: node .github/scripts/ci-scope.mjs
- name: Compare source against the PR base
if: steps.scope.outputs.maintainability == 'true'
shell: bash
env:
PR_HEAD_REVISION: ${{ github.event.pull_request.head.sha }}
run: |
test "$(git rev-parse HEAD^2)" = "$PR_HEAD_REVISION"
BASE_REVISION=$(git rev-parse HEAD^1)
base_dir=$(mktemp -d "$RUNNER_TEMP/motion-base.XXXXXX")
git archive "$BASE_REVISION" | tar -x -C "$base_dir"
npm ci --prefix "$base_dir" --ignore-scripts --no-audit --no-fund
npm ci --ignore-scripts --no-audit --no-fund
npm ci --prefix .github/maintainability --ignore-scripts --no-audit --no-fund
node .github/maintainability/report.mjs "$base_dir" "$BASE_REVISION" >> "$GITHUB_STEP_SUMMARY"
checks:
name: Source checks
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 2
persist-credentials: false
- name: Setup pinned Node
uses: actions/setup-node@v6
with:
node-version: '26.11.1'
cache: npm
cache-dependency-path: package-lock.json
- name: Select checks for the changed boundary
id: scope
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: node .github/scripts/ci-scope.mjs
- name: Test release controls without publication credentials
run: node --test tests/release-workflows.test.mjs tests/release-scan.test.mjs tests/registry-download.test.mjs tests/stable-release.test.mjs tests/release-notes.test.mjs tests/publish-template-catalog.test.mjs tests/template-registry-consumer.test.mjs tests/orbit-cloud-test-sync.test.mjs
- name: Exercise cloud test promotion against a local remote
run: bash tests/cloud-test-promotion.sh
- name: Install locked Motion dependencies
if: steps.scope.outputs.full == 'true'
run: npm ci --no-audit --no-fund
- name: Check source and Studio types
if: steps.scope.outputs.full == 'true'
run: |
npm run check
npm run design:test
node --test tests/source-build-state.test.ts
npm run typecheck:studio
npm run typecheck:backend
npm run typecheck:cloud
- name: Measure component adoption and detached styles
if: steps.scope.outputs.full == 'true'
env:
PR_HEAD: ${{ github.event.pull_request.head.sha }}
run: |
node --test tests/ui-metrics.test.ts
args=()
if [[ -n "$PR_HEAD" ]]; then
test "$(git rev-parse HEAD^2)" = "$PR_HEAD"
args+=(--base "$(git rev-parse HEAD^1)")
fi
npm run design:metrics -- "${args[@]}"
cat dist/ui-metrics/report.md >> "$GITHUB_STEP_SUMMARY"
- name: Upload UI metrics with source locations
if: steps.scope.outputs.full == 'true'
uses: actions/upload-artifact@v7.0.2
with:
name: ui-metrics
path: dist/ui-metrics/
if-no-files-found: error
- name: Check capture failure classification and bounded recovery
if: steps.scope.outputs.full == 'true'
run: node --test tests/capture-retry.test.ts
- name: Check composition, discovery and install attribution
if: steps.scope.outputs.full == 'true'
run: node --test tests/composition-canvas.test.ts tests/short-form-discovery.test.ts tests/install-attribution-worker.test.ts
studio:
name: Studio regression (${{ matrix.shard }}/2)
env:
OPENMOTION_TELEMETRY: '0'
strategy:
fail-fast: false
matrix:
shard: [1, 2]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 2
persist-credentials: false
- name: Setup pinned Node
uses: actions/setup-node@v6
with:
node-version: '26.11.1'
cache: npm
cache-dependency-path: package-lock.json
- name: Select checks for the changed boundary
id: scope
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: node .github/scripts/ci-scope.mjs
- name: Install locked Motion dependencies
if: steps.scope.outputs.full == 'true'
run: npm ci --no-audit --no-fund
- name: Studio regression
if: steps.scope.outputs.full == 'true'
run: npm run test:studio -- --maxWorkers=2 --shard=${{ matrix.shard }}/2
cloud:
name: Cloud backend, security scan & container checks
runs-on: ubuntu-24.04
timeout-minutes: 25
env:
OPENMOTION_TELEMETRY: '0'
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 2
persist-credentials: false
- name: Setup pinned Node
uses: actions/setup-node@v6
with:
node-version: '26.11.1'
cache: npm
cache-dependency-path: package-lock.json
- name: Select checks for the changed boundary
id: scope
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: node .github/scripts/ci-scope.mjs
- name: Scan tracked source without publication credentials
run: |
node .github/scripts/motion-scan.mjs install "$RUNNER_TEMP/scanner"
node .github/scripts/motion-scan.mjs source . "$RUNNER_TEMP/source-scan.json" "$RUNNER_TEMP/scanner/gitleaks"
- name: Install locked Motion dependencies
if: steps.scope.outputs.full == 'true'
run: npm ci --no-audit --no-fund
- name: Build Studio and tracking bundles
if: steps.scope.outputs.full == 'true'
run: |
npm run build:studio
npm run build:tracking
npm run build:observability
- name: Install FFmpeg for cloud media worker tests
if: steps.scope.outputs.full == 'true'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends ffmpeg
- name: Run cloud backend and integration test suite
if: steps.scope.outputs.full == 'true'
run: |
node --experimental-strip-types --test tests/cloud/*.test.ts
node --experimental-strip-types --test \
tests/design-system.test.ts \
tests/mcp-onboarding.test.ts \
tests/mcp-registry.test.ts \
tests/public-names.test.ts \
tests/extension-boundary.test.ts \
tests/integration-setup.test.ts \
tests/tracking-device.test.ts \
tests/tracking-task-ledger.test.ts \
tests/command-lifecycle.test.ts \
tests/brand-catalog.test.ts \
tests/brand-cover.test.ts \
tests/design-catalog.test.ts \
tests/font-catalog.test.ts \
tests/font-specimen.test.ts \
tests/studio-fonts.test.ts \
tests/hosted-template-catalog.test.ts \
tests/template-cards-ui.test.ts \
tests/template-prompts.test.ts \
tests/recreate-measure.test.ts \
tests/motion-design-remix.test.ts \
tests/spa-routes.test.ts \
tests/scenario-content.test.ts \
tests/inline-storyboard.test.ts \
tests/game-skills.test.ts \
tests/game-static-play.test.ts
- name: Validate container and Compose definitions
if: steps.scope.outputs.full == 'true'
run: |
docker compose -f deploy/docker-compose.yml config -q
docker buildx build --check -f deploy/Dockerfile --target api .
docker buildx build --check -f deploy/Dockerfile --target worker-media .
docker buildx build --check -f deploy/Dockerfile --target worker-render .
docker buildx build --check -f deploy/Dockerfile --target catalog-sync .
- name: Check presentation documentation
if: steps.scope.outputs.full != 'true'
env:
CHANGED_DOCS: ${{ steps.scope.outputs.documents }}
run: |
node .github/scripts/ci-scope.mjs --check-docs
echo 'Presentation documentation checked; Studio and cloud backend checks were not needed. Source scanning and repository policy checks still ran.' >> "$GITHUB_STEP_SUMMARY"
# Keep the existing required check while every independent lane runs in parallel.
standalone:
if: ${{ always() }}
needs: [template-library, maintainability, checks, studio, cloud]
runs-on: ubuntu-24.04
timeout-minutes: 2
steps:
- name: Require every validation lane
env:
VALIDATION_RESULTS: ${{ toJSON(needs) }}
ALLOW_SKIPPED_MAINTAINABILITY: ${{ github.event_name != 'pull_request' || github.base_ref != 'main' }}
run: |
node --input-type=module <<'NODE'
const results = JSON.parse(process.env.VALIDATION_RESULTS);
for (const job of ['template-library', 'maintainability', 'checks', 'studio', 'cloud']) {
const result = results[job]?.result;
const expected = job === 'maintainability' && process.env.ALLOW_SKIPPED_MAINTAINABILITY === 'true'
? 'skipped' : 'success';
if (result !== expected) {
console.error(`${job}: expected ${expected}, received ${result ?? 'missing'}`);
process.exitCode = 1;
}
}
NODE