Files
Genarrative/server-rs
lhk229 571cb00fe4
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
新增 external v1 游戏场景生成路由并迁移 AGC 美术包背景阶段
- api-server 新增 POST /api/external/v1/editor/scenes/generations,复用 editor:image-generate scope、幂等键和站内场景生图队列
- editor_project.rs 抽取站内与外部共用的场景生图 payload 构造函数,站内 handler 改为调用共享函数
- 同步更新 external v1 OpenAPI 契约与 MCP 派生排除标记,登记 docs/README.md 索引
- AGC 客户端美术包背景阶段改走新场景路由,stylePreset 固定 custom + customStyle 保留现有风格文案
- external_generation_state 快照与 recovery_scan 账本白名单支持新场景路由
- direct_runtime 背景资源识别同时兼容新场景路由与旧通用路由,新增旧路由回放测试
- 更新 genarrative-external-editor-api skill 参考文档
- 新增主规范、里程碑规范与实施计划三份 SDD 文档
2026-09-24 15:40:30 +00:00
..
2026-07-17 16:56:46 +08:00
2026-09-23 00:09:12 +08:00
2026-07-17 16:56:46 +08:00

server-rs 工作区说明

更新时间:2026-05-15

server-rs/ 是当前唯一后端工作区,承载 Rust api-server、SpacetimeDB module、领域模块、平台副作用适配和共享契约。旧 server-node、Express、PostgreSQL、Go 服务端和 maincloud 口径均为历史残留,不再作为当前实现目标。

当前职责

  • crates/api-server:Axum HTTP / SSE / BFF 门面、鉴权、中间件、外部服务编排和 DTO 映射。
  • crates/spacetime-module:SpacetimeDB 表、reducer、procedure、事务 adapter、row mapper 和迁移。
  • crates/spacetime-client:后端访问 SpacetimeDB 的 typed facade。
  • crates/module-*:领域模型、命令、应用规则、领域事件和领域错误。
  • crates/platform-*:OSS、LLM、语音、认证等外部平台能力。
  • crates/shared-contracts:前后端共享 DTO 与公开契约。
  • crates/shared-kernel、crates/shared-logging、crates/tests-support:跨模块基础能力、日志和测试支撑。

开发规则

  1. server-rs/Cargo.toml 是 workspace 成员和依赖版本事实源;第三方依赖和 workspace 内 crate path 优先放在 [workspace.dependencies]。
  2. module-* 不直接依赖 Axum、SpacetimeDB table/reducer/procedure、reqwest、OSS、LLM、spacetime-client、tokio 或文件系统。
  3. api-server 不承接领域真相;发现领域规则时优先沉到对应 module-*。
  4. SpacetimeDB schema 变化必须同步 spacetime-module/src/migration.rs、生成绑定和当前后端架构文档的表目录。
  5. 人工命令、本地联调和文档示例不要使用 spacetime --root-dir。

常用命令

cargo check -p api-server --manifest-path server-rs/Cargo.toml
cargo test -p api-server --manifest-path server-rs/Cargo.toml
npm run check:server-rs-ddd
npm run check:spacetime-schema
npm run spacetime:generate
npm run dev:api-server

涉及 API smoke 时用 npm run dev:api-server 启动后端并检查 /healthz,不要使用旧 api-server:maincloud。

当前文档