feat(ECR-011): 昵称、首页贴士与档案 Self 唯一/合盘交叉校验
ci / h5 (push) Canceled after 0s
ci / api (push) Canceled after 0s
ci / ess-docs (push) Canceled after 0s

每账号仅一条 self(migration 40902);合盘只选 TA;账号昵称可改;首页穿衣/颜色/养生贴士。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-12 22:05:00 +08:00
co-authored by Cursor
parent 5ceb3ce749
commit 13860bf1ef
67 changed files with 1936 additions and 275 deletions
@@ -0,0 +1,39 @@
# HANDOFF — ECR-011 Architect → Engineer
**Date:** 2026-08-12
**ECR:** ECR-011**Approved** 2026-08-12
**BD:** BD-2026-011 Approved
## Task interpretation
补门禁并收敛 WIP:昵称 · 首页贴士 · Self 唯一/合盘交叉校验。
Human 已 Approve;按下方顺序对照 BD 收敛 → 测试产物 → Reviewer。不得扩大 Scope Forbidden。
## Load
1. `docs/ECR/ECR-011-identity-home-profile.md`
2. `docs/BACKEND_DESIGN/BD-2026-011-identity-home-profile.md`
3. `docs/ENGINEERING_SPEC/ECR-011-identity-home-profile.md`
4. Spec`profile` · `star-profile` · `account-auth` · `home`
5. `docs/PROJECT_RULES.md` · `.ai/definition-of-done.md`
## Ordered planApprove 后)
1. **冻结范围** — 仅 Workstream A/B/C;拒绝顺手改 Ops
2. **对照 BD** — migration / 40902 / synastry 校验 / PATCH me / daily-tips 与 OpenAPI 一致
3. **前端**`authSession.ensure*`;合盘 `pickableProfiles` 仅 other;昵称卡;自己卡贴士
4. **测试** — nickname go test · Synastry/Profile/ImageCard vitest · 手工冒烟清单见下
5. **产物**`docs/TEST_REPORT/ECR-011.md` · `docs/HANDOFF/ECR-011-engineer-to-reviewer.md` · 更新 STATE · TRACEABILITY
6. **Gate**`ess-validate.py --phase coding --ecr ECR-011`
## Smoke checklist
- [ ] 档案页仅 1 个「我」;合盘右侧无多个「我」
- [ ] 再跑解码不新增 self、不覆盖已改档案名
- [ ] 匹配/合盘同名同生日 TA 不刷屏
- [ ] 改昵称 → 首页「自己」标题更新
- [ ] 有生日 daily-tips;关 key 仍 fallback
## Owner
Approve 后:`STATE.owner = engineer`
@@ -0,0 +1,24 @@
# HANDOFF — ECR-011 Engineer → Reviewerre-submit
**From:** Engineer
**To:** Reviewer
**Date:** 2026-08-12
**ECR:** ECR-011
## Fixed
- P1`ecr011_test.go` 断言改为 `clothing` · `clothing_index` · `palette` · `wellness` · `source`
- TEST_REPORT 已更新
## Still SKIP locally
Docker daemon 不可用 → integration 仍 SKIP。请 Reviewer 在有 Postgres 环境跑:
```bash
npm run deps:up
cd apps/api && go test ./internal/integration/ -run TestECR011 -count=1 -v
```
## Owner next
`STATE.owner = reviewer`
@@ -0,0 +1,30 @@
# IMPLEMENTATION_REPORT — ECR-011
**Date:** 2026-08-12
**ECR:** ECR-011
## Summary
实现与 Approved BD-2026-011 对齐(过程补录后收敛):账号昵称、首页每日贴士、每账号唯一 Self + 合盘交叉校验与 H5 ensure*。
## Key paths
| Area | Path |
|------|------|
| Migration | `apps/api/migrations/000017_unique_self_profile.*.sql` |
| Nickname | `apps/api/internal/nickname/` |
| Yijing seed | `apps/api/internal/yijing/` |
| Auth | `service/auth` · `handler/auth` PatchMe |
| Profile | `service/profile` ErrSelfExists · 40902 |
| Synastry | `service/report.CreateSynastry` |
| Daily tips | `service/home/daily_tips.go` |
| H5 session | `apps/user-h5/src/lib/authSession.ts` |
| UI | Profile `AccountNicknameCard` · HomeSelfCard · Synastry picks |
## Deviations from BD
无。
## Follow-ups for Reviewer
Integration 需本机 Postgres;手工冒烟清单见 Architect→Engineer HANDOFF。
@@ -0,0 +1,15 @@
# HANDOFF — ECR-011 Reviewer → Engineeriterate
**From:** Reviewer
**To:** Engineer
**Date:** 2026-08-12
**Verdict:** Request changes(见 `docs/CODE_REVIEW/ECR-011.md`
## Required fix
1. 修正 `apps/api/internal/integration/ecr011_test.go`:断言 `clothing` / `palette` / `wellness`(勿用 `wear` / `colors`
2. `npm run deps:up``go test ./internal/integration/ -run TestECR011 -count=1 -v` → PASS
3. 更新 `docs/TEST_REPORT/ECR-011.md`integration 不再 SKIP/错断言)
4. 回交 ReviewerSTATE.owner=reviewer
无 Scope 扩张。