Files
digital-psychology/docs/ECR/ECR-011-identity-home-profile.md
T
jackyu66gitandCursor 13860bf1ef
ci / h5 (push) Canceled after 0s
ci / api (push) Canceled after 0s
ci / ess-docs (push) Canceled after 0s
feat(ECR-011): 昵称、首页贴士与档案 Self 唯一/合盘交叉校验
每账号仅一条 self(migration 40902);合盘只选 TA;账号昵称可改;首页穿衣/颜色/养生贴士。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-12 22:05:00 +08:00

72 lines
3.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.
# ECR-011
**Title:** 账号昵称 · 首页每日贴士 · 档案唯一 Self / 合盘交叉校验
**Status:** Approved
**Date:** 2026-08-12
**Approved:** 2026-08-12Human 确认 Approve
**Change Level:** L2
## Architect 分级说明
| 工作流 | 级别 | 说明 |
|--------|------|------|
| A 档案唯一 Self + 合盘交叉校验 | L2(含 L1 缺陷修复) | migration 唯一索引 · API 409 · 合盘 B 约束 · Spec R7/R8/R11 |
| B 账号昵称生成/编辑 | L2 | 新行为 · PATCH `/auth/me` · Spec account-auth R7R8 |
| C 首页每日贴士(穿衣/颜色/养生) | L2 | 新 API `/home/daily-tips` · LLM · Spec home R5R6 |
**禁止**将本 ECR 拆成「无 Spec 的顺手改」继续合入 main。
**过程补录:** 实现曾领先于 ECR;现已 Human Approve。Closed 前须 TEST_REPORT + CODE_REVIEW + DoD;不得宣称 P1 Complete 除非 DoD PASS。
## Change
1. Active Spec(已改,须随本 ECR 冻结):
- `.ai/product/feature-spec/profile.md`R7R8
- `.ai/product/feature-spec/star-profile.md`R11
- `.ai/product/feature-spec/account-auth.md`R7R8
- `.ai/product/feature-spec/home.md`R5R6
2. migration `000017_unique_self_profile`:软删重复 self + 部分唯一索引
3. API`PATCH /auth/me` · `GET /home/daily-tips` · Create self → 40902 · Synastry B 须 other/附近
4. H5`ensureSelfProfile` / `ensureOtherProfile` · 合盘只挑 other · 档案昵称卡 · 自己卡贴士
5. OpenAPI · types · sdk · 单测
## Motivation
- 合盘出现多个「我」、档案页只显示一条 → 数据不一致
- 解码/星盘等重复 `createProfile(self)` 制造脏数据
- 账号需要可编辑昵称;首页「自己」卡需要节律贴士(非心情条)
## Scope
### Allowed
- 上列 Spec / migration / auth·home·profile·report 服务与对应 H5
- 昵称词库包 `internal/nickname` · 易经种子 `internal/yijing` · daily_tips
### Forbidden
- 改 ECR-010 Ops 行为 · 真支付 · 真推送 · 拆微服务 · 无 ADR 换栈
- 提交 `config.local.yaml` / 密钥 / `test-results/`
- 扩大到紫微/达人/关系链拉取
## Risk
| Risk | Mitigation |
|------|------------|
| 软删「错误」self 导致报告悬挂 | 保留最新 self;报告仍挂 profile_id(软删档案下游已有规则) |
| LLM 延迟/失败 | daily-tips 本地回退;超时配置 |
| 昵称词库碰撞 | 随机即可;非唯一约束 |
| 过程补 ECR 与代码漂移 | HANDOFF 以 Spec+BD 为权威;Reviewer 对照 diff |
## Acceptance Criteria
- [x] 每账号至多 1 条 active self;再建 → 40902handler + OpenAPIintegration 待 Postgres
- [x] 合盘 TA 列表无多余 self;同 id 合盘拒绝;B=本账号须 otherservice
- [x] 注册空昵称 → 词库生成;档案可改;首页展示昵称
- [x] 有 Self 生日 → daily-tips 可返回 llm/fallback;无恐吓/疗效承诺(Spec R6
- [x] OpenAPI 同步;相关 vitest / go unit PASS
- [x] `ess-validate.py --phase coding --ecr ECR-011`(交 Reviewer 前跑)
## Trace
Spec profile · star-profile · account-auth · home · BD-2026-011 · TASK-011