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.
62 lines
2.1 KiB
Markdown
62 lines
2.1 KiB
Markdown
# shared-kernel 共享 crate 阶段性说明
|
||
|
||
日期:`2026-04-22`
|
||
|
||
## 1. crate 职责
|
||
|
||
`shared-kernel` 是跨模块共享领域内核 crate,当前阶段已经开始承接最小共享基础能力,负责:
|
||
|
||
1. 共享 ID、值对象、枚举与基础领域类型
|
||
2. 共享时间、状态、版本、通用校验等基础规则
|
||
3. 供各模块 package 复用的最小领域内核
|
||
|
||
## 2. 当前阶段说明
|
||
|
||
当前阶段已落地的共享能力:
|
||
|
||
1. 必填/可选字符串归一化
|
||
2. 字符串列表归一化
|
||
3. 前缀 UUID / 前缀种子 ID 生成
|
||
4. RFC3339 格式化与解析
|
||
5. 微秒时间戳文本格式化
|
||
|
||
后续与本 crate 直接相关的任务包括:
|
||
|
||
1. 统一用户、会话、世界、角色、资产等核心 ID 类型
|
||
2. 统一时间戳、版本号、状态枚举等共享结构
|
||
3. 抽取真正跨模块复用的最小领域规则
|
||
4. 避免把模块私有规则错误上提到共享内核
|
||
|
||
当前已接入的 crate 已覆盖:
|
||
|
||
1. `module-assets`
|
||
2. `module-auth`
|
||
3. `platform-auth`
|
||
4. `module-runtime`
|
||
5. `module-story`
|
||
6. `spacetime-client`
|
||
7. `api-server`
|
||
8. `module-ai`
|
||
9. `module-inventory`
|
||
10. `module-runtime-item`
|
||
11. `module-npc`
|
||
12. `module-quest`
|
||
13. `module-combat`
|
||
14. `module-progression`
|
||
|
||
## 3. 边界约束
|
||
|
||
1. `shared-kernel` 只放跨模块最小共享内核,不承接具体业务模块的私有规则。
|
||
2. 任何进入本 crate 的类型都必须证明至少被多个模块稳定复用。
|
||
3. 不能把主模块实现重新堆进共享内核,避免形成新的“大公共垃圾桶”。
|
||
|
||
## 当前文档入口
|
||
|
||
当前长期工程口径已融合到:
|
||
|
||
1. [../../../docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md](../../../docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md)
|
||
2. [../../../docs/【玩法创作】平台入口与玩法链路-2026-05-15.md](../../../docs/【玩法创作】平台入口与玩法链路-2026-05-15.md)
|
||
3. [../../../docs/【开发运维】本地开发验证与生产运维-2026-05-15.md](../../../docs/【开发运维】本地开发验证与生产运维-2026-05-15.md)
|
||
|
||
旧阶段设计文档不再作为实现依据。
|