Files
digital-psychology/.ai/product/feature-spec/ops-rhythm-config-write.md
T
jackyu66gitandCursor 87b463b2bb feat(ECR-044): RhythmConfig 写面闭环并 Closed
复用 admin.explore.write、POST/PUT+审计、C端 GET /rhythm/configs、
H5 无 active 空态/失败回退;migration 000053。ExploreConfig Loop STOP,禁自动 ECR-045。

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

99 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 · RhythmConfig 写面(Ops · ECR-044
> Status: `Active`**Implemented · ECR-044 Closed**
> Map: `§7` · Capability: `ExploreConfig` · BC: `Explore_Reports`
> Auth: `docs/WAVE0/ECR-044_WRITE_AUTHORIZATION.md`Human 批准 · **仅 ECR-044**
> Predecessor: ECR-036 Closed(只读)· ECR-043 ClosedStarConfig 写)
> 关联:[ops-rhythm-config.md](ops-rhythm-config.md) · [life-rhythm.md](life-rhythm.md)
---
## 1. 目标
运营可 **创建 / 更新 / 上下架** `RhythmConfig`;写操作鉴权 + 审计;C 端可读 active 配置并影响节律入口可用性;失败回退「现网可生成」。
验证 ExploreConfig 写面同构复用;**Closed 后立即 STOP**,不自动 ECR-045。
## 2. In / Out
| In | Out |
|----|-----|
| Admin POST/PUT `/admin/explore/rhythm-configs*` | **StarConfig / ImageCardDeck / ScaleDefinition** 一切 |
| 复用权限 `admin.explore.write` | SystemPrompt · KnowledgeSource · Chunk · ToolDefinition |
| 复用表 `rhythm_configs`code/title/active/system | soft-delete · 改节律引擎 · 真支付 · UGC |
| C 端 GET active rhythm configs | Crisis / Handoff / ContentSafety 写 |
| 节律页:无 active → 温和不可用态;API 失败 → 回退可生成 | 合并多概念 · 自动开 ECR-045 |
| 审计 `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/rhythm-configs` · `/{id}` | `admin.explore.read`(保持) |
| POST | `/admin/explore/rhythm-configs` | `admin.explore.write` |
| PUT | `/admin/explore/rhythm-configs/{id}` | `admin.explore.write` |
无 DELETE。
### C 端
| Method | Path | Auth | 语义 |
|--------|------|------|------|
| GET | `/api/v1/rhythm/configs` | DeviceAuth | 仅 `active=true`;按 code 排序 |
## 5. C 端生效(可观察)
| 条件 | user-h5 `/rhythm` |
|------|-------------------|
| 至少 1 条 active | 保持现网生成路径 |
| 成功且 0 条 active | 展示「节律配置暂未开放」类空态;禁用主生成 CTA |
| 请求失败 | **回退**:不阻断现网生成 |
不改节律引擎、不改报告 JSON 契约。
## 6. Permission / Migration
- Migration `000053_ops_rhythm_config_write`:幂等确认 `super_admin``admin.explore.write`043 已授)
- 编码时占号(当前 Max=`000052`
## 7. UI
| 端 | 行为 |
|----|------|
| admin-h5 节律配置页 | 列表 + 新建/编辑/上下架(仅 RhythmConfig |
| user-h5 `/rhythm` | 按 §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 | 无 Star/Card/Scale/Prompt 写路径;无 soft-delete |
## 9. Closed 后
**立即 STOP** Continuous Loop。
ECR-045 必须重新 Candidate Review + Human 单独拍板。
## 10. Trace
ECR-044 · BD-2026-044 · PRODUCT_SPEC · CONTRACT_DIFF · ECR-044_WRITE_AUTHORIZATION