feat(ECR-048): ReportTemplate 写面闭环并 Closed

growth.write POST/PUT · migration 000057 · 无新 C 端 · Loop STOP

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-13 22:51:42 +08:00
co-authored by Cursor
parent aa197b719b
commit e0f605558b
28 changed files with 915 additions and 11 deletions
@@ -0,0 +1,23 @@
# Backend Design: ECR-048 ReportTemplate Write
| Field | Value |
|-------|-------|
| ID | BD-2026-048 |
| Status | **Closed** |
| Coding | **Closed** |
| Migration | `000057_ops_report_template_write` |
## Boundary
```text
POST/PUT /api/v1/admin/growth/report-templates*
Permission: admin.growth.write (reuse)
Fields: code, title, scene, active
system=true: code immutable
Audit: growth.report_template.create|update
No C-end route · no DELETE
```
## Out
Funnel re-write · Prompt · soft-delete · auto ECR-049
+2
View File
@@ -2,6 +2,8 @@
## 2026-08-13
- **ECR-048 Closed** ReportTemplate 薄写(复用 `admin.growth.write` POST/PUT · migration `000057` · 无新 C 端)· **Loop STOP** · 禁自动 ECR-049 · 无 Funnel/Prompt
- **ECR-048 Candidate Review Approved** 首刀 = **ReportTemplate** 薄写(复用 `admin.growth.write`;编码占 `000057`)· Spec/Loop/Coding **未开** · Auth 草案 PENDING · **不得继承 047 Auth**
- **ECR-047 Freeze/Review → FROZEN WAIT** push 齐平 `580f5ea` · 单刀授权硬边界 · **禁自动 ECR-048** · 下一刀须 Candidate Review
- **ECR-047 Authorized Closed** Human `authorize ECR-047 Closed` · 接受本地 `1db5fcc`/`69cb996`/`000056` 为正式 Closed · **不含 push** · Loop STOP · 禁自动 ECR-048
- **ECR-047 Closed** FunnelDefinition 薄写(`admin.growth.write` POST/PUT · migration `000056` · 无新 C 端)· **Loop STOP** · 禁自动 ECR-048 · 无 ReportTemplate
+3
View File
@@ -0,0 +1,3 @@
# CODE_REVIEW — ECR-048
**Verdict:** Approve · ReportTemplate 薄写 only · 无 Funnel/Prompt/soft-delete · Closed 后 STOP · ECR-008 Live Promote 仍 BLOCKED
+18
View File
@@ -0,0 +1,18 @@
ecr: ECR-048
capability: GrowthInsights
change:
type: additive
breaking_change: false
migration_required: true
apis:
- method: POST
path: /api/v1/admin/growth/report-templates
change: added
- method: PUT
path: /api/v1/admin/growth/report-templates/{id}
change: added
perms:
- code: admin.growth.write
change: reused
migration: 000057_ops_report_template_write
notes: no C-end route; Funnel out of scope
+20
View File
@@ -0,0 +1,20 @@
# ECR-048
**Title:** GrowthInsights · ReportTemplate 薄写面
**Status:** **Closed**2026-08-13
**Auth:** `ECR-048_WRITE_AUTHORIZATION.md` · Closed 后 STOP
## Change
1. Spec `ops-report-template-write`
2. POST/PUT `/admin/growth/report-templates*` + `admin.growth.write` + 审计
3. 无新 C 端路由
4. Migration `000057` · OpenAPI · admin-h5
## Forbidden
Funnel 再写 · Prompt 族 · soft-delete · 支付/UGC · 自动 ECR-049
## Acceptance
TEST_REPORT/ECR-048 · CODE_REVIEW Approve · Done · Closed.
@@ -0,0 +1,3 @@
# HANDOFF — Architect → Engineer · ECR-048
Auth Approved · Spec Ready · BD Approved · ReportTemplate ONLY · migration 000057 · Closed → STOP.
@@ -0,0 +1,4 @@
# HANDOFF — Engineer → Reviewer · ECR-048
TestGrowthReportTemplateWrite PASS · governance max 000057 · Ready Closed.
无 Funnel/Prompt · STOP · 禁自动 ECR-049.
@@ -0,0 +1,3 @@
# PRODUCT_SPEC — ECR-048
对齐 `ops-report-template-write.md` · **Closed**.
+5 -5
View File
@@ -53,21 +53,21 @@
- **本仓:** `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-048`(禁自动开)** · **Max=`000056`**
- **Next ECR / Max Migration** **Next=`ECR-049`(禁自动开)** · **Max=`000057`**
- **Write-Wave CMS** 041042 Closed · STOP
- **ExploreConfig** ECR-043…046 Closed · 同构写面 **耗尽 · STOP** · Prompt/Knowledge/Chunk STOP
- **GrowthInsights** ECR-047 FunnelDefinition **Closed · Authorized · Pushed**`580f5ea`)· **FROZEN WAIT** · 禁自动 ECR-048 · ReportTemplate/Prompt STOP
- **GrowthInsights** ECR-047 Funnel · ECR-048 ReportTemplate **Closed** · **Loop STOP** · 禁自动 ECR-049
- **Release** ECR-008 Live Promote **BLOCKED**(独立门禁 · 勿与 Write-Wave 混谈)
- EXP: (无)
- STATE: `docs/STATE/`(含 ECR-041…047
- STATE: `docs/STATE/`(含 ECR-041…048
- 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` · `ops-rhythm-config-write` · `ops-image-card-deck-write` · `ops-scale-definition-write` · `ops-funnel-definition-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` · `ops-image-card-deck-write` · `ops-scale-definition-write` · `ops-funnel-definition-write` · `ops-report-template-write`
## WIP(尚未单独 ECR
- **FROZEN WAIT**ECR-047 Freeze/Review 收口)· 下一刀须 `ECR-048 Candidate Review` + Human 单独授权 · **禁止** Spec→Code 直开
- (无 · ECR-048 Closed · Loop STOP
- BD-2026-044 状态补丁:工作区可暂留 · **不**自动提交
## Pointers
+7
View File
@@ -0,0 +1,7 @@
# STATE — ECR-048
| Status | **Closed** |
| Spec | ops-report-template-write |
| Migration | 000057_ops_report_template_write |
| Closed | 2026-08-13 |
| Next | STOP · ECR-049 禁自动开 |
+11
View File
@@ -0,0 +1,11 @@
# TEST_REPORT — ECR-048 ReportTemplate Write
**Commit:** (pending Close)
```bash
go test ./internal/integration/ -count=1 -run TestGrowthReportTemplateWrite
python3 scripts/repo-governance-check.py
```
PASS · create · 409 · PUT 下架 · audit · 403
REPO GOVERNANCE: PASS · max 000057 · Next ECR-049(禁自动开)
+4 -3
View File
@@ -4,8 +4,8 @@
| Anchor | Value | Rule |
|--------|-------|------|
| **Next ECR** | `ECR-048` | **冻结:** 须重新 Candidate Review + Human 单独拍板;**禁止自动开刀** |
| **Max Migration** | `000056` | 禁止凭记忆 |
| **Next ECR** | `ECR-049` | **冻结:** 须重新 Candidate Review + Human 单独拍板;**禁止自动开刀** |
| **Max Migration** | `000057` | 禁止凭记忆 |
- ECR identity **全局唯一**(含已 Closed);禁止同号双义。分叉只用 `ECR-NNN-suffix` / `ECR-NNNA`
- Migration **6 位版本号唯一**。撞号修复见 `docs/MIGRATION_RENUMBER.md`
@@ -72,6 +72,7 @@
| ECR-044 | ExploreConfig · RhythmConfig 薄写面 | **Closed** | Spec ops-rhythm-config-write · BD-2026-044 · migration **000053** · Closed 后 STOP · 禁自动 ECR-045 |
| ECR-045 | ExploreConfig · ImageCardDeck 薄写面 | **Closed** | Spec ops-image-card-deck-write · BD-2026-045 · migration **000054** · Closed 后 STOP · 禁自动 ECR-046 · 无牌面编辑 |
| ECR-046 | ExploreConfig · ScaleDefinition 元数据薄写 | **Closed** | Spec ops-scale-definition-write · BD-2026-046 · migration **000055** · status 仍 ECR-008 · Closed 后 STOP · 禁自动 ECR-047 |
| ECR-047 | GrowthInsights · FunnelDefinition 薄写面 | **Closed · Authorized · Pushed · FROZEN WAIT** | Spec ops-funnel-definition-write · BD-2026-047 · migration **000056** · Human authorize · Freeze `ECR-047_FREEZE_REVIEW.md` · origin=`580f5ea` · **禁自动 ECR-048** |
| ECR-047 | GrowthInsights · FunnelDefinition 薄写面 | **Closed · Authorized · Pushed · FROZEN WAIT** | Spec ops-funnel-definition-write · BD-2026-047 · migration **000056** · Human authorize · Freeze `ECR-047_FREEZE_REVIEW.md` · origin=`aa197b7` · **禁自动 ECR-048** |
| ECR-048 | GrowthInsights · ReportTemplate 薄写面 | **Closed** | Spec ops-report-template-write · BD-2026-048 · migration **000057** · Closed 后 STOP · 禁自动 ECR-049 |
> **Migration** 合并后 `000015``000023` 曾撞号,已重编号至 `000050`。以 `apps/api/migrations/` 与 `docs/MIGRATION_RENUMBER.md` 为准(文档中旧号引用可能滞后)。
+70
View File
@@ -0,0 +1,70 @@
# ECR-048 Candidate Review — GrowthInsights · ReportTemplate
> **RESOLVED 2026-08-13Human: Candidate Review → Auth/Spec/开码 → Closed):**
> 首刀 = **ReportTemplate 薄写** · **Closed** · Loop **STOP** · 禁自动 ECR-049
**Date:** 2026-08-13
**Mode:** Candidate Review **Approved** · Spec **Closed** · Coding **Closed**
**Anchors:** Next=`ECR-049`(禁自动开)· Max Migration=`000057`
## 锁定现状
| 项 | 状态 |
|----|------|
| ECR-047 | FunnelDefinition **Closed · Authorized · Pushed** · Loop **STOP** |
| ECR-038 | ReportTemplate **只读** Closed |
| `admin.growth.write` | **已存在**047 授予) |
| Continuous Loop | **STOP**047 Auth 耗尽 · **不得继承** |
| 硬 STOP | 支付 / UGC / soft-delete / Crisis·Handoff / Prompt / Knowledge / Chunk |
| ECR-008 Live Promote | **BLOCKED** |
## 八问(Candidate Review 强制)
| # | 问 | 答 |
|---|----|----|
| 1 | 做什么能力? | **ReportTemplate 薄写**`code` / `title` / `scene` / `active` |
| 2 | 为什么现在做? | GrowthInsights 只读目录写面剩 ReportTemplate;与 047 Funnel **同构**,可验证 `growth.write` 复用 |
| 3 | 是否属当前 Write-Wave | **GrowthInsights 写面续刀**(非 CMS / 非 ExploreConfig / 非 AICore |
| 4 | 风险等级? | **低–中**:目录/开关;无新 C 端路由;不改模型行为 |
| 5 | 是否需要新权限? | **否** · 复用 `admin.growth.write`047 已授) |
| 6 | 是否需要 migration | **是** · 占 **000057**(幂等确认 growth.write;与 053055 同模式) |
| 7 | 是否触碰硬 STOP | **否**(排除 Prompt/Knowledge/Chunk/支付/UGC/soft-delete/Crisis |
| 8 | 是否值得继续? | **是** · 对称收口 GrowthInsights 两表写面;Closed 后仍须 STOP |
## 概念候选
| 优先 | 概念 | 备注 |
|------|------|------|
| **★ 决议首刀** | **ReportTemplate** | 表 `report_templates`;复用 growth.write |
| ✕ 排除 | Funnel 再写 | 047 Closed · 勿回流 |
| ✕ 排除 | SystemPrompt / Knowledge / Chunk | **硬 STOP** |
| ✕ 排除 | CMS / Explore / 题干 / Live Promote | 禁 |
## 决议
**ECR-048 = GrowthInsights · ReportTemplate 薄写面**
拟议(Spec 细化):
- 复用表 `report_templates`
- 复用 `admin.growth.write`
- Admin `POST/PUT /admin/growth/report-templates*`
- 字段仅 `code` · `title` · `scene` · `active`
- `system=true`:禁止改 `code` / 物理删
- 审计 `growth.report_template.create|update`
- **无**新 C 端路由
- Migration:编码时占 **000057**
- Continuous Loop**仅**单独 Auth 且 **仅限 ECR-048**Closed → STOP · **禁自动 ECR-049**
## 硬 STOP
Prompt / Knowledge / Chunk · 支付 · UGC · soft-delete · Crisis/Handoff · 题干 · Funnel 再写 · ECR-008 Live Promote 解禁 · 继承 047 Auth · 自动下一刀
## 下一步(仍不写码)
1. ~~ECR-048 Candidate Review approve~~ **Done · ReportTemplate**
2. Human:批准 **ECR-048 专用** Write Authorization(例:`批准 ECR-048 专用 Write Auth → Spec → 开码`
3. Spec `ops-report-template-write` · ECR · BD
4. 开码口令后才改 `apps/`
**本回合交付 = Candidate Review RESOLVED;无 Spec · 无 Auth Loop · 无 `apps/`。**
+27
View File
@@ -0,0 +1,27 @@
# GrowthInsights Write Authorization — ECR-048 only
| Field | Value |
|-------|-------|
| Date | 2026-08-13 |
| Authorizer | Human |
| Status | **Approved · ECR-048 Closed · Loop STOP** |
| Scope | **ReportTemplate 薄写面 ONLY** |
| Continuous Loop | **Finished · STOP** |
| After Closed | **STOP** · 禁止自动 ECR-049 |
## Human 拍板(2026-08-13
1. Candidate Review = ReportTemplate
2. Write Auth → Spec → 开码
3. 复用 `admin.growth.write` · 字段 code/title/scene/active · 无新 C 端路由
4. Continuous Loop **仅限 ECR-048** · **不得继承 047 Auth**
## Hard STOP
Funnel 再写 · Prompt / Knowledge / Chunk · 支付 · UGC · soft-delete · Crisis/Handoff · Closed 后自动下一刀 · ECR-008 Live Promote 解禁
## Refs
Candidate Review: `ECR-048-CANDIDATE_REVIEW.md`
Spec: `.ai/product/feature-spec/ops-report-template-write.md`
ECR: `docs/ECR/ECR-048-report-template-write.md`