Files
Jyotisha/docs/tasks/PROGRESS-legal-consent-20260930.md
T

36 lines
2.6 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.
# PROGRESS · 合规 A:用户协议 / 隐私政策 / 登录同意 · 2026-09-30
> 产品 2026-09-30「合规与法律的前四个你可以帮我做吗」;主体与联系方式先用占位(产品选定)。执行:Claude fork 子代理 A;分支 `codex/legal-consent-20260930`,基线 `codex/compliance-base-20260930`(= origin/staging `5208f19b` + `legal-entity.ts` 占位)。
## 交付
| 项 | 实现 |
|---|---|
| 协议 / 政策页 | `/terms`、`/privacy`(公开、静态),正文在 `lib/legal-documents.ts`,律师定稿只换这一个文件;草稿标识读 `legal-entity.ts` |
| 登录同意 | `components/legal/login-consent.tsx`(勾选框 + 页脚);`email-otp-login.tsx` 在发送验证码 / 密码登录前检查;所有成功路径收成 `enterApp()`,先 `POST /api/account/consent` 再进入 |
| 同意记录 | 表 `user_consents`(`20260930010000_user_consents.sql`,只加不改、用户只能查 / 插自己的行、随账号级联删除);IP 仅在配置 `CONSENT_IP_SALT` 时存加盐哈希 |
| 再次同意 | `components/legal/legal-consent-gate.tsx` 挂在 `(app)` 外壳;草稿阶段(`legalDocumentsDraft: true`)不启用 |
| 入口 | 登录页页脚、账户菜单底部;ICP 号配置后显示在登录页页脚 |
| 生产护栏 | `JYOTISHA_REQUIRE_LEGAL_ENTITY=1` 时测试要求无占位且非草稿(deploy/README.md 记录为发布前手动步骤;未改 workflow) |
## 待确认事实(交律师 / 产品)
见 `pendingLegalConfirmations()`:在线支付是否开放及方式、退款规则与时限、管辖法院、日志是否含 IP 及保存期限、正式站启用的模型服务商与所在地、地点服务商、VedAstro 是否启用、支付服务商名称、出境合规路径、订单流水保存年限、内容安全日志保存期限、服务器日志保存期限、备份与加密范围。
## 既有断言改动(原值 / 新值 / 原因)
| 文件 | 原值 | 新值 | 原因 |
|---|---|---|---|
| `tests/identity-login-provider.test.ts` | `window.location.assign(successPath)` 出现 5 次 | 出现 1 次(在 `enterApp` 内),`await/void enterApp()` 5 次 | 登录成功先记录同意再跳转,落点不变 |
## 验证
| 项 | 结果 |
|---|---|
| tsc | 0 错 |
| lint | 0 error / 126 warning(同基线) |
| npm test 全量(Node 22) | 4,429 / fail 24;失败名单与基线(origin/staging `5208f19b` 的全量结果)逐条相同,新增 11 条、消失 0 条 |
| next build | `/`、`/terms`、`/privacy` 均 `○ Static` |
| 首屏 gzip-9 | 646,480 B → 647,749 B(+0.20%;外壳多了再次同意组件) |
| 数据库 | 未跑 `test:db`(无 Docker),见 BLOCKED.md |