mirror of
https://github.com/PlayableIntelligence/game-creator.git
synced 2026-09-19 07:34:10 +08:00
b05949914c
Wraps OpusGameLabs/game-eval's BH (Build Health) bench into a user- facing skill. The wrapper script handles npm install + npm run build (passing --base=./ to vite to produce relative paths the local bench can serve), invokes bench_bh.ts as a subprocess, and prints a structured summary the agent can act on. Where game-eval lives is resolved via: 1. $GAME_EVAL_DIR (explicit override) 2. ../game-eval/ (sibling-of-game-creator default) The skill exits 2 with a clear "clone OpusGameLabs/game-eval or set GAME_EVAL_DIR" message when neither resolves — no silent fallback. What BH measures: page load + canvas render + console errors + uncaught exceptions + failed requests + non-blank frame count, deductive [0, 100] score. VU pixel-half (entropy + motion) ships alongside but is null when BH is invalid. End-to-end validated: - templates/phaser-2d (clean) → BH=100 valid=true - examples/flappy-bird (real game, GH-Pages base path) → BH=100 valid=true (vite --base=./ override is what unlocks this; without it every asset 404s when served from bench_serve's root) - game-eval's runtime/null-deref fixture → BH=30 valid=false, surfaces "Cannot read properties of undefined (reading 'sprite')" verbatim - game-eval's build/syntax-error fixture → wrapper exits 2 at build phase with vite parse error visible Calibration follow-up landing in game-eval: BLANK_ENTROPY threshold in bench_bh.ts lowered from 0.5 → 0.05. The original threshold was calibrated against vanilla-canvas BH fixtures whose broken cases all hit luma≈0, never exercising the entropy path. Real games with flat-color regions (sky + ground + player) measure 0.4-bit entropy — visibly content-rich but below the old threshold. The kill gate still PASSES on all four BH fixtures with the new threshold. Files: - scripts/eval-game.mjs — orchestration wrapper (~190 LOC) - skills/eval-game/SKILL.md — agent-facing skill definition - .gitignore — exclude eval-output/ from runs The skill is NOT auto-invoked by make-game's verification protocol in this PR. That's a separate decision (eval-game adds 30-60s per build which materially slows the full pipeline). User invokes via "evaluate my game" or analogous; future PR can wire it into make-game's Phase between architecture validation and visual review if useful. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>