Files
digital-psychology/.ai/product/feature-spec/relation.md
T
jackyu66gitandCursor bd22d9dddd feat: P1 合盘/星座/问答与测测完整设计包及模拟器取证工具
落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 11:37:53 +08:00

177 lines
4.3 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.
# Feature Spec: 关系理解
> Status: `Active` · Map: `2.4 关系理解 [P1 · 双引擎]` · Phase: `P1`
> 规范:[../feature-design.md](../feature-design.md)
---
## 1. 功能定义
| 字段 | 内容 |
|---|---|
| Name | 关系理解 |
| Purpose | 帮助用户了解自己与 TA 在沟通、节奏、亲密与冲突上的差异,并获得相处建议 |
| Business Goal | 双引擎增长(分享裂变);深度相处建议付费;不可弱化 |
| In | Out |
|---|---|
| 双 Profile 对比 + 关系报告 | 「合盘 / 合婚 / 缘分」叙事 |
| 多维对比、互补、冲突修复建议 | 宿命/恐吓文案 |
| DeepAccess / 会员解锁完整建议 | 无档案空算 |
---
## 2. 用户价值
1. **为何需要:** 想理解「为什么和 TA 总卡住」。
2. **完成后获得:** 双方风格标签、差异一句话、维度对比;付费后沟通/冲突/亲密/共同成长与本周练习。
3. **为何付费:** 完整相处说明书与话术,可立即用于对话。
---
## 3. 用户角色
| Actor | 本功能能力 |
|---|---|
| Visitor | 需已有 Self;可建 Other;生成 insight + 基础 summary |
| DeepAccess / VIP | 可见完整 detail |
---
## 4. 用户流程
```text
进入 /relation
无 Self 档案? → 引导首页创建画像/档案
填写 TA 称呼 + 生日 → 创建 Other Profile
POST relation/insight
展示双方风格 + 差异 + 维度对比(summary
深度建议? → order deep_access → pay-mock → 完整 sections
分享卡(我的方式 vs TA
```
---
## 5. 页面设计
| 路由 | 页面 |
|---|---|
| `/relation` | RelationPage |
| `/reports/:id` | 关系类报告详情 |
| `/share` | 分享落地 |
```text
/relation
├── Form(输入 TA
├── Empty(无 Self
├── Loading / Error
├── Normal(基础对比)
└── Locked(完整建议墙)
```
---
## 6. 页面状态规范
| 状态 | UI |
|---|---|
| Empty | 无 Self → 链到首页 |
| Loading | 「生成中…」 |
| Error | 文案 + 可去建档 |
| Normal | me/other style、diff、dimension_compare |
| Locked | 深度版 CTA |
---
## 7. Business Rules
| ID | Rule |
|---|---|
| R1 | 必须引用两个 Profile(通常 self + other);禁止无档案生成 |
| R2 | summary 含对比与维度;detail 含 sections / scripts / weekly_practice |
| R3 | detail 权益同画像:Membership **或** 该报告 DeepAccess |
| R4 | Server 鉴权;禁用词:合盘、合婚、运势、吉凶 |
| R5 | 差异叙事为「说明书」非评分/宿命 |
| R6 | 增长价值不得弱于个人画像(分享路径必须存在) |
---
## 8. 数据模型影响
| 表 | 备注 |
|---|---|
| `profiles` | other + relation_type |
| `relation_insights` | profile_a/b + report_id |
| `growth_reports` | type=`relation` |
---
## 9. API 需求
| Method | Path | 意图 |
|---|---|---|
| POST | `/api/v1/profiles` | 创建 TA |
| POST | `/api/v1/relation/insight` | self_id + other_id → insight + report |
| GET | `/api/v1/reports/{id}` | 按权益返回 |
| POST | `/api/v1/orders` + pay-mock | 深度版 |
---
## 10. 权限设计
| 能力 | Visitor | DeepAccess/VIP |
|---|---|---|
| 生成基础关系理解 | ✓ | ✓ |
| 完整相处建议 | ✗ | ✓ |
---
## 11. 埋点
| Event | 触发 |
|---|---|
| `relation_started` | 点生成 |
| `relation_completed` | 基础结果展示 |
| `deep_access_clicked` | 深度 CTA |
| `relation_share_clicked` | 分享 |
| `purchase_completed` | 支付成功 |
---
## 12. 测试验收标准
**Given** 已有 Self
**When** 填写 TA 并生成
**Then** 显示双方风格与 diff_one_liner;无权益时无完整 sections
**Given** 无 Self
**When** 点生成
**Then** 提示去首页建档,不调用成功 insight
**Given** 支付深度版
**When** 刷新报告
**Then** 沟通/冲突等建议可见
---
## 13. AI 开发前检查
- [x] Spec 齐全 · map 已挂 · lexicon · OpenAPI · 可测
---
## 14. Implementation Notes
| 项 | 内容 |
|---|---|
| Packages | `internal/relation` · `service/relation` · `RelationPage` · `ReportRich` |
| Gaps | 埋点未接;真实支付后置 |
| Tests | relation engine L1;集成;RelationPage.spec |
| Process Review | 2026-08-02 [P1-PROCESS-REVIEW](P1-PROCESS-REVIEW.md) · 设计闭合 · 实现 PASS · 测试 PASS |