Files
digital-psychology/.ai/product/feature-spec/ops-content-safety.md
T
jackyu66gitandCursor cae3380cbf feat(ECR-019): ContentSafety FilterRule 只读并 Closed
新增 filter_rules、admin.content_safety.read、列表/详情/试匹配 API 与 admin-h5「安全」页;禁审核写/UGC/真支付。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 22:13:22 +08:00

43 lines
1.4 KiB
Markdown
Raw 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.
# Feature Spec: ContentSafety · FilterRuleOps · ECR-019
> Status: `Active`Loop continuous · **ECR-019 Closed**
> Parent: WAVE0-FROZEN · Predecessor: ECR-018 Closed
> Capability: `ContentSafety` · BC: `Content_Safety`
> 授权:`docs/WAVE0/LOOP_AUTHORIZATION.md`
## Non-goals
ModerationCase 写回 · CrisisPolicy 配置 · 真 NLP/厂商审核 · UGC · 真支付 · 用户侧硬拦截上线(本切片仅运营只读 + 试匹配)
## L2 Domain
| 概念 | 语义 |
|------|------|
| `FilterRule` | code 唯一;category ∈ {crisis,abuse,spam,pii}action ∈ {flag,block,escalate}system 种子不可本切片删除 |
## L3 API
| Method | Path | 权限 | 语义 |
|--------|------|------|------|
| GET | `/admin/content-safety/filter-rules` | `admin.content_safety.read` | 列表 |
| GET | `/admin/content-safety/filter-rules/:id` | 同上 | 详情 |
| POST | `/admin/content-safety/evaluate` | 同上 | 试匹配(不写工单) |
## Migration
`000020``filter_rules` + 种子规则 + 授予 `admin.content_safety.read`
## L4 AC
| ID | Then |
|----|------|
| AC-F-01 | list 含 system 种子 ≥1 |
| AC-F-02 | evaluate 命中种子 pattern → matches 非空 |
| AC-F-03 | get 未知 id → 404 |
| AC-S-01 | 无 Admin → 401 |
| AC-S-02 | 无 content_safety.read → 403 |
| AC-P-01 | list &lt; 500ms |
| AC-O-01 | evaluate 不写 Audit(只读试匹配) |
contract_diff: `docs/CONTRACT_DIFF/ECR-019.yaml`