refactor(ECR-004): Synastry 再拆、Scale 测、Membership 守卫、OpenAPI 与 CI
ci / h5 (push) Canceled after 0s
ci / api (push) Canceled after 0s
ci / ess-docs (push) Canceled after 0s

压合盘贴线文件;补选答单测与 nil 守卫;对齐关键 OpenAPI schemas;加 GitHub Actions 门禁。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-05 21:06:14 +08:00
co-authored by Cursor
parent 67701d1f7b
commit 7034c92de7
22 changed files with 1317 additions and 543 deletions
+1
View File
@@ -12,3 +12,4 @@
- **ECR-001 Phase F + H5**types/sdk 对齐 OpenAPI;拆分 8 个超标页(均 ≤400);test:h5 35/35 绿
- QA:修 Playwright `/psy/` 路径与过时断言;e2e 2/2 绿(见 TEST_REPORT/ECR-001-phaseF-qa.md
- **ECR-001 Closed****ECR-002 Closed****ECR-003**:删 JSON `fortune` 双写,`lucky``boost`H5 改读 `outlook`
- **ECR-004**Synastry 再拆 · Scale vitest · Membership nil 守卫 · OpenAPI schemas · GitHub CI
+13
View File
@@ -0,0 +1,13 @@
# CODE_REVIEW — ECR-004
**Decision: PASS / Approve**
## Blockers
## Nits
- OpenAPI 仍有大量 path 仅 `description: OK`(关键 schema 已补;可后续全挂 `$ref`
- CI `ess-validate` 依赖仓库变量 `ESS_ROOT`;未配置时仅跑文档存在性门禁
## Gate
PASS
+35
View File
@@ -0,0 +1,35 @@
# ECR-004
**Title:** 结构卫生跟进(Synastry 再拆 · Scale 测 · Membership 守卫 · OpenAPI · CI
**Status:** Approved
**Date:** 2026-08-05
**Change Level:** L2(结构 / 契约文档 / 工程门禁;无产品扩行为)
## Change
1. 拆分贴线合盘:`useSynastryPage` / `SynastryLanding`
2. Scale 选答交互 vitest
3. `ReportHandler` Membership nil 守卫
4. OpenAPI 补关键 schemas(对齐 `packages/types`)并挂关键 path `$ref`
5. GitHub Actions CIbuild/test H5 · API unit · ESS 文档门禁
## Forbidden
- 改公共 URL / 计分算法 / 产品文案改版
- Docker-only 本地工作流
## Acceptance Criteria
- [x] SynastryLanding / useSynastryPage ≤300 行
- [x] ScalePage.spec 覆盖选答→提交
- [x] Membership nil → 500 信封而非 panic
- [x] OpenAPI 含 Profile / GrowthReport / MembershipMe / Scale* / AskQuota 等
- [x] `.github/workflows/ci.yml` 存在
- [x] `test:h5` · star/handler 相关 go test 绿
**Status:** coding/review PASS · awaiting Human commit
## Linked
- ENGINEERING_SPEC / TASK / STATE / TEST_REPORT under ECR-004
- Successor of ECR-001 residual nits
@@ -0,0 +1,11 @@
# ENGINEERING_SPEC — ECR-004 Hygiene Follow-up
Move/extract only. See ECR-004.
## Steps done in coding
1. Synastry: `lib/synastryChart.ts` · `synastryPageActions.ts` · Landing 子组件
2. `ScalePage.spec.ts`
3. `handler/report.go` `requireMembership`
4. `proto/openapi.yaml` schemas + key `$ref`
5. `.github/workflows/ci.yml`
+2 -2
View File
@@ -45,9 +45,9 @@
## Active anchors
- ECR: **ECR-003** outlook JSON hygieneApproved · coding);ECR-001/002 **Closed**
- ECR: **ECR-004** hygiene follow-upApproved);ECR-001/002/003 Closed / shipped
- EXP: (无)
- STATE: `docs/STATE/ECR-003.md`
- STATE: `docs/STATE/ECR-004.md`
- TRACEABILITY: `docs/TRACEABILITY.md`
- ADR: `.ai/adr/0007-ess-ai-dual-track.md`
- Product status: `.ai/product/p1-status.md`**P1 Complete**
+9
View File
@@ -0,0 +1,9 @@
# STATE — ECR-004
| Field | Value |
|-------|--------|
| ECR | ECR-004 |
| Title | Hygiene follow-up |
| Phase | review PASS · awaiting commit |
| Owner | human |
| Updated | 2026-08-05 |
+28
View File
@@ -0,0 +1,28 @@
# docs/TASKS/TASK-20260805-ECR004.yaml
task_id: ECR-004-hygiene
role: engineer
phase: coding
tool: cursor
status: coded
input:
- docs/ECR/ECR-004-hygiene-followup.md
- .ai/coding.md
output:
- apps/user-h5/src/components/synastry/**
- apps/user-h5/src/composables/useSynastryPage.ts
- apps/user-h5/src/pages/ScalePage.spec.ts
- apps/api/internal/handler/report.go
- proto/openapi.yaml
- .github/workflows/ci.yml
- docs/TEST_REPORT/ECR-004.md
forbidden:
- redesign_scope
- api_url_change
- behavior_change
next_agent: reviewer
notes: >
Synastry split, Scale vitest, membership nil guard, OpenAPI schemas, CI. Tests green.
+13
View File
@@ -0,0 +1,13 @@
# Test Report — ECR-004
## Cases
- [x] SynastryLanding 165 · useSynastryPage 213(≤300
- [x] ScalePage.spec 选答→提交 PASS
- [x] SynastryPage.spec PASS
- [x] Membership `requireMembership` nil 守卫
- [x] OpenAPI schemas + key path `$ref`
- [x] CI workflow `.github/workflows/ci.yml`
- [x] `npm run test:h5` · `go test ./internal/handler/... ./internal/star/...` · `build:h5`
## Gate
coding PASS · awaiting review/commit
+1
View File
@@ -9,3 +9,4 @@
| ECR-001-F/H5 | types/sdk + 8 超标页拆分 | Closed | TEST_REPORT · CODE_REVIEW/ECR-001-phaseF-h5.md |
| ECR-002 | fortune→outlook package | **Closed** | `docs/ECR/ECR-002-fortune-hygiene.md` |
| ECR-003 | outlook JSON hygiene(删 fortune / lucky→boost | review PASS | TEST_REPORT · CODE_REVIEW/ECR-003.md |
| ECR-004 | Synastry 再拆 · Scale 测 · Membership 守卫 · OpenAPI · CI | review PASS | TEST_REPORT · CODE_REVIEW/ECR-004.md |