Files
meida_backend/packages/rules
xsl 7c67506474 feat(domains): identity, billing, task services and domain placeholders
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.
2026-08-14 00:26:39 +08:00
..

packages/rules/ — 规则引擎(占位)

架构 §8.1 / ADR-05:自研数据驱动决策表(TD-10)。

待实现

  • 从 kb_rule 读已发布规则,求值并输出命中链
  • 硬约束(is_hard)校验:可拦截违规输出
  • p95 < 50ms(FR-KB-05)

设计约束

  • 规则是数据不是代码。求值器是代码,规则本身在 kb_rule 表里, 顾问在后台维护,改规则不发版(NFR-MAINT-05)。
  • 每次求值必须输出命中了哪几条规则,这是报告与 Agent 可解释性的来源, 也是 pf_diagnosis.rule_hits 与 ag_message.rule_hits 的数据来源。
  • 已发布规则集缓存在进程内 + Redis,TTL 5 分钟,发布时广播失效(架构 §10)。