feat(ECR-027): AICoreConfig KnowledgeChunk 只读并 Closed

KnowledgeChunk catalog (000028) · Loop continuous.
This commit is contained in:
jackyu66git
2026-08-08 03:14:17 +08:00
parent 78857d5510
commit c1a8a58488
26 changed files with 565 additions and 1 deletions
@@ -0,0 +1,23 @@
# Backend Design: ECR-027 KnowledgeChunk
| ID | BD-2026-027 |
| Status | Approved |
| Coding | Loop authorized |
| Level | L2 |
| Migration | YES 000028 |
## Backend Change Boundary
```text
Domain: KnowledgeChunk (read)
App: AdminHandler → admin.Service → AdminRepo
API: GET /admin/ai/knowledge-chunks; GET /admin/ai/knowledge-chunks/{id}
Permission: admin.ai_config.read
Migration: 000028
```
## Out of boundary
Embedding · 上传切块 · 运行时 RAG 接线 · UGC · 真支付
Rollback: down migration + remove routes/UI
+1
View File
@@ -2,6 +2,7 @@
## 2026-08-08
- **ECR-027 Closed**AICoreConfig KnowledgeChunkmigration 000028 · admin client · /ai/knowledge-chunks · 只读)
- **ECR-026 Closed**OpsCMS ScheduledPublicationmigration 000027 · admin-h5 client + /cms · 只读)
- **ECR-025 Closed**OpsCMS FeedSlotmigration 000026 · admin-h5 /cms · 只读)
- **ECR-024 Closed**OpsCMS Banner`ops_banners` · admin-h5 `/cms` · migration 000025 · 只读)
+8
View File
@@ -0,0 +1,8 @@
# CODE_REVIEW — ECR-027
**Verdict:** Approve → Closed
Date: 2026-08-08 · Loop continuous
- KnowledgeChunk 只读;无 UGC/真支付
- Integration AC mapped · OpenAPI updated
+22
View File
@@ -0,0 +1,22 @@
ecr: ECR-027
capability: AICoreConfig
bounded_context: Ask_Ops
parent: WAVE0-FROZEN
predecessor: ECR-026
change:
type: additive
breaking_change: false
migration_required: true
compatibility_notes: >
Adds KnowledgeChunk read catalog. Forbidden: UGC / real payment.
apis:
- method: GET
path: /api/v1/admin/ai/knowledge-chunks
change: added
- method: GET
path: /api/v1/admin/ai/knowledge-chunks/{id}
change: added
perms:
- code: admin.ai_config.read
change: unchanged
+15
View File
@@ -0,0 +1,15 @@
# ECR-027
**Title:** AICoreConfig · KnowledgeChunk(只读薄切片)
**Status:** **Closed**
**Closed:** 2026-08-08Loop continuous
**Parent:** WAVE0-FROZEN · **Predecessor:** ECR-026 Closed
**Change Level:** L2
## Change
KnowledgeChunk 只读 · migration 000028 · admin client · /ai/knowledge-chunks
## Linked
Spec `ops-knowledge-chunk.md` · BD-2026-027 · CONTRACT_DIFF/ECR-027.yaml · TEST_REPORT/ECR-027.md
@@ -0,0 +1,6 @@
# ENGINEERING_SPEC — ECR-027
1. migration 000028
2. AdminRepo/Service/Handler
3. OpenAPI + admin-h5
4. Integration · Closed
@@ -0,0 +1,3 @@
# HANDOFF — ECR-027 Architect → Engineer
Loop continuous · Approved + Coding. Migration 000028. Forbidden: UGC/真支付.
@@ -0,0 +1,3 @@
# HANDOFF — ECR-027 Engineer → Reviewer
TestAICoreKnowledgeChunks PASS · Ready for Closed.
@@ -0,0 +1,3 @@
# PRODUCT_SPEC — ECR-027
对齐 ops-knowledge-chunk.md · Approved · Loop · L2 · KnowledgeChunk 只读
+6
View File
@@ -0,0 +1,6 @@
# STATE — ECR-027
| Status | **Closed** |
| Phase | closed |
| Spec | ops-knowledge-chunk.md |
| Updated | 2026-08-08 |
+12
View File
@@ -0,0 +1,12 @@
id: TASK-027-ECR027
ecr: ECR-027
title: AICoreConfig · KnowledgeChunk(只读薄切片)
role: engineer
status: closed
change_level: L2
parent: WAVE0-FROZEN
predecessor: ECR-026
acceptance:
- Spec AC mapped
- KnowledgeChunk read only
- No UGC / payment
+33
View File
@@ -0,0 +1,33 @@
# TEST_REPORT — ECR-027 KnowledgeChunk
Date: 2026-08-08 · Loop continuous · commit: `PENDING`
## Commands
```bash
cd apps/api && go test ./internal/integration/ -run TestAICoreKnowledgeChunks -count=1
npm run build:admin
python3 scripts/ess-validate.py --phase review --ecr ECR-027
python3 scripts/ess-gate-check.py --ecr ECR-027
```
## Results
| Check | Result |
|-------|--------|
| TestAICoreKnowledgeChunks | 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
@@ -31,3 +31,4 @@
| ECR-024 | OpsCMS · Banner | **Closed** | Spec ops-banner · BD-2026-024 · migration 000025 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| ECR-025 | OpsCMS · FeedSlot | **Closed** | Spec ops-feed-slot.md · BD-2026-025 · migration 000026 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| 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 |
+1 -1
View File
@@ -55,4 +55,4 @@ Human 明文:**直接用 Loop,不用人工确认。**
| Done | Next |
|------|------|
| ECR-013A…026 Closed | **ECR-027** KnowledgeChunk |
| ECR-013A…027 Closed | **ECR-028** KnowledgeChunk→ToolDefinition |