2 Commits

Author SHA1 Message Date
lili
14c79dbfdd feat(studio): A11 切片三 M4 模块重生成执行(有界单文件 LLM 重写 game-logic.js)
两段式第二段的 regenerate-module 类:改玩法 = 据 intent 有界重写 game-logic.js,不动其余。

复用机制(参数化、不复制 resume/熔断/收口):
- cheap_studio.run_studio 加 4 个默认 None 可选参(system_prompt/initial_kick/write_whitelist/prepare)
  切到 modify 态,create 路零行为变化(params=None 等价原逻辑)
- cheap_toolkit.build_toolkit 加 write_whitelist(非白名单 basename 写直接拒)
- cheap_roles.build_modify_system_prompt(复用 create 红线契约块)

cheap_modify.execute_regenerate_modify:
- 取 intent(空→failed)→ materialize base 源 → 重写前后对非目标文件算 hash
- 有界重写(写边界收窄到只 game-logic.js)→ 九门
- status=succeeded ⟺ 九门过 ∧ 非目标稳;manifest{file,kind:behavior,intent,changed,untouchedStable}(断言②地基)

worker_service._process_regenerate_job(regen_fn):把 M3 的 regenerate-module 显式 failed 占位换成真执行;
deterministic/create/生成路一字未动。

测试:test_a11_m4_regenerate 10/10(全注入桩零 LLM)+ 全回归独立复跑 73 测试全绿。
一次真 LLM smoke(单跑):intent=连击递增 → status=succeeded、untouchedStable=True、九门 pass、
attempts=1、¥0.31、137s;独立 diff 佐证 5 非目标文件字节相同、仅 game-logic.js 变。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 02:16:22 -07:00
lili
51230f1347 feat(studio): A11 切片三 M3 确定性类执行(零 LLM 改规范工程一处→重建→九门)
两段式第二段的 deterministic 类:用户确认后的改动落到规范工程那一处,零 LLM。

cheap_modify.py:
- apply_deterministic_modify:config/level→core.js 等 L3 的 export const 值替换;
  asset→assets.js IMAGE_FILES 键值或 baseUrl;no-op 检测(无 found&&old≠new→ok=false,M5 断言①地基)
- materialize_source_project:系统级落盘全 files(含 L1,绕 write_file 的 L1 守卫)
- execute_deterministic_modify:apply→(缺 plumbing 才 scaffold)→materialize→cheap_run build/stage/smoke/play 九门

worker_service.py:
- process_job 最前 modify 分流(_process_modify_job);deterministic 走执行 + manifest 进 trace.modifyManifest
  + best-effort 带新版 sourceProject(链式改);regenerate-module 显式 failed 留 M4;create/生成路一字未动

测试:test_a11_m3_deterministic 18/18 + 回归全绿。
九门 smoke(独立复跑,本机 Chrome 免 LLM):amgen-bake-click-score-0 base 源 → ROUND_MS 30000→19000
→ status=succeeded、verdictPass=true、manifest found=true、落盘 core.js=19000、运行时 remainMs=19000
(改的那一处真在游戏里生效并过九门)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 01:49:10 -07:00