Files
digital-psychology/docs/CODE_REVIEW/ECR-001-phaseA-E.md
T
jackyu66gitandCursor 19d3cd5945 refactor(ECR-001): 接入 ESS 并完成结构对齐 Phase A–E
绑定 ESS 双轨治理,拆分超大 H5 页与 Go 引擎,抽出 membership 服务,
并将 star/fortune 重命名为 outlook(JSON 双写兼容);同时修复 /psy API 代理与首页 + 菜单层级。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 17:51:40 +08:00

66 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CODE_REVIEW — ECR-001 Phase AE (+ ECR-002)
**Reviewer:** Cursor Agent (REVIEWER)
**Date:** 2026-08-05
**Decision:** **PASS**(可合入;见 Nits
## Scope reviewed
- Go`service/membership` 抽出 · `handler/report` / `httpserver` 接线 · `relation`/`star` 拆文件 · `fortune``outlook`
- H5Home/Synastry 拆分 · `baseURL`/`vite` 代理 · `+` 菜单 z-index
- 治理:ADR-0007 · LEGACY · go-services · ESS docs
## Evidence
| Check | Result |
|-------|--------|
| 公共 URL / envelope 未改 | PASS |
| Membership 仅经 router 注入,集成测试绿 | PASS(`go test ./internal/integration/` |
| 无残留 `star/fortune` / `package fortune` | PASS |
| JSON `fortune` 旧键保留 + `outlook` 双写 | PASScompat 策略正确) |
| relation/star 单测 | PASS |
| `build:h5` | PASS |
| Phase B 行为冻结(composable 迁移) | PASS(先前冒烟) |
## Findings
### Blockers
无。
### Should-fix(建议合入前或紧随 PR
无必须项。
### Nits(不阻断)
1. **`star/engine.go` 多次 `fort.AsMap()`**
summary/detail 各调用多次,建议 `m := fort.AsMap()` 复用,减分配(非正确性)。
2. **`ReportHandler.Membership` 无 nil 守卫**
生产路径始终由 `NewRouter` 注入;测试若手造 handler 会 NPE。可加防御或构造函数。
3. **`useSynastryPage` ~390 行**
贴近 coding 上限;后续可再抽 chart helpers(非本轮必须)。
4. **Synastry props 面偏宽**
可维护性 nit;可改为 provide/inject(后续)。
5. **JSON `lucky` 字段仍在 `outlook.Period`**
ECR-002 已声明兼容期;彻底 lexicon 清理需客户端迁移后再开 ECR。
6. **分支名未含 ECR-001**
ess-validate 仅 warning;合入时 commit message 宜带 `ECR-001`
## Risk
低。最大残留:旧客户端继续读 `fortune`;新键未使用也不影响。删除旧键前必须扫 H5/sdk。
## Gate
- [x] Architecture / layering PASS
- [x] Tests greenunit + integration + h5 build
- [x] No scope redesign
- [x] Ready to commit / ship Phase AE
**Decision: PASS**