feat(ECR-042): OpsCMS FeedSlot 薄写面

Admin POST/PUT 复用 admin.cms.write;C 端 GET /home/feed-slots;首页无 active 槽隐藏推荐区、失败回退展示;无新 migration。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-13 20:02:01 +08:00
co-authored by Cursor
parent 655141980a
commit 56f661748a
27 changed files with 773 additions and 25 deletions
@@ -0,0 +1,21 @@
# Backend Design: ECR-042 FeedSlot Write
| Field | Value |
|-------|-------|
| ID | BD-2026-042 |
| Status | Approved |
| Migration | NONE(复用 ops_feed_slots · perm 000051 |
| Level | L2 |
## Boundary
```text
POST/PUT /api/v1/admin/cms/feed-slots*
GET /api/v1/home/feed-slots
Permission: admin.cms.write (existing)
Audit: cms.feed_slot.create|update
```
## Out
Banner scope creep · soft-delete · UGC · payment · new RBAC subsystem
+1
View File
@@ -2,6 +2,7 @@
## 2026-08-13
- **ECR-042 Closed** OpsCMS FeedSlot 薄写面(复用 `admin.cms.write` · `GET /home/feed-slots` · 首页槽位显隐)· 无新 migration
- **ECR-041 Closed** OpsCMS Banner 薄写面(`admin.cms.write` · `GET /home/banners` · 首页投影回退 · migration `000051`)· Write-Wave 首刀;未做 FeedSlot
- **Write-Wave 开启:** `docs/WAVE0/WRITE_WAVE_AUTHORIZATION.md` · Continuous Loop 限定写面边界
- **仓侧治理最小补丁(非 ESS 内核):** `scripts/repo-governance-check.py`TRACEABILITY **Next ECR=`ECR-042`** · **Max Migration=`000051`**
+3
View File
@@ -0,0 +1,3 @@
# CODE_REVIEW — ECR-042
**Verdict:** Approve · FeedSlot write only · Banner untouched · no soft-delete/payment/UGC
+19
View File
@@ -0,0 +1,19 @@
ecr: ECR-042
capability: OpsCMS
change:
type: additive
breaking_change: false
migration_required: false
apis:
- method: POST
path: /api/v1/admin/cms/feed-slots
change: added
- method: PUT
path: /api/v1/admin/cms/feed-slots/{id}
change: added
- method: GET
path: /api/v1/home/feed-slots
change: added
perms:
- code: admin.cms.write
change: reused
+1 -8
View File
@@ -44,11 +44,4 @@ Spec `ops-banner-write` · BD-2026-041 · PRODUCT_SPEC/ECR-041 · CONTRACT_DIFF
## Coding gate
```text
repo-governance-check PASS
→ ess-validate design/implement as required
→ BD Approved
→ THEN Continuous Loop may start coding
```
本文件交付时 **禁止改 `apps/` / `packages/`**
Closed via Write-Wave Continuous Loop · Evidence: `docs/TEST_REPORT/ECR-041.md` · `docs/CODE_REVIEW/ECR-041.md`
+21
View File
@@ -0,0 +1,21 @@
# ECR-042
**Title:** OpsCMS · FeedSlot 薄写面
**Status:** **Closed**2026-08-13 · Write-Wave Continuous Loop
**Change Level:** L2
**Write-Wave:** Active · Predecessor ECR-041 Closed
## Change
1. Spec `ops-feed-slot-write`
2. Admin POST/PUT feed-slots + audit(复用 `admin.cms.write`
3. C 端 GET `/home/feed-slots`;首页推荐区按 home 槽 active 显隐
4. admin-h5 FeedSlot 编辑(Banner 写面不回退)
## Forbidden
Banner+FeedSlot 合并扩 scope · soft-delete · UGC · 真支付 · ScheduledPublication 写 · 新权限模型
## Trace
BD-2026-042 · CONTRACT_DIFF · TEST_REPORT · WRITE_WAVE_AUTHORIZATION
@@ -0,0 +1,3 @@
# HANDOFF — Architect → Engineer · ECR-042
Do FeedSlot write per ops-feed-slot-write.md. Reuse cms.write. No new migration. Don't touch Banner behavior beyond coexistence.
@@ -0,0 +1,3 @@
# HANDOFF — Engineer → Reviewer · ECR-042
TestOpsCMSFeedSlotWrite PASS · Ready Closed.
@@ -0,0 +1,3 @@
# PRODUCT_SPEC — ECR-042
对齐 ops-feed-slot-write.md · L2 · FeedSlot 写面
+2 -2
View File
@@ -53,8 +53,8 @@
- **本仓:** `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**`docs/TRACEABILITY.md` 顶部锚点为准 · 现 **Next=`ECR-042`** · **Max=`000051`**
- **Write-Wave** `docs/WAVE0/WRITE_WAVE_AUTHORIZATION.md` · Active · **ECR-041 Banner Closed**;下一刀候选评估(非自动无限)
- **Next ECR / Max Migration** **Next=`ECR-043`** · **Max=`000051`**
- **Write-Wave** Active · ECR-041/042 Closed;下一刀须再评估边界
- EXP: (无)
- STATE: `docs/STATE/`(含 ECR-041
- TRACEABILITY: `docs/TRACEABILITY.md` · 门禁 `scripts/repo-governance-check.py`
+6
View File
@@ -0,0 +1,6 @@
# STATE — ECR-042
| Status | **Closed** |
| Spec | ops-feed-slot-write |
| Migration | none |
| Closed | 2026-08-13 |
+10
View File
@@ -0,0 +1,10 @@
# TEST_REPORT — ECR-042 FeedSlot Write
**Commit:** (fill)
```bash
go test ./internal/integration/ -count=1 -run TestOpsCMSFeedSlotWrite
python3 scripts/repo-governance-check.py
```
PASS · AC create/update/409/403/audit/C-end hide inactive · no new migration
+2 -1
View File
@@ -4,7 +4,7 @@
| Anchor | Value | Rule |
|--------|-------|------|
| **Next ECR** | `ECR-042` | 下一空闲裸号(候选:FeedSlot 写面,须符合 Write-Wave);或 `--print-anchors` |
| **Next ECR** | `ECR-043` | 下一空闲裸号(Write-Wave 候选须再评估);或 `--print-anchors` |
| **Max Migration** | `000051` | 新建 migration 必须读仓内实际 max 后 +1;禁止凭记忆;合入前 `repo-governance-check` PASS |
- ECR identity **全局唯一**(含已 Closed);禁止同号双义。分叉只用 `ECR-NNN-suffix` / `ECR-NNNA`
@@ -66,5 +66,6 @@
| ECR-040 | ExploreConfig · ScaleDefinition | **Closed** | Spec ops-scale-definition.md · BD-2026-040 |
| WRITE-WAVE | Ops 写面加深授权 | **Active** | `docs/WAVE0/WRITE_WAVE_AUTHORIZATION.md` · 真支付最后 · 禁 UGC/soft-delete |
| ECR-041 | OpsCMS · Banner 薄写面 | **Closed** | Spec ops-banner-write · BD-2026-041 · migration **000051** · 禁 FeedSlot |
| ECR-042 | OpsCMS · FeedSlot 薄写面 | **Closed** | Spec ops-feed-slot-write · BD-2026-042 · 无新 migration · 复用 cms.write |
> **Migration** 合并后 `000015``000023` 曾撞号,已重编号至 `000050`。以 `apps/api/migrations/` 与 `docs/MIGRATION_RENUMBER.md` 为准(文档中旧号引用可能滞后)。