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

101 lines
2.2 KiB
JSON

{
"game_id": "whack",
"model": "deepseek-v4-flash",
"pass": true,
"retries": 0,
"attempts": [
{
"attempt": 0,
"stage": "play",
"errors": [],
"usage": {
"prompt_tokens": 2899,
"completion_tokens": 7223,
"total_tokens": 10122,
"wall_s": 82.596,
"id": "4c7994cd-39e6-4f4a-ba0a-2c91b423abc6",
"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/whack/factory.js",
"bundle_path": "game-runtime/games/_wg1-gen/whack/bundle.iife.js",
"verdict": {
"gameId": "whack",
"url": "http://localhost:4320/games/_wg1-gen/whack/index.html",
"ts": null,
"guards": {
"A_boot": {
"pass": true
},
"C_frame": {
"pass": true,
"f0": 49,
"f1": 80,
"delta": 31
},
"D_render": {
"pass": true,
"bright": 10256,
"maxCh": 255
},
"E_live": {
"pass": true,
"distinctStates": 15,
"samples": 15
},
"B_uncaught": {
"pass": true,
"uncaught": []
},
"F_wiring": {
"pass": true,
"callCount": 691,
"sample": [
"audio.synth.synthSfx",
"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": [
"particles.",
"audio.synth"
]
},
"G_input": {
"pass": true,
"inputHash": "a9de479b",
"controlHash": "b0584efe",
"atFrame": 446,
"ctrlFrame": 448
}
},
"pass": true,
"notes": []
},
"tokens": {
"prompt": 2899,
"completion": 7223
},
"request_ids": [
"4c7994cd-39e6-4f4a-ba0a-2c91b423abc6"
]
}