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>
This commit is contained in:
jackyu66git
2026-08-13 20:43:08 +08:00
co-authored by Cursor
parent fcc7667ba3
commit 87b463b2bb
33 changed files with 1006 additions and 35 deletions
@@ -0,0 +1,29 @@
# Backend Design: ECR-044 RhythmConfig Write
| Field | Value |
|-------|-------|
| ID | BD-2026-044 |
| Status | **Approved** |
| Coding | **AUTHORIZED** |
| Level | L2 |
| Migration | `000053_ops_rhythm_config_write`(编码时分配) |
## Boundary
```text
Domain: RhythmConfig write + C-end active read
API:
POST/PUT /api/v1/admin/explore/rhythm-configs*
GET /api/v1/rhythm/configs
Permission: admin.explore.write (reuse · 043)
Table: reuse rhythm_configs
Audit: explore.rhythm_config.create|update
```
## Out
StarConfig · ImageCardDeck · ScaleDefinition · AICoreConfig · soft-delete · payment · UGC · auto ECR-045
## Rollback
migration down · 移除写路由与 C 端读 · H5 回退始终可生成
+1
View File
@@ -2,6 +2,7 @@
## 2026-08-13
- **ECR-044 Closed** ExploreConfig RhythmConfig 薄写面(复用 `admin.explore.write` · POST/PUT · `GET /rhythm/configs` · `/rhythm` 空态/失败回退 · migration `000053`)· **Continuous Loop STOP** · 禁自动 ECR-045
- **ECR-044 Candidate Review Approved** 首刀 = **RhythmConfig**(不预设 SystemPrompt)· Spec/Loop/Coding **未开** · Auth 草案 PENDING
- **ECR-043 Closed** ExploreConfig StarConfig 薄写面(`admin.explore.write` · POST/PUT · `GET /star/configs` · `/star` 空态/失败回退 · migration `000052`)· **Continuous Loop STOP** · 禁自动 ECR-044
- **ECR-043 Spec Ready** StarConfig 薄写面(Human 批准 Loop 仅 043)· Coding NOT STARTED · Closed 后禁自动 044
+3
View File
@@ -0,0 +1,3 @@
# CODE_REVIEW — ECR-044
**Verdict:** Approve · RhythmConfig write only · 复用 `admin.explore.write` · 下架仅 active=false · 无 Star/Card/Scale/Prompt/Knowledge/Chunk · 无 soft-delete/支付/UGC/Crisis·Handoff · Closed 后 STOP(禁自动 ECR-045)· ECR-008 Live Promote 仍 BLOCKED
+20
View File
@@ -0,0 +1,20 @@
ecr: ECR-044
capability: ExploreConfig
change:
type: additive
breaking_change: false
migration_required: true
apis:
- method: POST
path: /api/v1/admin/explore/rhythm-configs
change: added
- method: PUT
path: /api/v1/admin/explore/rhythm-configs/{id}
change: added
- method: GET
path: /api/v1/rhythm/configs
change: added
perms:
- code: admin.explore.write
change: reused
migration: 000053_ops_rhythm_config_write
+26
View File
@@ -0,0 +1,26 @@
# ECR-044
**Title:** ExploreConfig · RhythmConfig 薄写面
**Status:** **Closed**2026-08-13
**Change Level:** L2
**Auth:** `ECR-044_WRITE_AUTHORIZATION.md` · Continuous Loop **仅本 ECR** · Closed 后 STOP
**Predecessor:** ECR-036 · ECR-043 · Candidate Review Approved
## Change
1. Spec `ops-rhythm-config-write`
2. 复用 `admin.explore.write` + POST/PUT rhythm-configs + 审计
3. C 端 `GET /rhythm/configs``/rhythm` 无 active 空态、失败回退
4. Migration `000053` · OpenAPI · admin-h5
## Forbidden
Star 再写 · Card · Scale · Prompt/Knowledge/Chunk · soft-delete · 支付 · UGC · Crisis/Handoff · **Closed 后自动 ECR-045** · ECR-008 Live Promote 解禁
## Acceptance
见 Spec §8 · TEST_REPORT/ECR-044 · CODE_REVIEW Approve.
## Coding gate
Done · Closed.
@@ -0,0 +1,6 @@
# HANDOFF — Architect → Engineer · ECR-044
**Coding AUTHORIZED** — Human「Write Auth → Spec → 开码」.
Do only RhythmConfig write per Spec. Reuse `admin.explore.write`. Migration 000053.
After Closed: STOP — no ECR-045.
@@ -0,0 +1,4 @@
# HANDOFF — Engineer → Reviewer · ECR-044
TestExploreRhythmConfigWrite PASS · repo-governance-check PASS (max 000053) · Ready Closed.
禁止自动开 ECR-045 · ExploreConfig Loop STOP.
@@ -0,0 +1,3 @@
# PRODUCT_SPEC — ECR-044
对齐 `ops-rhythm-config-write.md` · Human Approved · L2 · **仅 RhythmConfig** · **Closed**.
+5 -5
View File
@@ -53,20 +53,20 @@
- **本仓:** `ess_intake: strict` · Retro FAIL · 单 ECR Context
- **Ops foundation** `docs/WAVE0/` · `.ai/domain/boundary-rules.md` · `glossary.yaml` · Loop: `docs/WAVE0/LOOP_AUTHORIZATION.md`
- ECR: main 线 ECR-006016 ClosedOps 扩展 ECR-013A/B · 017040;分叉已固定为 `ECR-012-star` / `014-plan` / `015-code` / `016-insight`(见 TRACEABILITY
- **Next ECR / Max Migration** **Next=`ECR-044`Candidate Review Approved · RhythmConfig** · **Max=`000052`**(编码→053
- **Next ECR / Max Migration** **Next=`ECR-045`禁自动开** · **Max=`000053`**
- **Write-Wave CMS** 041042 Closed · STOP
- **ExploreConfig** ECR-043 Closed · **ECR-044 Candidate Review Approved** · Spec/Loop **未授权** · Prompt/Knowledge/Chunk STOP
- **ExploreConfig** ECR-043/044 Closed · **Loop STOP** · Prompt/Knowledge/Chunk STOP
- **Release** ECR-008 Live Promote **BLOCKED**(独立门禁 · 勿与 Write-Wave 混谈)
- EXP: (无)
- STATE: `docs/STATE/`(含 ECR-041…043
- STATE: `docs/STATE/`(含 ECR-041…044
- TRACEABILITY: `docs/TRACEABILITY.md` · 门禁 `scripts/repo-governance-check.py`
- ADR: `.ai/adr/0007-ess-ai-dual-track.md`
- Product status: `.ai/product/p1-status.md`**P1 Complete**)· `.ai/product/p2-status.md`**P2 Complete**
- Active Spec: `account-auth` · `explore-test` · `home` · `star-profile` · `life-rhythm` · `input-compliance` · `ops-system` · `profile` · `ops-banner-write` · `ops-star-config-write`
- Active Spec: `account-auth` · `explore-test` · `home` · `star-profile` · `life-rhythm` · `input-compliance` · `ops-system` · `profile` · `ops-banner-write` · `ops-star-config-write` · `ops-rhythm-config-write`
## WIP(尚未单独 ECR
- **ECR-044** RhythmConfigCandidate Review Approved · **Auth Loop PENDING** · **禁止 Spec 冒充开码 / 禁止业务代码**
- (无 · ECR-044 Closed · Loop STOP
## Pointers
+7
View File
@@ -0,0 +1,7 @@
# STATE — ECR-044
| Status | **Closed** |
| Spec | ops-rhythm-config-write |
| Migration | 000053_ops_rhythm_config_write |
| Closed | 2026-08-13 |
| Next | STOP · ECR-045 禁自动开 |
+11
View File
@@ -0,0 +1,11 @@
# TEST_REPORT — ECR-044 RhythmConfig Write
**Commit:** (pending Close)
```bash
go test ./internal/integration/ -count=1 -run TestExploreRhythmConfigWrite
python3 scripts/repo-governance-check.py
```
PASS · AC create/409/C-end hide inactive/empty-all/audit/403 read-only · migration 000053
REPO GOVERNANCE: PASS · max migration 000053 · suggested Next ECR-045(禁自动开)
+3 -3
View File
@@ -4,8 +4,8 @@
| Anchor | Value | Rule |
|--------|-------|------|
| **Next ECR** | `ECR-044` | Candidate Review **Approved**RhythmConfig)· Spec/Loop **未授权** · 禁止自动开 |
| **Max Migration** | `000052` | 044 编码时占 `000053`禁止凭记忆 |
| **Next ECR** | `ECR-045` | **冻结:** 须重新 Candidate Review + Human 单独拍板;**禁止自动开刀** |
| **Max Migration** | `000053` | 禁止凭记忆 |
- ECR identity **全局唯一**(含已 Closed);禁止同号双义。分叉只用 `ECR-NNN-suffix` / `ECR-NNNA`
- Migration **6 位版本号唯一**。撞号修复见 `docs/MIGRATION_RENUMBER.md`
@@ -69,6 +69,6 @@
| ECR-042 | OpsCMS · FeedSlot 薄写面 | **Closed** | Spec ops-feed-slot-write · BD-2026-042 · 无新 migration · 复用 cms.write |
| EXPLORE-WRITE | ExploreConfig 写面授权 | **Approved · 仅 ECR-043 · Closed 后 STOP** | `EXPLORE_CONFIG_WRITE_AUTHORIZATION.md` |
| ECR-043 | ExploreConfig · StarConfig 薄写面 | **Closed** | Spec ops-star-config-write · BD-2026-043 · migration **000052** · Closed 后 STOP · 禁自动 ECR-044 |
| ECR-044 | ExploreConfig · RhythmConfig 薄写面 | **Candidate Review Approved** | `WAVE0/ECR-044-CANDIDATE_REVIEW.md` · Spec/Loop **NOT STARTED** · 禁 Prompt/Knowledge/Chunk |
| ECR-044 | ExploreConfig · RhythmConfig 薄写面 | **Closed** | Spec ops-rhythm-config-write · BD-2026-044 · migration **000053** · Closed 后 STOP · 禁自动 ECR-045 |
> **Migration** 合并后 `000015``000023` 曾撞号,已重编号至 `000050`。以 `apps/api/migrations/` 与 `docs/MIGRATION_RENUMBER.md` 为准(文档中旧号引用可能滞后)。
+5 -5
View File
@@ -1,12 +1,12 @@
# ECR-044 Candidate Review — ExploreConfig 写面(续)
> **RESOLVED 2026-08-13Human: Candidate Review approve):**
> 首刀 = **RhythmConfig** · **禁止**预设 SystemPrompt / Knowledge / Chunk
> Continuous Loop / Spec / Coding**尚未授权**(须另开 Auth + Spec → 开码)
> **RESOLVED 2026-08-13Human: Candidate Review approve → Auth/Spec/开码 → Closed):**
> 首刀 = **RhythmConfig** · **Closed** · Loop **STOP** · 禁自动 ECR-045
> Continuous Loop / Spec / Coding本刀已完成并收口
**Date:** 2026-08-13
**Mode:** Candidate Review **Approved** · Spec **NOT STARTED** · **禁止业务代码**
**Anchors:** Next=`ECR-044` · Max Migration=`000052`
**Mode:** Candidate Review **Approved** · Spec **Closed** · Coding **Closed**
**Anchors:** Next=`ECR-045`(禁自动开)· Max Migration=`000053`
## 锁定现状(评审输入)
+14 -18
View File
@@ -1,32 +1,28 @@
# ExploreConfig Write Authorization — ECR-044 only(草案)
# ExploreConfig Write Authorization — ECR-044 only
| Field | Value |
|-------|-------|
| Date | 2026-08-13 |
| Authorizer | HumanCandidate Review 已批;**Loop 未批** |
| Status | **PENDING Continuous Loop** · Candidate Review = Approved |
| Scope | **ECR-044 · RhythmConfig 薄写面 ONLY**(若本 Auth 获批) |
| Continuous Loop | **NOT YET** |
| Authorizer | Human |
| Status | **Approved · ECR-044 Closed · Loop STOP** |
| Scope | **ECR-044 · RhythmConfig 薄写面 ONLY** |
| Continuous Loop | **Finished · STOP** |
| After Closed | **STOP** · 禁止自动 ECR-045 |
## 前置
## Human 拍板(2026-08-13
- Candidate Review`docs/WAVE0/ECR-044-CANDIDATE_REVIEW.md`**RhythmConfig**
- 043 Auth **已耗尽** · 不可继承
## 待 Human 拍板(本文件生效条件)
1. 确认 Continuous Loop **仅限 ECR-044**
2. 确认复用 `admin.explore.write`(不加新权限体系)
3. 确认硬 STOP 表不变
获批前:**禁止 Spec 冒充已授权开码 · 禁止改 `apps/`**。
1. Candidate Review = RhythmConfig
2. Write Auth → Spec → 开码(本授权)
3. 复用 `admin.explore.write`(043 已授;053 幂等确认)
4. Continuous Loop **仅限 ECR-044**
## Hard STOP
Prompt / Knowledge / Chunk · 支付 · UGC · soft-delete · Crisis/Handoff · Card/Scale 顺带 · Closed 后自动下一刀 · ECR-008 Live Promote 解禁
Star 再写 · Card 内容编辑 · Scale · Prompt / Knowledge / Chunk · 支付 · UGC · soft-delete · Crisis/Handoff · Closed 后自动下一刀 · ECR-008 Live Promote 解禁
## Refs
Candidate Review: `ECR-044-CANDIDATE_REVIEW.md`
Predecessor Closed: ECR-043 · Auth `EXPLORE_CONFIG_WRITE_AUTHORIZATION.md`
Spec: `.ai/product/feature-spec/ops-rhythm-config-write.md`
ECR: `docs/ECR/ECR-044-rhythm-config-write.md`
Predecessor Auth: `EXPLORE_CONFIG_WRITE_AUTHORIZATION.md`043 · 已耗尽)