games-development-ai/tier2/run-on-mini-desktop-smoke.sh
zizi 856a583325 feat(tier2): Phaser 自治生成引擎全栈首落(workflow 9 agent 建·6c6g 静态全过)
override spike-first(创始人 06-23 裁),全栈铺 Phaser tier2 引擎。recon→契约→6模块并行→集成 workflow 产出 ~60 文件,全 6c6g 静态校验过、红线零碰 Tier0/1 产线:
- 契约(6):tier2-source-project.schema / tier2-verdict.schema(fork·round放开·三层校验+富游戏门)/ toolkit 签名 / 探针钩子 / boot-phaser-host.d.ts / mini-肥鹅 fixture 规格
- M1 Phaser scaffold+装载 host+引擎能力面(19;logic-smoke 13/13:五耦合点真接线+赢输双路径+latch不回弹)
- M2 CDP 探针 Phaser 重写+business-sim driver+九门+富游戏三门(5;verdict 过 schema)
- M3 Python 单写 ReAct agent loop+9 工具 toolkit+M3 Anthropic接法+四熔断(9;mini-desktop 真 2.0.2 venv 验:import/9工具/中间件注册 OK)
- M4 datatable schema+金标+资产占位(4)/ M5 prompt+Phaser skill+rag(13)/ M6 成本 RecordingChatModel+trace adapter(3)
- 集成:run_engine.py 入口 + 接线断点已修 + RUN-ON-MINI-DESKTOP.md

待 mini-desktop 真跑(esbuild build + CDP 九门 + M3 生成 = 本质即 0号 spike)。AgentScope 2.0.2 API 逐条对 /root/oss/agentscope 源码核验。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 20:13:44 +00:00

73 lines
4.1 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# run-on-mini-desktop-smoke.sh —— tier2 引擎整条【真跑链路】一键冒烟(不烧 LLM token)
# ownertier2 集成线 cwd 任意(脚本自定位仓根) 只在 mini-desktop 跑(6c6g 禁 chrome / 无 esbuild)
#
# 【这份验什么 · 与 run_engine.py 的分工】
# run_engine.py 真跑测【生成质量】(便宜模型能不能稳填数据表 + 写表现层),要烧 token、要 agent。
# 本冒烟用 **fixture(mini-肥鹅,数据表已是人工金标)** 走 build → run_gates,只验【装配链路】打通:
# 装载 host(boot-phaser-host) + esbuild 多文件 Phaser iife + serve 仓根 + CDP 九门 + 富游戏三门 → 产 verdict。
# 即「引擎能不能把一个合格 Phaser 源工程跑过门」,与生成能力解耦。fixture 金标设计就是先天能过门的对照组。
#
# 用法bash tier2/run-on-mini-desktop-smoke.sh
# 退出码0 = fixture 过 build + 九门 + 富游戏三门(真跑链路通);非 0 = 某段断(看输出定位)。
set -u
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
GAME_RUNTIME="$REPO_ROOT/game-runtime"
FIXTURE="$REPO_ROOT/tier2/fixtures/mini-fei-e"
GID="_smoke-feie"
GEN="$GAME_RUNTIME/games/_tier2-gen/$GID"
PORT="${1:-4331}" # 避开 run_engine 默认 4330,可并行
CDP_PORT="${2:-9323}"
echo "[smoke] 仓根=$REPO_ROOT gen=$GEN port=$PORT cdp=$CDP_PORT"
# ── 0) 前置:chrome + esbuild(仅 mini-desktop 有)──
command -v google-chrome >/dev/null 2>&1 || [ -x /usr/bin/google-chrome ] || \
{ echo "❌ 无 chrome — 本冒烟只在 mini-desktop 跑(6c6g 禁 chrome)"; exit 3; }
[ -x "$GAME_RUNTIME/node_modules/.bin/esbuild" ] || \
{ echo "❌ game-runtime 未装 esbuild — 先 cd game-runtime && npm i -D esbuild"; exit 3; }
# ── 1) 把 fixture(含金标数据表)铺进 gen 目录(模拟 scaffold 已填好的工程)──
rm -rf "$GEN"
mkdir -p "$GEN"
cp -r "$FIXTURE/src" "$GEN/src"
mkdir -p "$GEN/data"
cp "$FIXTURE/data/datatable.gold.json" "$GEN/data/datatable.gold.json" # 金标(已填,先天过门)
cp "$FIXTURE/data/datatable.schema.json" "$GEN/data/datatable.schema.json"
# 宿主页:用集成模板(绝对路径 /tier2/engine/ 引 host,serve 仓根才够到)。
cp "$REPO_ROOT/tier2/harness/index.template.html" "$GEN/index.html"
echo "[smoke] ① fixture 已铺进 gen($(find "$GEN/src" -type f | wc -l) 源文件 + 金标数据表 + index.html)"
# ── 2) build:esbuild 多文件打 Phaser iife ──
cd "$GAME_RUNTIME"
node "$REPO_ROOT/tier2/engine/build-phaser.mjs" "games/_tier2-gen/$GID" \
--global-name=__Tier2GameBundle --out=bundle.iife.js
BUILD_RC=$?
[ "$BUILD_RC" = 0 ] && [ -s "$GEN/bundle.iife.js" ] || \
{ echo "❌ ② build 失败(rc=$BUILD_RC) — 见上方 esbuild log"; exit 4; }
echo "[smoke] ② build OK → $GEN/bundle.iife.js ($(stat -c%s "$GEN/bundle.iife.js" 2>/dev/null || wc -c <"$GEN/bundle.iife.js") bytes)"
# ── 3) play-spec:用 fixture 样例 spec(business-sim driver + 经济门双路 + latch)──
cp "$REPO_ROOT/tier2/harness/mini-feie.play-spec.example.json" "$GEN/play-spec.json"
echo "[smoke] ③ play-spec 就位(business-sim driver + 富游戏三门)"
# ── 4) run_gates:serve 仓根 + headless chrome + play-phaser.cdp.cjs ──
cd "$REPO_ROOT"
echo "[smoke] ④ 真玩九门 + 富游戏三门 …"
bash "$REPO_ROOT/tier2/harness/serve-and-play-phaser.sh" "_tier2-gen/$GID" "$PORT" "$CDP_PORT"
PLAY_RC=$?
# ── 5) 判读 ──
V="$GEN/evidence/verdict.json"
if [ -f "$V" ]; then
echo "[smoke] ⑤ verdict:"
python3 -c "import json,sys; v=json.load(open('$V')); L1=v.get('layerResults',{}).get('L1',{}); print(' decision=',v.get('decision'),'| L1.passed=',L1.get('passed')); [print(' ',g['gate'],'pass' if g['passed'] else ('FAIL' if g['fatal'] else 'adv'), g.get('detail','')[:60]) for g in L1.get('gateResults',[])]; rg=L1.get('richGameGates',{}) or {}; [print(' 富[%s]'%k, (rg[k] or {}).get('passed')) for k in ('tripleLink','economy','latch') if rg.get(k) is not None]"
else
echo "[smoke] ⑤ ⚠ 无 verdict.json(harness 未产出 — 见上方 chrome/serve log)"
fi
echo "[smoke] 完成:play rc=$PLAY_RC(0=accept / 非0=非accept)"
exit "$PLAY_RC"