feat(ECR-029): ContentSafety BlockPolicy 只读并 Closed

BlockPolicy catalog (000030) · Loop continuous.
This commit is contained in:
jackyu66git
2026-08-08 03:14:45 +08:00
parent e6740a0326
commit 5846d39d97
25 changed files with 457 additions and 1 deletions
@@ -0,0 +1,23 @@
# Backend Design: ECR-029 BlockPolicy
| ID | BD-2026-029 |
| Status | Approved |
| Coding | Loop authorized |
| Level | L2 |
| Migration | YES 000030 |
## Backend Change Boundary
```text
Domain: BlockPolicy (read)
App: AdminHandler → admin.Service → AdminRepo
API: GET /admin/content-safety/block-policies; GET /admin/content-safety/block-policies/{id}
Permission: admin.content_safety.read
Migration: 000030
```
## Out of boundary
策略写发布 · 用户侧硬拦截上线 · UGC · 真支付
Rollback: down migration + remove routes/UI
+1
View File
@@ -2,6 +2,7 @@
## 2026-08-08
- **ECR-029 Closed**ContentSafety BlockPolicymigration 000030 · admin client · /content-safety/block-policies · 只读)
- **ECR-028 Closed**AICoreConfig ToolDefinitionmigration 000029 · admin client · /ai/tools · 只读)
- **ECR-027 Closed**AICoreConfig KnowledgeChunkmigration 000028 · admin client · /ai/knowledge-chunks · 只读)
- **ECR-026 Closed**OpsCMS ScheduledPublicationmigration 000027 · admin-h5 client + /cms · 只读)
+8
View File
@@ -0,0 +1,8 @@
# CODE_REVIEW — ECR-029
**Verdict:** Approve → Closed
Date: 2026-08-08 · Loop continuous
- BlockPolicy 只读;无 UGC/真支付
- Integration AC mapped · OpenAPI updated
+22
View File
@@ -0,0 +1,22 @@
ecr: ECR-029
capability: ContentSafety
bounded_context: Content_Safety
parent: WAVE0-FROZEN
predecessor: ECR-028
change:
type: additive
breaking_change: false
migration_required: true
compatibility_notes: >
Adds BlockPolicy read catalog. Forbidden: UGC / real payment.
apis:
- method: GET
path: /api/v1/admin/content-safety/block-policies
change: added
- method: GET
path: /api/v1/admin/content-safety/block-policies/{id}
change: added
perms:
- code: admin.content_safety.read
change: unchanged
+15
View File
@@ -0,0 +1,15 @@
# ECR-029
**Title:** ContentSafety · BlockPolicy(只读薄切片)
**Status:** **Closed**
**Closed:** 2026-08-08Loop continuous
**Parent:** WAVE0-FROZEN · **Predecessor:** ECR-028 Closed
**Change Level:** L2
## Change
BlockPolicy 只读 · migration 000030 · admin client · /content-safety/block-policies
## Linked
Spec `ops-block-policy.md` · BD-2026-029 · CONTRACT_DIFF/ECR-029.yaml · TEST_REPORT/ECR-029.md
@@ -0,0 +1,6 @@
# ENGINEERING_SPEC — ECR-029
1. migration 000030
2. AdminRepo/Service/Handler
3. OpenAPI + admin-h5
4. Integration · Closed
@@ -0,0 +1,3 @@
# HANDOFF — ECR-029 Architect → Engineer
Loop continuous · Approved + Coding. Migration 000030. Forbidden: UGC/真支付.
@@ -0,0 +1,3 @@
# HANDOFF — ECR-029 Engineer → Reviewer
TestContentSafetyBlockPolicies PASS · Ready for Closed.
@@ -0,0 +1,3 @@
# PRODUCT_SPEC — ECR-029
对齐 ops-block-policy.md · Approved · Loop · L2 · BlockPolicy 只读
+6
View File
@@ -0,0 +1,6 @@
# STATE — ECR-029
| Status | **Closed** |
| Phase | closed |
| Spec | ops-block-policy.md |
| Updated | 2026-08-08 |
+12
View File
@@ -0,0 +1,12 @@
id: TASK-029-ECR029
ecr: ECR-029
title: ContentSafety · BlockPolicy(只读薄切片)
role: engineer
status: closed
change_level: L2
parent: WAVE0-FROZEN
predecessor: ECR-028
acceptance:
- Spec AC mapped
- BlockPolicy read only
- No UGC / payment
+33
View File
@@ -0,0 +1,33 @@
# TEST_REPORT — ECR-029 BlockPolicy
Date: 2026-08-08 · Loop continuous · commit: `PENDING`
## Commands
```bash
cd apps/api && go test ./internal/integration/ -run TestContentSafetyBlockPolicies -count=1
npm run build:admin
python3 scripts/ess-validate.py --phase review --ecr ECR-029
python3 scripts/ess-gate-check.py --ecr ECR-029
```
## Results
| Check | Result |
|-------|--------|
| TestContentSafetyBlockPolicies | PASS |
| build:admin | PASS |
| ess-validate review | PASS |
| ess-gate-check | PASS |
## AC
| ID | Evidence |
|----|----------|
| AC-F-01 | list seed/empty ok |
| AC-F-02 | get 200 |
| AC-F-03 | 未知 id → 404 |
| AC-S-01 | 401 |
| AC-S-02 | 403 |
| AC-P-01 | list < 500ms |
| AC-O-01 | N/A 只读 |
+1
View File
@@ -33,3 +33,4 @@
| ECR-026 | OpsCMS · ScheduledPublication | **Closed** | Spec ops-scheduled-publication.md · BD-2026-026 · migration 000027 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| ECR-027 | AICoreConfig · KnowledgeChunk | **Closed** | Spec ops-knowledge-chunk.md · BD-2026-027 · migration 000028 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| ECR-028 | AICoreConfig · ToolDefinition | **Closed** | Spec ops-tool-definition.md · BD-2026-028 · migration 000029 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| ECR-029 | ContentSafety · BlockPolicy | **Closed** | Spec ops-block-policy.md · BD-2026-029 · migration 000030 · TEST_REPORT · CODE_REVIEW · Loop continuous |
+1 -1
View File
@@ -55,4 +55,4 @@ Human 明文:**直接用 Loop,不用人工确认。**
| Done | Next |
|------|------|
| ECR-013A…028 Closed | **ECR-029** BlockPolicy |
| ECR-013A…029 Closed | **ECR-030** ModerationCase |