Billing implements reserve -> commit -> refund against bl_quota and bl_ledger with row-level locking and idempotency keys; the refund commits on its own transaction so a failed request cannot silently keep a user's quota. Task implements the unified task centre over the state machine. Identity issues and resolves users. Remaining domains are placeholders whose READMEs state what belongs there and what must not.
packages/kb/ — 美学知识库(占位)
职责(架构 §4.1):知识实体/关系/规则/素材的读写与发布。
不负责:检索算法(调 packages/retrieval)。
待实现
- 表:
kb_entitykb_relationkb_rulekb_chunk(vector 1024)kb_assetkb_colorkb_gap - FR-KB-01~12:本体 Schema、自建色板、内容录入、规则库、白底图流水线、 草稿→审核→发布→归档流程、知识缺口埋点
为什么它是数据不是代码
架构 §1.1:知识库是持续演进的资产,更新频率远高于代码。规则、色板、单品
必须是数据,配顾问能独立使用的运营入口(FR-ADM-02),改内容不发版。
任何时候想把规则写成 if 分支,都是错的。
知识库版本号
所有检索缓存键都带全局 kb_version,发布时 +1,旧缓存自然失效
(架构 §10)。不要试图精确追踪哪些缓存受影响。