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

149 lines
3.4 KiB
JSON

{
"game_id": "simon",
"model": "deepseek-v4-flash",
"pass": true,
"retries": 2,
"attempts": [
{
"attempt": 0,
"stage": "play",
"errors": [],
"usage": {
"prompt_tokens": 2889,
"completion_tokens": 5185,
"total_tokens": 8074,
"wall_s": 64.097,
"id": "209eb027-fdda-4329-9ba7-e1080481463e",
"finish_reason": "stop"
},
"play_pass": false,
"verdict_guards": {
"A_boot": true,
"C_frame": true,
"D_render": true,
"E_live": false,
"B_uncaught": true,
"F_wiring": false,
"G_input": false
}
},
{
"attempt": 1,
"stage": "play",
"errors": [],
"usage": {
"prompt_tokens": 3079,
"completion_tokens": 4136,
"total_tokens": 7215,
"wall_s": 44.641,
"id": "67601480-dab4-4a9b-8678-9439300404c9",
"finish_reason": "stop"
},
"play_pass": false,
"verdict_guards": {
"A_boot": true,
"C_frame": false,
"D_render": false,
"E_live": false,
"B_uncaught": false,
"F_wiring": false,
"G_input": false
}
},
{
"attempt": 2,
"stage": "play",
"errors": [],
"usage": {
"prompt_tokens": 3152,
"completion_tokens": 4899,
"total_tokens": 8051,
"wall_s": 52.141,
"id": "1b2f10ad-c080-4ae9-9d3f-fa2096861ce7",
"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/factory.js",
"bundle_path": "game-runtime/games/_wg1-gen/simon/bundle.iife.js",
"verdict": {
"gameId": "simon",
"url": "http://localhost:4320/games/_wg1-gen/simon/index.html",
"ts": null,
"guards": {
"A_boot": {
"pass": true
},
"C_frame": {
"pass": true,
"f0": 48,
"f1": 79,
"delta": 31
},
"D_render": {
"pass": true,
"bright": 264569,
"maxCh": 255
},
"E_live": {
"pass": true,
"distinctStates": 6,
"samples": 11
},
"B_uncaught": {
"pass": true,
"uncaught": []
},
"F_wiring": {
"pass": true,
"callCount": 128,
"sample": [
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut",
"math.easing.quadOut"
],
"expected": [
"audio.synth",
"particles."
]
},
"G_input": {
"pass": true,
"inputHash": "a5100b7a",
"controlHash": "f7530fdd",
"atFrame": 400,
"ctrlFrame": 405
}
},
"pass": true,
"notes": []
},
"tokens": {
"prompt": 9120,
"completion": 14220
},
"request_ids": [
"209eb027-fdda-4329-9ba7-e1080481463e",
"67601480-dab4-4a9b-8678-9439300404c9",
"1b2f10ad-c080-4ae9-9d3f-fa2096861ce7"
]
}