Files
digital-psychology/.ai/product/feature-spec/ops-star-config-write.md
T
jackyu66gitandCursor f492088237 docs(ECR-043): StarConfig 写面 Spec Ready(先不写码)
Human 批准 ExploreConfig Loop 仅限 043;Closed 后 STOP 禁自动 044;边界排除 Rhythm/Card/Scale/Prompt。

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

100 lines
3.5 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: ExploreConfig · StarConfig 写面(Ops · ECR-043
> Status: `Active`**Spec Ready · Coding NOT STARTED**
> Map: `§7` · Capability: `ExploreConfig` · BC: `Explore_Reports`
> Auth: `docs/WAVE0/EXPLORE_CONFIG_WRITE_AUTHORIZATION.md`Human 批准 · **仅 ECR-043**
> Predecessor: ECR-035 Closed(只读)· CMS 041042 Closed
> 关联:[ops-star-config.md](ops-star-config.md) · [star-profile.md](star-profile.md)
---
## 1. 目标
运营可 **创建 / 更新 / 上下架** `StarConfig`;写操作鉴权 + 审计;C 端可读 active 配置并影响星座入口可用性;失败回退「现网可生成」。
验证 ExploreConfig 写面与 CMS 同类闭环;**Closed 后立即 STOP**,不自动 ECR-044。
## 2. In / Out
| In | Out |
|----|-----|
| Admin POST/PUT `/admin/explore/star-configs*` | **RhythmConfig / ImageCardDeck / ScaleDefinition** 一切 |
| 加法权限 `admin.explore.write` | SystemPrompt · KnowledgeSource · Chunk · ToolDefinition |
| 复用表 `star_configs`code/title/active/system | soft-delete · 改引擎/宫位制 · 真支付 · UGC |
| C 端 GET active star configs | Crisis / Handoff / ContentSafety 写 |
| 星座页:无 active → 温和不可用态;API 失败 → 回退可生成 | 合并多概念 · 自动开 ECR-044 |
| 审计 `admin_audit_logs` | 新权限子系统 |
## 3. Domain
| 字段 | 规则 |
|------|------|
| `code` | 唯一;`^[a-z][a-z0-9_]{1,62}$``system=true` 不可改 code |
| `title` | 必填 · ≤128 |
| `active` | `false` = 下架(唯一下架手段) |
| `system` | 种子行;禁止物理删除 |
## 4. API
### Admin
| Method | Path | 权限 |
|--------|------|------|
| GET | `/admin/explore/star-configs` · `/{id}` | `admin.explore.read`(保持) |
| POST | `/admin/explore/star-configs` | `admin.explore.write` |
| PUT | `/admin/explore/star-configs/{id}` | `admin.explore.write` |
无 DELETE。
### C 端
| Method | Path | Auth | 语义 |
|--------|------|------|------|
| GET | `/api/v1/star/configs` | DeviceAuth | 仅 `active=true`;按 code 排序 |
## 5. C 端生效(可观察)
| 条件 | user-h5 `/star` |
|------|-----------------|
| 至少 1 条 active | 保持现网生成路径 |
| 成功且 0 条 active | 展示「星座配置暂未开放」类空态;禁用主生成 CTA |
| 请求失败 | **回退**:不阻断现网生成(与 Banner/FeedSlot 失败回退同哲学) |
不改星历引擎、不改报告 JSON 契约。
## 6. Permission / Migration
- Migration `000052_ops_star_config_write`:授予 `super_admin``admin.explore.write`
- 编码时占号(当前 Max=`000051`
- `knownPermissions` 注册加法码
## 7. UI
| 端 | 行为 |
|----|------|
| admin-h5 探索/星座配置页 | 列表 + 新建/编辑/上下架(仅 StarConfig |
| user-h5 `/star` | 按 §5 显隐 CTA |
## 8. AC
| ID | Then |
|----|------|
| AC-F-01 | POST 合法 → list/get 可见 |
| AC-F-02 | PUT `active=false` → C 端 list 不含 |
| AC-F-03 | 有 active → C 端 list 非空;星座页可生成 |
| AC-F-04 | 重复 code → 409 |
| AC-S-01/02 | 401;仅 read → POST 403 |
| AC-A-01 | 写产生审计 |
| AC-C-01 | 全下架后星座页空态/禁 CTA |
| AC-C-02 | C 端 API 失败不白屏、仍可走回退生成 |
| AC-O-01 | 无 Rhythm/Card/Scale/Prompt 写路径;无 soft-delete |
## 9. Closed 后
**立即 STOP** Continuous Loop。
ECR-044 必须重新 Candidate Review + Human 单独拍板。
## 10. Trace
ECR-043 · BD-2026-043 · PRODUCT_SPEC · CONTRACT_DIFF(实现时)· EXPLORE_CONFIG_WRITE_AUTHORIZATION