feat(ECR-040): ExploreConfig ScaleDefinition 只读投影并 Closed

复用 scales 表只读投影;admin-h5 /catalogs 聚合 026–040 目录;Loop 队列 STOP。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-08 03:20:42 +08:00
co-authored by Cursor
parent 432c090046
commit e9c11cdf1d
26 changed files with 463 additions and 2 deletions
@@ -0,0 +1,23 @@
# Backend Design: ECR-040 ScaleDefinition
| ID | BD-2026-040 |
| Status | Approved |
| Coding | Loop authorized |
| Level | L2 |
| Migration | NO |
## Backend Change Boundary
```text
Domain: ScaleDefinition (read projection of scales)
App: AdminHandler → admin.Service → ScaleRepo
API: GET /admin/explore/scales[+/:id]
Permission: admin.explore.read
UI: admin-h5 /catalogs
```
## Out of boundary
PATCH status · 题干编辑 · UGC · Payment
Rollback: remove routes/UI
+1
View File
@@ -2,6 +2,7 @@
## 2026-08-08
- **ECR-040 Closed**ExploreConfig ScaleDefinitionmigration NO · admin-h5 /catalogs · 只读)
- **ECR-039 Closed**GrowthInsights FunnelDefinitionmigration 000040 · admin client · /analytics/funnel-definitions · 只读)
- **ECR-038 Closed**GrowthInsights ReportTemplatemigration 000039 · admin client · /growth/report-templates · 只读)
- **ECR-037 Closed**ExploreConfig ImageCardDeckmigration 000038 · admin client · /explore/image-card-decks · 只读)
+8
View File
@@ -0,0 +1,8 @@
# CODE_REVIEW — ECR-040
**Verdict:** Approve → Closed
Date: 2026-08-08 · Loop continuous
- ScaleDefinition 只读;无 UGC/真支付
- Integration AC mapped · OpenAPI updated
+23
View File
@@ -0,0 +1,23 @@
ecr: ECR-040
capability: ExploreConfig
bounded_context: Explore_Reports
parent: WAVE0-FROZEN
predecessor: ECR-039
change:
type: additive
breaking_change: false
migration_required: false
compatibility_notes: >
Adds ScaleDefinition read projection over existing scales table.
Requires admin.explore.read. Does not add PATCH.
apis:
- method: GET
path: /api/v1/admin/explore/scales
change: added
- method: GET
path: /api/v1/admin/explore/scales/{id}
change: added
perms:
- code: admin.explore.read
change: unchanged
+15
View File
@@ -0,0 +1,15 @@
# ECR-040
**Title:** ExploreConfig · ScaleDefinition(只读投影)
**Status:** **Closed**
**Closed:** 2026-08-08Loop continuous
**Parent:** WAVE0-FROZEN · **Predecessor:** ECR-039 Closed
**Change Level:** L2
## Change
ScaleDefinition 只读 · migration NO · admin-h5 /catalogs
## Linked
Spec `ops-scale-definition.md` · BD-2026-040 · CONTRACT_DIFF/ECR-040.yaml · TEST_REPORT/ECR-040.md
@@ -0,0 +1,6 @@
# ENGINEERING_SPEC — ECR-040
1. migration NO
2. AdminRepo/Service/Handler
3. OpenAPI + admin-h5
4. Integration · Closed
@@ -0,0 +1,3 @@
# HANDOFF — ECR-040 Architect → Engineer
Loop continuous · Approved + Coding. Migration NO. Forbidden: UGC/真支付.
@@ -0,0 +1,3 @@
# HANDOFF — ECR-040 Engineer → Reviewer
TestExploreScaleDefinitions PASS · Ready for Closed.
@@ -0,0 +1,3 @@
# PRODUCT_SPEC — ECR-040
对齐 ops-scale-definition.md · Approved · Loop · L2 · ScaleDefinition 只读
+6
View File
@@ -0,0 +1,6 @@
# STATE — ECR-040
| Status | **Closed** |
| Phase | closed |
| Spec | ops-scale-definition.md |
| Updated | 2026-08-08 |
+12
View File
@@ -0,0 +1,12 @@
id: TASK-040-ECR040
ecr: ECR-040
title: ExploreConfig · ScaleDefinition(只读投影)
role: engineer
status: closed
change_level: L2
parent: WAVE0-FROZEN
predecessor: ECR-039
acceptance:
- Spec AC mapped
- ScaleDefinition read only
- No UGC / payment
+33
View File
@@ -0,0 +1,33 @@
# TEST_REPORT — ECR-040 ScaleDefinition
Date: 2026-08-08 · Loop continuous · commit: `PENDING`
## Commands
```bash
cd apps/api && go test ./internal/integration/ -run TestExploreScaleDefinitions -count=1
npm run build:admin
python3 scripts/ess-validate.py --phase review --ecr ECR-040
python3 scripts/ess-gate-check.py --ecr ECR-040
```
## Results
| Check | Result |
|-------|--------|
| TestExploreScaleDefinitions | PASS |
| build:admin | PASS |
| ess-validate review | PASS |
| ess-gate-check | PASS |
## AC
| ID | Evidence |
|----|----------|
| AC-F-01 | list seed/empty ok |
| AC-F-02 | get 200 |
| AC-F-03 | 未知 id → 404 |
| AC-S-01 | 401 |
| AC-S-02 | 403 |
| AC-P-01 | list &lt; 500ms |
| AC-O-01 | N/A 只读 |
+1
View File
@@ -44,3 +44,4 @@
| ECR-037 | ExploreConfig · ImageCardDeck | **Closed** | Spec ops-image-card-deck.md · BD-2026-037 · migration 000038 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| ECR-038 | GrowthInsights · ReportTemplate | **Closed** | Spec ops-report-template.md · BD-2026-038 · migration 000039 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| ECR-039 | GrowthInsights · FunnelDefinition | **Closed** | Spec ops-funnel-definition.md · BD-2026-039 · migration 000040 · TEST_REPORT · CODE_REVIEW · Loop continuous |
| ECR-040 | ExploreConfig · ScaleDefinition | **Closed** | Spec ops-scale-definition.md · BD-2026-040 · migration NO · TEST_REPORT · CODE_REVIEW · Loop continuous |
+1 -1
View File
@@ -55,4 +55,4 @@ Human 明文:**直接用 Loop,不用人工确认。**
| Done | Next |
|------|------|
| ECR-013A…039 Closed | **ECR-040** ScaleDefinition 只读投影 |
| ECR-013A…040 Closed | **STOP** — 队列完成;禁真支付/UGC/soft-delete |