Files
Genarrative/server-rs/crates/module-runtime-story/README.md
高物 3cb3efb4d0 Prune stale docs and update .hermes content
Delete a large set of outdated documentation (many files under docs/ and .hermes/plans/, including audits, design, prd, technical, planning, assets, and todos). Update and consolidate .hermes content: refresh shared-memory pages (decision-log, development-workflow, document-map, pitfalls, project-overview, team-conventions) and several skills/references under .hermes/skills. Also modify AGENTS.md, README.md, UI_CODING_STANDARD.md, docs/README.md and .encoding-check-ignore. Purpose: clean up stale planning/audit material and keep current hermes documentation and related top-level docs in sync.
2026-05-15 06:24:07 +08:00

1.4 KiB
Raw Blame History

module-runtime-story

module-runtime-story 承接 RPG runtime story 的纯领域规则、应用用例、事件和错误模型,不依赖 HTTP / AppState / SpacetimeDB。

当前已经迁入的历史快照态纯逻辑会继续收口为 session scoped 新主链;顶层 DDD 物理拆分已经完成:

  1. src/domain.rs 承载 action 结算结果结构、NPC 委托上下文、functionId / 队伍上限常量。
  2. src/commands.rs 承载 action 文本解析 helper。
  3. src/application.rs 承载 action response 组装参数、status patch 和 world type helper。
  4. src/events.rs 承载 runtime story 领域事件。
  5. src/errors.rs 承载 runtime story 纯规则错误。
  6. src/lib.rs 只保留模块声明、公开导出和子模块 re-export。

bootstrap.rs 需要组装较深的运行时初始 game_state JSON 模板crate 级 recursion_limit = "512" 仅用于支撑 serde_json::json! 宏展开,不承载额外领域规则。

当前 WP-RS 写链路已经通过 POST /api/story/sessions/runtimePOST /api/story/sessions/{storySessionId}/actions/resolve 收口到 session scoped 新接口。后续只按 battle / forge / NPC / quest / presentation 的顺序增强领域规则和投影,并在 WP-DEL 中删除运行代码不再需要的旧入口命名。

配套记录见 ../../../docs/【玩法创作】平台入口与玩法链路-2026-05-15.md