27 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# pbl_runtime_ext 模块技能(自动生成骨架 + 人工补充)
## 定位
scense_runtime 薄扩展:单事务事件+状态写入与广播M11a/M11b
## 挂载
`from pbl_runtime_ext.init import load_pbl_runtime_ext``load_pbl_runtime_ext()`(应用 app/pbls.py init() 中按序调用)
## 数据表3 张)
- `pbl_runtime_event`运行时事件append-only按月 RANGE 分区)
- `pbl_entity_state`实体状态服务端权威state_version 客户端禁写)
- `pbl_world_state_snapshot`:世界状态快照(掉线补齐/离线兜底)
## 契约接口6 个,路径 `/pbl_runtime_ext/api/<name>.dspy`
- `pbl_runtime_event_append`
- `pbl_runtime_event_poll`
- `pbl_entity_state_get`
- `pbl_entity_state_apply`
- `pbl_world_broadcast`
- `pbl_session_member_add`
## 陷阱
- 库名一律 `ServerEnv().get_module_dbname('pbl_runtime_ext')`,禁止硬编码 DBNAME。
- sqlor 只有 `C/U/D/R/I/sqlExe`;查询走 pbl_common.api 的 q_all/q_one已适配
- 所有读写强制带 `tenant_id`pbl_common.api.tenant_id()),缺失即 fail-closed 报错。
- 新增契约需同步三处api.py 定义 + __init__.py 导出 + init.py env 注册 + scripts/load_path.py 路径。