Files
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

35 lines
1.7 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.
# `packages/compliance/` — 统一合规出口
> **所有对外生成物必须经过 `publish_asset()`,没有例外。**(架构 §7.5、ADR-11)
## 铁律
1. **不得反向依赖任何业务域**(架构 §4.2)。它必须能被任何模块安全调用。
import-linter 契约会在 CI 拦下违规 import。
2. **审核是唯一不允许降级的外部依赖**(架构 §11.4)。审核服务不可用时按
**拦截**处理(fail-close),宁可少发不可漏审。
## 现状:只有接口,没有实现
签名已经定死,业务代码可以照着写;实现落地时调用方不用改。
半实现比不实现更危险 —— 一个"半工作"的审核调用看起来和正常的一样。
## 待实现(T-P1-22 / T-P1-23,CR-05 / CR-06 不可裁剪)
1. 内容审核(腾讯云 IMS 图片 / TMS 文本 + 备案关键词库),fail-close
2. 生成 **27 位内容编号**并登记 `cp_content_registry`
3. 显式标识:图片加可见「AI 生成」水印;文本加提示语
4. 隐式标识:写入文件元数据(属性信息 + 服务提供者编码 + 内容编号)
5. 上传目标 COS 桶,返回签名地址
6. 表:`cp_content_registry` `cp_moderation_log` `cp_audit_log` `cp_data_request`
## 必须专门测试的点
图片经过 **CDN、缩略图处理、客户端保存与再次分享**后,元数据是否仍然存在。
很多图片处理链路会剥离 EXIF/XMP,一旦剥离就等于没做隐式标识(TD-21)。
这一条上架被拒的概率很高,且事后补救成本极大。
## 六类审核对象
用户上传图、生成图、用户文本、模型输出、知识内容、后台录入内容 —— 全覆盖。