5.3 KiB
5.3 KiB
WP-DEL 旧层删除与命名收口
日期:2026-05-01
目标
本轮 WP-DEL 只处理已被新主链完全替代的旧 HTTP contract、旧 route、旧前端 alias 和旧测试夹具,不新增业务能力,不恢复 server-node 兼容,不修改 SpacetimeDB 表结构。
已删除范围
- Runtime Story 旧 HTTP DTO:
- Rust
RuntimeStoryStateResolveRequest - Rust/TS
RuntimeStoryBootstrapRequest/Response - Rust/TS
RuntimeStoryActionResponse - TS 泛型
RuntimeActionRequest/Response - 旧
RuntimeStorySnapshotPayload只作为旧 HTTP 总入口快照结构删除;当前 story session scoped 写侧使用StoryRuntimeMutationResponse.projection。
- Rust
- Runtime Story 前端旧命名:
beginRpgRuntimeStorySessionresolveRpgRuntimeStoryActiongetRpgStoryRuntimeProjectiongetRpgRuntimeActionSnapshotrpgRuntimeStoryClient聚合对象- 其他
Rpg*RuntimeStory*alias 统一删除,前端只导出当前主链命名。
- Custom World 旧非 runtime 前缀路由:
POST /api/custom-world/entityPOST /api/custom-world/scene-npcPOST /api/custom-world/scene-imagePOST /api/custom-world/cover-imagePOST /api/custom-world/cover-upload- 当前主链固定为
/api/runtime/custom-world/*。
- Puzzle 旧本地下一关入口:
POST /api/runtime/puzzle/runs/local-next-level- Rust/TS
AdvanceLocalPuzzleNextLevelRequest - API 层本地 next-level 拼装 helper 与对应旧测试。
/generated-*资产直读代理:GET /generated-character-drafts/{*path}GET /generated-characters/{*path}GET /generated-animations/{*path}GET /generated-big-fish-assets/{*path}GET /generated-puzzle-assets/{*path}GET /generated-custom-world-scenes/{*path}GET /generated-custom-world-covers/{*path}GET /generated-qwen-sprites/{*path}- 旧
api-server同源代理模块legacy_generated_assets.rs - Vite 与发布静态服务器中的
/generated-*直读转发配置。
保留边界
/generated-*字符串仍可作为历史 DTO 与测试夹具里的legacyPublicPath标识,OSS object key 前缀和LegacyAssetPrefix继续保留;但浏览器、Vite、本地发布静态服务器和api-server不再提供/generated-*裸读入口。- 正式读取契约固定为
asset_object、GET /api/assets/read-url、ResolvedAssetImage/useResolvedAssetReadUrl或业务投影里的签名读 URL 字段。 RuntimeStoryActionRequest仍保留为module-runtime-story内部动作规则输入,不作为旧 HTTP route contract。RuntimeStoryViewModel、RuntimeStoryPresentation、RuntimeStoryPatch和 battle presentation 仍作为当前投影/表现构件保留,不再代表旧/api/runtime/story/*总入口响应。- 历史设计文档中对旧 route/DTO 的引用只作为时间点记录保留,不批量改写旧档案。
验收门禁
计划执行:
cargo fmt --all --manifest-path server-rs\Cargo.toml
cargo fmt --all --check --manifest-path server-rs\Cargo.toml
npm.cmd run check:server-rs-ddd
cargo check --workspace --manifest-path server-rs\Cargo.toml
cargo test --workspace --exclude spacetime-module --manifest-path server-rs\Cargo.toml
npm.cmd run test -- src/services/rpg-runtime/rpgRuntimeStoryClient.test.ts src/hooks/rpg-runtime-story/runtimeStoryCoordinator.test.ts src/services/ai.test.ts src/services/puzzle-runtime
npm.cmd run check:encoding -- docs/technical/SERVER_RS_DDD_WP_DEL_CLEANUP_2026-05-01.md docs/technical/README.md docs/technical/SERVER_RS_DDD_G1_CONTRACT_AND_ROUTE_MATRIX_2026-04-29.md docs/technical/SERVER_RS_DDD_PARALLEL_TASKLIST_2026-04-29.md server-rs/crates/shared-contracts/README.md server-rs/crates/api-server/README.md server-rs/crates/module-puzzle/README.md
实际结果:
cargo fmt --all --manifest-path server-rs\Cargo.toml:通过。cargo fmt --all --check --manifest-path server-rs\Cargo.toml:通过。npm.cmd run check:server-rs-ddd:通过,15 个 module crate 边界检查通过。cargo check --workspace --manifest-path server-rs\Cargo.toml:通过;仅保留既有 runtime chat prompt dead code warning。cargo test --workspace --exclude spacetime-module --manifest-path server-rs\Cargo.toml:通过;api-server207 个测试通过、4 个 live/外部依赖测试按既有条件忽略。npm.cmd run test -- src/services/rpg-runtime/rpgRuntimeStoryClient.test.ts src/hooks/rpg-runtime-story/runtimeStoryCoordinator.test.ts src/services/ai.test.ts src/services/puzzle-runtime:通过,4 个测试文件 45 个用例通过。npm.cmd run check:encoding:通过,全量 2816 个文件通过 UTF-8/乱码检查。npm.cmd run spacetime:generate -- --rust-only:通过;SpacetimeDB CLI 在 Windows 长路径格式化阶段触发已知失败后,项目脚本使用短路径分批rustfmtfallback 完成。cargo check -p spacetime-module --manifest-path server-rs\Cargo.toml:通过。npm.cmd run api-server:maincloud:通过;后端拉起后GET http://127.0.0.1:3100/healthz返回200 {"ok":true,"service":"genarrative-api-server"},随后已清理本次 smoke 进程并确认 3100 端口释放。启动期 Maincloud 订阅恢复出现两条503 Service Unavailable警告,不影响 healthz smoke。