feat: complete M3 runtime snapshot and profile save archive

This commit is contained in:
2026-04-22 13:22:23 +08:00
parent 997a8daada
commit 209e924403
340 changed files with 9878 additions and 4429 deletions

View File

@@ -2,27 +2,27 @@
## 1. SpacetimeDB 运行时主表
- [ ] 设计 `runtime_snapshot`
- [x] 设计 `runtime_snapshot`
- [x] 设计 `runtime_setting`
- [x] 设计 `profile_dashboard_state`
- [x] 设计 `profile_wallet_ledger`
- [x] 设计 `profile_played_world`
- [ ] 设计 `profile_save_archive`
- [x] 设计 `profile_save_archive`
- [x] 设计 `user_browse_history`
## 2. 兼容快照策略
- [ ] 设计“领域表真相 + 兼容聚合快照”策略
- [ ] 设计 snapshot projection 刷新机制
- [ ] 迁移当前 snapshot hydration / normalize 规则
- [ ] 迁移当前 save archive 聚合逻辑
- [x] 设计“领域表真相 + 兼容聚合快照”策略
- [x] 设计 snapshot projection 刷新机制
- [x] 迁移当前 snapshot hydration / normalize 规则
- [x] 迁移当前 save archive 聚合逻辑
- [x] 迁移当前 browse history 去重与排序逻辑
## 3. Axum facade
- [ ] 兼容 `GET /api/runtime/save/snapshot`
- [ ] 兼容 `PUT /api/runtime/save/snapshot`
- [ ] 兼容 `DELETE /api/runtime/save/snapshot`
- [x] 兼容 `GET /api/runtime/save/snapshot`
- [x] 兼容 `PUT /api/runtime/save/snapshot`
- [x] 兼容 `DELETE /api/runtime/save/snapshot`
- [x] 兼容 `GET /api/runtime/settings`
- [x] 兼容 `PUT /api/runtime/settings`
- [x] 兼容 `GET /api/runtime/profile/dashboard`
@@ -31,10 +31,10 @@
- [x] 兼容 `GET /api/profile/wallet-ledger`
- [x] 兼容 `GET /api/runtime/profile/play-stats`
- [x] 兼容 `GET /api/profile/play-stats`
- [ ] 兼容 `GET /api/runtime/profile/save-archives`
- [ ] 兼容 `GET /api/profile/save-archives`
- [ ] 兼容 `POST /api/runtime/profile/save-archives/:worldKey`
- [ ] 兼容 `POST /api/profile/save-archives/:worldKey`
- [x] 兼容 `GET /api/runtime/profile/save-archives`
- [x] 兼容 `GET /api/profile/save-archives`
- [x] 兼容 `POST /api/runtime/profile/save-archives/:worldKey`
- [x] 兼容 `POST /api/profile/save-archives/:worldKey`
- [x] 兼容 `GET /api/runtime/profile/browse-history`
- [x] 兼容 `POST /api/runtime/profile/browse-history`
- [x] 兼容 `DELETE /api/runtime/profile/browse-history`
@@ -45,8 +45,8 @@
## 4. 阶段验收
- [ ] 登录用户可正常保存、读取、删除存档
- [ ] 兼容路径与主路径返回一致
- [ ] profile dashboard / browse history / save archive 行为一致
- [x] 兼容路径与主路径返回一致
- [x] profile dashboard / browse history / save archive 行为一致
- [ ] 前端当前恢复流程可在不改 UI 的前提下跑通
## 5. 本轮进展记录
@@ -63,3 +63,7 @@
- `2026-04-22`:已通过 `cargo check -p api-server --tests --message-format short``cargo test -p shared-contracts --lib``cargo test -p api-server runtime_profile::tests:: -- --nocapture` 验证本轮 profile projection 读链。
- 详细设计见:
- [../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md](../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md)
- `2026-04-22`:已完成 `runtime_snapshot``profile_save_archive` 与“领域表真相 + 兼容聚合快照”方案落地,接通 `/api/runtime/save/snapshot``/api/runtime/profile/save-archives``/api/profile/save-archives` 与恢复存档双路径 facade。
- `2026-04-22`:已通过 `cargo test -p shared-kernel --lib``cargo test -p module-runtime --lib``cargo check -p spacetime-module --message-format short``cargo build -p spacetime-module --target wasm32-unknown-unknown --release --message-format short``cargo check -p spacetime-client --message-format short``cargo check -p api-server --tests --message-format short``cargo test -p api-server runtime_save::tests:: -- --nocapture` 验证 snapshot/save archive 主链编译与 facade。
- 详细设计见:
- [../docs/technical/M3_RUNTIME_SNAPSHOT_SAVE_ARCHIVE_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md](../docs/technical/M3_RUNTIME_SNAPSHOT_SAVE_ARCHIVE_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md)