feat(ECR-021): AICoreConfig SystemPrompt 只读并 Closed

新增 system_prompts 目录、admin.ai_config.read 与 admin-h5「AI」页;本切片不改运行时 Prompt、禁写发布/UGC/真支付。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-08 00:27:17 +08:00
co-authored by Cursor
parent 22f9e358ae
commit 140b08ca01
33 changed files with 649 additions and 5 deletions
@@ -0,0 +1,41 @@
# Feature Spec: AICoreConfig · SystemPromptOps · ECR-021
> Status: `Active`Loop continuous · **ECR-021 Closed**
> Parent: WAVE0-FROZEN · Predecessor: ECR-020 Closed
> Capability: `AICoreConfig` · BC: `Ask_Ops`
> 授权:`docs/WAVE0/LOOP_AUTHORIZATION.md`
## Non-goals
Prompt 在线编辑/发布 · KnowledgeSource/Chunk · ToolDefinition · 切换运行时引擎 · UGC · 真支付
## L2 Domain
| 概念 | 语义 |
|------|------|
| `SystemPrompt` | code 唯一;body 为模板文本;active/system;本切片只读 |
## L3 API
| Method | Path | 权限 | 语义 |
|--------|------|------|------|
| GET | `/admin/ai/system-prompts` | `admin.ai_config.read` | 列表 |
| GET | `/admin/ai/system-prompts/:id` | 同上 | 详情(含 body |
## Migration
`000022``system_prompts` + 种子 `ask_default` + 授予权限
## L4 AC
| ID | Then |
|----|------|
| AC-F-01 | list 含 ask_default |
| AC-F-02 | get 返回 body 非空 |
| AC-F-03 | 未知 id → 404 |
| AC-S-01 | 无 Admin → 401 |
| AC-S-02 | 无 ai_config.read → 403 |
| AC-P-01 | list &lt; 500ms |
| AC-O-01 | N/A 只读 |
contract_diff: `docs/CONTRACT_DIFF/ECR-021.yaml`