Files
JenkenB 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

46 lines
1.8 KiB
Markdown

# module-inventory 独立模块 package 说明
日期:`2026-04-21`
## 1. package 职责
`module-inventory` 是背包与物品变更模块 package,当前负责:
1. 冻结 `inventory_slot` 的首版领域字段与枚举类型。
2. 提供 `apply_inventory_mutation` 纯规则入口,先覆盖:
- `GrantItem`
- `ConsumeItem`
- `EquipItem`
- `UnequipItem`
3. 冻结 `RuntimeInventoryStateQueryInput / RuntimeInventoryStateSnapshot / RuntimeInventoryStateRecord`
4.`spacetime-module` 的背包表、procedure 与 reducer 聚合提供可复用契约。
## 2. 当前阶段说明
当前提交已经从“目录占位”推进到“真实 crate 基座”,但仍然只落最小背包主链,不提前扩成完整玩法迁移。
本轮已落地:
1. `InventorySlotSnapshot` / `InventoryMutationInput` / `InventoryMutationOutcome`
2. 背包堆叠、扣减、装备切换、卸下回包的纯规则
3. `runtime_session_id + actor_user_id` 作用域下的最小 inventory state query contract
4.`spacetime-module` 对接所需的 `SpacetimeType` 兼容类型
本轮明确未做:
1. `UseItem / Craft / Dismantle / Reforge`
2. `npc_trade / npc_gift / quest_turn_in` 的专属 reducer
3. 前端背包 view 或 Axum façade
4.`GameState.playerInventory / playerEquipment` 全量兼容
## 3. 当前冻结边界
1. `module-inventory` 只负责物品状态真相与背包规则,不把外部 AI、OSS 或 HTTP 协议塞进模块内部。
2.`module-story``module-runtime-item``module-npc` 的协作通过明确 reducer 或投影边界完成。
3. 背包真相由 `spacetime-module` 聚合,对外兼容输出后续由 `api-server` 或 view 补齐。
## 4. 关联文档
1. `docs/【玩法创作】平台入口与玩法链路-2026-05-15.md`
2. `backend-rewrite-tasklist/03_M4_STORY_AND_GAMEPLAY.md`