Files
openmotion/.github/scripts/game-test-failures.mjs
huihui-crypto ba3aaf2f60 feat(game-studio): add Game Studio with local game service and MCP game tools (#767)
* feat(game-studio): add Game Studio tab, local game service and MCP game tools

Game Studio page with template waterfall, My games sidebar, landscape/portrait choice and
auto-open of Agent-created drafts; local game projects service with rooms, playtest,
simulate and cover capture; openmotion_game_* MCP tools; openmotion-game handbook ported
from the MIT higgsfield-ai/skills handbook; coop-3d and arcade-2d starter kits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): register game tools, dedupe handbook provenance, fix search and code reload

Register the openmotion_game_* tools in MCP counts, onboarding scenarios and tracking
dimensions; keep them out of WebMCP. Move the shared MIT provenance note to PROVENANCE.md.
Studio search now matches localized titles, and the Code tab reloads its source.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): harden game service and fix invite copy and code fullscreen

Case-insensitive reserved paths and request-id saves; sandbox CSP for game documents;
WebSocket fragment count, time and buffer limits; AST-based determinism check;
single-player start for playtest and cover capture; atomic batch writes with rollback.
Studio: clipboard-write for embedded games and Code-tab fullscreen on the stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): trim KayKit characters below 1 MiB for the storage policy

Keep 12 common clips per character (meshes, skin and bones unchanged) so Knight.glb and
Mage.glb stay ordinary Git files; update the character README and the 3D handbook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(game-studio): hand drafts to the user's Agent; derive the WebSocket test nonce

Drafts show "Waiting for your Agent" until the Agent sets building. The draft page offers
Copy instruction and Open in Codex (prefill only) with the full instruction: game id, brief
and steps. GET /api/games/:id/handoff returns it for any workspace draft, including drafts
created elsewhere and remixes; creation now includes the portrait layout in the instruction.
Tests derive the RFC 6455 sample nonce at runtime so release scanning stays strict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): spin the detail status only while the Agent is building

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(game-studio): exercise all twelve game tools in the packaged MCP smoke test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): vendor acorn so packaged builds can run the game rules sandbox

Packaged builds ship without node_modules, so openmotion_game_simulate failed with
"Cannot find module 'acorn'". Ship acorn 8.19.0 (MIT, license in the file header) under
shared/vendor and import it relatively. Verified in a node_modules-free copy of the phase1
file list: create plus reference simulation wins at tick 809.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): resolve browser and trailer dependencies from the host runtime root

Packaged builds install npm dependencies under the data directory, so playtest, cover
capture and trailer recording failed with "Cannot find module 'puppeteer-core'" and the
trailer looked for HyperFrames in the plugin folder. Server and phase1 hosts now pass their
runtime root; puppeteer, HyperFrames checks, the trailer's Phase1Service and render queue
use it (source checkouts fall back to the plugin root). Verified in a node_modules-free
phase1 file copy: playtest, cover, simulate, publish and a trailer through ready.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): isolate catalog entries, smoke-test solo logic and run the game suite in CI

Review follow-ups:
- The catalog skips and reports a game folder it cannot read (an orphan or malformed
  game.json) instead of failing GET /api/games; create and remix remove their folder when
  a step fails, so a partial create no longer leaves an orphan.
- Validation runs the bounded logic.js smoke check for every game with rules. Single-player
  games follow validateAction as live play does, the loop stops when the game ends, and a
  kit game missing logic.js is reported. Room checks stay multiplayer-only.
- tests/game-projects.test.ts runs in the Distribution browser lane (Chrome and native
  export cases skip themselves when unavailable) and leaves the unscheduled list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(game-studio): stabilize scrolling and animate build indicator

* fix(game-studio): validate runtime before browser discovery

Resolve the requested runtime dependencies before detecting Chrome so missing-runtime diagnostics remain deterministic on Linux. Preserve all tests and emit failed Game Studio assertions as GitHub check annotations.

* fix(game-studio): stop waiting for network silence during capture

Wait for the document load and visible canvas while retaining room, startup and runtime assertions. Add a real polling regression that reproduces the 20-second navigation timeout and verifies successful background responses during capture.

---------

Co-authored-by: zhanghuihua <zhanghuihua@huihuideMacBook-Pro.local>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zhanghuihua <zhanghuihua@Mac.lan>
Co-authored-by: stevenguotj <stevenguotj@stevengotjdeMBP.lan>
2026-11-21 16:47:41 +08:00

14 lines
690 B
JavaScript

import { inspect } from 'node:util';
// Keep the normal test reporter and exit status; also expose failures in Checks.
export default async function* gameTestFailures(events) {
for await (const { type, data } of events) {
if (type !== 'test:fail' || data.details?.error?.failureType === 'subtestsFailed') continue;
const error = data.details?.error;
const detail = inspect(error?.cause ?? error, { depth: 5, colors: false }).slice(0, 8000);
const message = `${data.name}\n${data.file ?? ''}:${data.line ?? ''}\n${detail}`
.replaceAll('%', '%25').replaceAll('\r', '%0D').replaceAll('\n', '%0A');
yield `::error title=Game Studio regression::${message}\n`;
}
}