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

46 lines
5.2 KiB
Plaintext
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.

# tier2 · 富游戏自治生成线(模块定义)
> 独立 AgentScope 2.0.2 Python 模块。运行期**零耦合** SAA 廉价线(`wg1/` Python worker + game-cloud Java SAA
> 用约束自治O2单写 ReAct agent + Phaser/Pixi 引擎,造现有 LittleJS 廉价线做不出的多系统富游戏(合成 / 经营 / 挂机)。
## 目标功能
- 起步fork 种子 worker框架接缝平移+ Agent 内多轮自治 ReAct单写、阶段 2 起步)+ 本地 runner不上 Agent Service
- 迭代M3 写代码逻辑 + mmx 产美术音乐,三层校验(初期只焊 L1笼子内连续迭代。
- 判据离散A 门 = M3 证路(软)/ B 门 = 便宜档 n≥30才转重机器退路树数字触发线。
## 边界(红线)
- **运行期零碰 SAA**:禁 `import wg1.*` 运行态 / SAA 配置 / L2 模型路由表forbidden-import CI 守门:`ci/check-forbidden-import.sh`)。
- **复用只走显式传参**`cost.compute()`纯函数可直接调endpoint / key / model / pricing / quota / retry / timeout 全显式传入,禁读 `wg1` 模块级全局。
- **装载 / 契约 / 沙箱独立**:绝不碰 Tier0/1 ECS-lite 装载路(`contracts/agent-loop/source-project.schema.json`、`game-runtime/src/host/*`tier2 另立独立源项目契约与第二装载分支Phase B
- **模型统一 new-api 出口**`baseUrl` + `NEWAPI_KEY`,凭据见 `docs/内网凭据与端点.md`协议不锁M3 走 Anthropic `/v1/messages`。
## 现状2026-06-23 · 6c6g 集成完成,引擎代码已落,待 mini-desktop 真跑)
- ✅ 模块骨架 + 独立依赖(锁 `agentscope==2.0.2`+ governance + forbidden-import CI + 交接 brief。
- ✅ **6 模块接成一条线(本次集成)**
- M3 agent loop`worker/agent_loop/studio.py`Agent + Toolkit + AnthropicChatModel + 四熔断 + BYPASS 权限API 全过 v2.0.2 源码核);
- 九工具 toolkit 真接 M1 scaffold / M2 harness / M4 datatable / build
- `scaffold_init` → `run.load_fixture_scaffold('business-sim')` 铺 mini-肥鹅 平台预建骨架12 文件),数据表种子用 `datatable.empty.json`(留空 sentinelagent 自治填值),不拿金标当答案;
- `build` → `tier2/engine/build-phaser.mjs <工程根> --global-name=__Tier2GameBundle`(多文件 esbuild Phaser iifeCLI 已对齐:传工程根非 entry/out 绝对路径,补 `--entry` 透传);
- `run_gates` → `tier2/harness/serve-and-play-phaser.sh`serve **仓根** 起 static-serve + headless chrome → `play-phaser.cdp.cjs` 跑 L1 九门 + 富游戏三门 → 产 `evidence/verdict.json`
- `run.scaffold` 拷 `tier2/harness/index.template.html` 进 gen 目录(宿主页经绝对路径 `/tier2/engine/` 引 host故 serve 仓根);
- `run_gates` 从 agent 真填的 `data/datatable.gold.json` 派生三联动门静态校验的 `richGame`(查 agent 实际表而非硬编码样例)。
- 可跑入口 `run_engine.py`(一句话 brief → 单写 agent 自治 fill datatable + 写表现层 → build → 九门+富游戏门 → 读 verdict → 改直到过门或熔断M3 走 new-api Anthropic 端点key 从 `docs/内网凭据与端点.md` / env 读)。
- ✅ 6c6g 静态校验全过:所有 `.json` 过 `json.tool` + 两 schema 过 Draft2020-12 元校验;所有 `.py` 过 `py_compile`;所有 `.js/.cjs/.mjs` 过 `node --check`serve 脚本过 `bash -n`harness `assembleVerdict` 实际输出accept/fix 多轮)过 `tier2-verdict.schema.json`fixture `tier2-source-project.json` 过 A3 schemafixture logic-smoke五耦合点 + 赢输双路径 + latch+ host-headless-smoke 全绿。
- ⏭ **端到端真跑build esbuild + CDP 九门 + n≥30 成功率)在 mini-desktop**6c6g 禁 chrome / 无 esbuild见 `tier2/RUN-ON-MINI-DESKTOP.md`。
## 不在范围(属别处 / 别线)
- gamedef 废除另一会话SAA 廉价线运行态Cocos / Tier3 / 3D / 渠道导出正交轴、Phaser 证成后)。
## 设计源 / 计划
- HOW 计划:`docs/plans/2026-06-22-003-feat-tier2-富游戏自治生成线-plan.md`
- WHAT 需求:`docs/brainstorms/2026-06-22-tier2-整体实现方案-requirements.md`
- 框架速查:`.agents/knowledge/agentscope-2.0-facts.md`v2.0.2;API 拿不准先读 `/root/oss/agentscope` 源码)
- 属主设计档:`docs/architecture/架构/生成引擎/{tier2四层工程架构,tier2实现详设,自治富游戏引擎,agentic集成架构,agentic运行时架构图说}.md`
## TODO剩余 · 多在 mini-desktop 真跑后才能闭环)
- **mini-desktop 端到端首跑**:按 `tier2/RUN-ON-MINI-DESKTOP.md` —— 同步分支 → `pip install agentscope[full]==2.0.2`venv `/root/.venvs/agentscope-tier2`)→ `npm i -D esbuild` + 装 phaser或宿主页 CDN→ `python run_engine.py feie-001 --brief ...` → 看是否 finish + 过门。
- U5 mmx 资产工具(`query_asset` 现走占位池,真 provider 接入待 A9
- U7 A/B 证据门 + 便宜档 n≥30 成功率B 门硬判 80%)。
- 沙箱底座定调:默认候选 B直接 CDP本 harness 即其实现);候选 Aagentscope-runtime BrowserSandbox零实证见 `tier2/harness/SANDBOX-PROBE.md`。
- **真跑(构建 / CDP / headless / n≥30在 mini-desktop**6c6g 禁 chrome。