lili 6201f95146 feat(wg1-gen): 便宜模型生成可真玩轻游戏——L1 worker + 七门真玩 harness(HJ-GEN-001 成立)
W-G1 生成核心:brief→便宜模型写 GameHostFactory→esbuild __GameBundle iife→P1 bootGameHost
装载→本机 Chrome+CDP 七门真玩取证;失败回喂错因重试。只消费冻结契约,零改 P1/P2。

实测(deepseek-v4-flash 最便宜档):Pong/Simon/打地鼠 三款【七门全过真玩】,
单款 ¥0.01–0.03(远低于 ¥0.15 L1 闸门)。最优模型:flash 打底 + 难档升 deepseek-v4-pro(Simon 0 重试 ¥0.06)。

关键:实证「能生成代码 ≠ 能玩」——一处 prompt 输入坐标契约写错(误称 x/y∈[0,1],实为逻辑像素)
让生成游戏能编译/渲染/动但点击全失灵;Pong 因自走动画假绿混过、Simon 被正确判否。
为此加装 G 门(确定性 A/B 对照,隔离自走动画假绿)+ 修 prompt 后三款真过。

- harness:games/_wg1-gen/_shared/{entry-bundle 模板,index 模板,play.cdp.cjs 七门,serve-and-play.sh}(复用 ref buildRefHostConfig + browser-evidence.cjs)
- worker:wg1/gen-worker/worker/{_client(代理旁路),prompt(生成上下文包),validate(静态门+node --check),cost(¥折算),run(§3 编排+重试门)}
- golden-path 自检:ref 工厂 5/6(F=0 菜单态正确)+ probe 工厂 7/7 → harness 无假绿
- game-runtime/package.json:加 ws(CDP 驱动 devDep)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 22:50:24 -07:00

113 lines
2.5 KiB
JSON

{
"game_id": "simon_m27",
"model": "MiniMax-M2.7",
"pass": true,
"retries": 1,
"attempts": [
{
"attempt": 0,
"stage": "validate",
"errors": [
"违禁:禁引擎名字空间"
],
"usage": {
"prompt_tokens": 2772,
"completion_tokens": 9060,
"total_tokens": 11832,
"wall_s": 50.423,
"id": "067d72961fd8f0b8281f7b2eb1cd1c98",
"finish_reason": "stop"
}
},
{
"attempt": 1,
"stage": "play",
"errors": [],
"usage": {
"prompt_tokens": 2810,
"completion_tokens": 2852,
"total_tokens": 5662,
"wall_s": 38.424,
"id": "067d72c8e53af4df07b125150952614d",
"finish_reason": "stop"
},
"play_pass": true,
"verdict_guards": {
"A_boot": true,
"C_frame": true,
"D_render": true,
"E_live": true,
"B_uncaught": true,
"F_wiring": true,
"G_input": true
}
}
],
"factory_path": "game-runtime/games/_wg1-gen/simon_m27/factory.js",
"bundle_path": "game-runtime/games/_wg1-gen/simon_m27/bundle.iife.js",
"verdict": {
"gameId": "simon_m27",
"url": "http://localhost:4320/games/_wg1-gen/simon_m27/index.html",
"ts": null,
"guards": {
"A_boot": {
"pass": true
},
"C_frame": {
"pass": true,
"f0": 54,
"f1": 84,
"delta": 30
},
"D_render": {
"pass": true,
"bright": 346491,
"maxCh": 255
},
"E_live": {
"pass": true,
"distinctStates": 5,
"samples": 11
},
"B_uncaught": {
"pass": true,
"uncaught": []
},
"F_wiring": {
"pass": true,
"callCount": 409,
"sample": [
"audio.synth.synthSfx",
"particles.spawnEmitter",
"audio.synth.synthSfx",
"particles.spawnEmitter",
"audio.synth.synthSfx",
"particles.spawnEmitter",
"audio.synth.synthSfx",
"particles.spawnEmitter"
],
"expected": [
"audio.synth",
"particles."
]
},
"G_input": {
"pass": true,
"inputHash": "94bda89a",
"controlHash": "990dbcba",
"atFrame": 403,
"ctrlFrame": 405
}
},
"pass": true,
"notes": []
},
"tokens": {
"prompt": 5582,
"completion": 11912
},
"request_ids": [
"067d72961fd8f0b8281f7b2eb1cd1c98",
"067d72c8e53af4df07b125150952614d"
]
}