删除已完成的多窗口里程碑临时文档
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 4m38s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 4m57s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m36s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 5m52s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m42s
Project CI / AI game creator shell Rust crates (push) Successful in 2m39s
Project CI / Repository checks (push) Successful in 3m58s
Project CI / Frontend tests (push) Successful in 5m53s
Project CI / Native shell tests (push) Successful in 6m28s
Project CI / Backend tests (push) Successful in 7m49s
Project CI / AI game creator shell web tests (push) Successful in 2m8s
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 4m38s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 4m57s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m36s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 5m52s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m42s
Project CI / AI game creator shell Rust crates (push) Successful in 2m39s
Project CI / Repository checks (push) Successful in 3m58s
Project CI / Frontend tests (push) Successful in 5m53s
Project CI / Native shell tests (push) Successful in 6m28s
Project CI / Backend tests (push) Successful in 7m49s
Project CI / AI game creator shell web tests (push) Successful in 2m8s
- 按规范驱动开发工作流,里程碑与实施计划属临时产物,合并后删除 - 持久结论已回写 AGC 技术方案 2026-09-16 节、共享记忆决策记录与踩坑记录
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
---
|
||||
Version: 1
|
||||
Status: Active
|
||||
Date: 2026-09-16
|
||||
Milestone: 【里程碑】AGC同AppData多窗口共享Runner-2026-09-16.md
|
||||
---
|
||||
|
||||
# 【实施计划】AGC 同 AppData 多窗口共享 Agent Runner
|
||||
|
||||
## 代码边界
|
||||
|
||||
| 顺序 | 文件 | 修改 |
|
||||
| --- | --- | --- |
|
||||
| 1 | `runner/endpoint.rs` | 参与锁改名与共享句柄打开;新增 claim 发布;锁路径白名单同步 |
|
||||
| 2 | `runner/state.rs` | `ExternalAgentRunnerGuiOwnerLock` → 参与者锁;服务端状态字段改名 |
|
||||
| 3 | `runner/dispatch.rs` | attach 只在 epoch 变化时强制替换登录态;同 claim 重复 attach 为幂等空操作;事件接收端改为注册表 |
|
||||
| 4 | `runner/server.rs` | watchdog 与启动检查按“参与者存活”判定 |
|
||||
| 5 | `runner/client.rs` | 启动采纳 claim、平台登录态变化发布新 claim、attach 失败按最新 claim 重试 |
|
||||
| 6 | `agent/runtime_driver*` | 事件接收端从单槽改为按 token 去重的注册表并广播 |
|
||||
| 7 | `main.rs` | 启动阶段取参与者锁并 attach,不再要求独占 owner |
|
||||
| 8 | `runner/tests.rs` | 重写独占锁断言,补齐多窗口、广播、存活判定与失败关闭用例 |
|
||||
|
||||
## 修改顺序
|
||||
|
||||
先改 runner 内部(endpoint / state / dispatch / server),再改 GUI 客户端(client / main),最后改事件注册表与测试。每步保持可编译。
|
||||
|
||||
## 验证命令
|
||||
|
||||
```
|
||||
cargo test --manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml
|
||||
npm run check:encoding
|
||||
git diff --check
|
||||
```
|
||||
|
||||
真实二进制 smoke 在构建产物可用后执行:同一 AppData 启动两个 GUI,核对 `diagnostics/startup.log` 两次 `startup.setup.complete`、只有一个 `--agent-runner` 进程、关闭一个窗口后另一个仍可 attach。
|
||||
|
||||
## 风险与回滚
|
||||
|
||||
- 风险:共享参与锁后,Runner 可能在无窗口时仍存活。回滚点是 watchdog 的存活判定函数,恢复为独占 owner 语义即可。
|
||||
- 风险:claim 发布竞态。缓解为 bounded retry + 失败关闭,不做隐式合并。
|
||||
- 回滚:本里程碑只影响本机 GUI ↔ Runner 协议,回滚提交即可恢复单窗口语义;claim 与参与锁文件都是可重新生成的运行时产物。
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
Version: 1
|
||||
Status: Active
|
||||
Date: 2026-09-16
|
||||
Parent Spec: docs/technical/【技术方案】AI游戏创作智能体App实施计划-2026-06-24.md
|
||||
---
|
||||
|
||||
# 【里程碑】AGC 同 AppData 多窗口共享 Agent Runner
|
||||
|
||||
## 目标
|
||||
|
||||
同一个 AppData 允许同时运行多个 AGC 界面进程;它们共享同一个 Agent Runner、同一份平台登录态权威和同一份项目事实,并且都继续收到 Runtime / manifest 失效事件。
|
||||
|
||||
## 边界
|
||||
|
||||
- 参与本次变化的只有 GUI 与 Agent Runner 之间的本机协议:窗口参与锁、owner claim 发布与采纳、attach 语义、事件接收端注册表、Runner 存活判定与启动诊断。
|
||||
- 不修改平台 HTTP 契约、SpacetimeDB schema、`/api/external/v1`、渲染层 generation 语义和项目级 `.agent/project.lock`。
|
||||
- 一个项目同一时刻仍然只允许一个写者;多窗口不能并行写同一项目。
|
||||
|
||||
## 行为合同
|
||||
|
||||
1. 窗口启动不再因为“同一 AppData 已有界面进程”而失败。参与锁是共享句柄锁:任何数量的界面进程都可以同时持有;Runner 通过“能否独占取得该锁”判断是否还有界面进程存活。
|
||||
2. 启动时窗口先采纳现有 owner claim;只有在 claim 缺失、不可读,或本窗口主动发布平台登录态变化时,才写入新的 claim(新 epoch + 本窗口 generation)。
|
||||
3. 同一 claim 的重复 attach 不得清空 Runner 平台登录态;只有 epoch 变化或明确的登出参数才允许替换 / 清空登录态。
|
||||
4. Runner 必须把 manifest 失效与 runtime update relay 广播给全部已登记事件接收端(按 token 去重、失败即淘汰),不得因为第二个窗口 attach 而让第一个窗口失去事件。
|
||||
5. Runner 生命周期跟随“是否仍有界面进程存活”,不跟随某一个窗口;全部窗口退出后必须在有界时间内关停并清理 endpoint。
|
||||
6. 平台登录态仍保持单调 generation 与 claim 一致性校验:claim 不匹配时继续失败关闭并隔离登录态,不做隐式兼容。
|
||||
|
||||
## 验收标准
|
||||
|
||||
- 定向 Rust 测试覆盖:第二个参与者可同时持有参与锁;参与者全部退出后存活判定为假;同 claim 重复 attach 不改写登录态;epoch 变化才强制替换;两个事件接收端都能收到同一事件;claim 采纳与发布路径的失败关闭。
|
||||
- 真实二进制 smoke:同一 AppData 启动两个 GUI,两个进程都完成 `startup.setup.complete`,Runner 只存在一个实例,关闭其中一个后另一个仍可继续使用 Runner。
|
||||
- 边界验证:项目级写锁仍然拒绝两个窗口同时写同一项目;密钥、token、绝对路径不出现在新增日志与错误文案中。
|
||||
|
||||
## 依赖
|
||||
|
||||
- `apps/ai-game-creator-shell/src-tauri/src/runner/`(endpoint / state / dispatch / server / client)
|
||||
- `apps/ai-game-creator-shell/src-tauri/src/agent/runtime_driver/`(事件接收端注册表)
|
||||
- `apps/ai-game-creator-shell/src-tauri/src/main.rs`(启动阶段)
|
||||
Reference in New Issue
Block a user