3.9 KiB
3.9 KiB
WP-ST SpacetimeDB Adapter 收尾记录(2026-05-01)
1. 收尾目标
本次关闭 SERVER_RS_DDD_PARALLEL_TASKLIST_2026-04-29.md 中 WP-ST SpacetimeDB Adapter 当前稳定范围:已经落地的表、reducer、procedure、event table 和上下文 adapter 必须完成 migration.rs、表目录、Rust bindings 与自动门禁闭环。
收尾后,WP-ST 不再以“多个上下文和绑定生成仍待推进”的口径挂起;后续只有新增 table / reducer / procedure 或 row shape 时,才按增量切片重新认领。
2. 已完成内容
asset_event已作为public event表进入资产主链,覆盖资产对象确认和实体槽位绑定变更事件。asset_event已对齐migration.rs、SPACETIMEDB_TABLE_CATALOG.md和 Rustmodule_bindings。SPACETIMEDB_TABLE_CATALOG.md补齐database_migration_operator、邀请/推荐/会员/充值等 profile 表,以及asset_event的结构、索引和查询模板。scripts/check-server-rs-ddd-boundaries.mjs新增 SpacetimeDB 表漂移检查,自动核对 table accessor、migration.rs白名单和表目录项,阻止新增表漏迁移或漏文档。scripts/generate-spacetime-bindings.mjs在 Windows 下继续先输出短临时目录;当 SpacetimeDB CLI 已生成文件但自身 formatter 失败时,由脚本分批rustfmt后再同步生成目录。spacetime-client/src/module_bindings已通过npm.cmd run spacetime:generate -- --rust-only重新生成,包含asset_event_table.rs、asset_event_type.rs和asset_event_kind_type.rs。spacetime-client/README.md已同步生成物维护口径:禁止手写 generated code,格式化 fallback 只能由仓库生成脚本托管。
3. 边界说明
- 本次收尾不把未稳定的新 story action 写接口、前端迁移或旧 compat 删除并入
WP-ST。 database_migration_operator是迁移权限表,本身不导出到业务迁移包;其他业务表必须纳入migration.rs。spacetime-client/src/module_bindings/**仍是生成物,不承载手写 facade 或领域规则。- 后续若新增 SpacetimeDB 表,必须同时更新表目录、
migration.rs、绑定生成结果,并让 DDD 边界检查通过。
4. 验收命令
本轮收尾至少执行:
npm.cmd run spacetime:generate -- --rust-only
cargo fmt --all --check --manifest-path server-rs\Cargo.toml
cargo check -p spacetime-module --manifest-path server-rs\Cargo.toml
cargo check -p spacetime-client --manifest-path server-rs\Cargo.toml
npm.cmd run check:server-rs-ddd
npm.cmd run check:encoding
npm.cmd run api-server:maincloud
执行结果以本次任务清单记录为准。
5. 本次执行结果
已执行并通过:
npm.cmd run spacetime:generate -- --rust-only
cargo fmt --all --check --manifest-path server-rs\Cargo.toml
cargo check -p spacetime-module --manifest-path server-rs\Cargo.toml
cargo check -p spacetime-client --manifest-path server-rs\Cargo.toml
cargo test -p module-assets --manifest-path server-rs\Cargo.toml
cargo test -p spacetime-client --manifest-path server-rs\Cargo.toml
cargo check -p api-server --manifest-path server-rs\Cargo.toml
npm.cmd run check:server-rs-ddd
npm.cmd run check:encoding
npm.cmd run api-server:maincloud
结果:
- Rust bindings 已生成并同步,
asset_event三个生成文件已落盘。 spacetime-module与spacetime-client编译通过,module-assets8 个测试通过,spacetime-client10 个测试通过。- DDD 边界检查通过 15 个 module crate,编码检查通过 2815 个文件。
api-server:maincloud启动后/healthz返回200 {"ok":true,"service":"genarrative-api-server"},本次启动进程已清理并释放3100端口。
已知 warning:module-runtime-story 与 api-server 仍有非本次 WP-ST 引入的未使用 helper / prompt warning,后续按对应工作包收口,不阻塞本次 WP-ST 关闭。