Files
Jyotisha/docs/tasks/PROGRESS-chart-profile-update-consistency-20260922.md
T

43 lines
3.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.
# 进度 · 更新出生资料后星盘真值一致性(2026-09-22)
基线:`10baeb2fa865743c428806e115ac92ca9d92fb71``origin/staging`)。分支 `codex/chart-profile-update-consistency-20260922`。未推送,未部署。
## 做了什么
- `PATCH /api/account``GET /api/account``GET /api/chart-view` 共用 `resolveServerOwnedChartBirth`。reported 用声明日期、声明钟点和声明 offsetaccepted / confirmed 的完整 adopted 元组用 active date、active time、active offset 和 provenance;跨午夜同此。
- confirmed 的普通编辑仍返回空的 application patch,不覆盖 `active_birth_time`。声明字段变化时,与 `guard_adopted_birth_date` 相同:date、offset、provenance 一起清空,排盘落到既有的无 adopted 日期路径(声明日期 + 受保护的 active 分钟 + 声明 offset)。不是半截元组。
- accepted 的普通声明编辑仍把状态收成 reported 并清空 active timeadopted 元组一并清空,不会停在「还能排、但 offset 缺了」。
- adopted 日期在而 offset 缺失:`adopted_calculation_incomplete`,不回退声明 offset,也不去调时区解析。
- chart-view 分开记录:`profile_query_error``profile_incomplete``adopted_calculation_incomplete``timezone_resolver_failure``engine_busy``engine_timeout``engine_bad_payload``engine_http_error``response_schema_failure`。查询失败的 HTTP 仍是 200 结构化状态,但 status 不是 `birth_profile_incomplete`。日志只有 reason、route、耗时、HTTP status。
- 星盘模块缓存按账户 id + 资料指纹钉住。PATCH 成功立刻换键并丢掉不匹配的旧快照;与这次保存重叠的 `refreshAccount` 不会把旧指纹钉回去。进行中的旧 `/api/chart-view` 不能写回旧盘。引擎缓存键仍含日期、时间、offset、ayanamsa、node mode。
- `/chart` 仍读账户 `profiles`,不读 `chart_profiles`
## 没有新迁移
`20260920020000_adopted_birth_date.sql``guard_adopted_birth_date` 在同一分支把 `active_birth_date``active_birth_timezone_offset``active_birth_provenance` 置空,不会只清 offset。因此没有「可排盘且 adopted 元组不完整」的 trigger 产物,不加迁移,不跑 `npm run test:db`
## 断言变更
无。既有 `chart-view-route``chart-view-engine``server-owned-birth-profile``adopted-birth-date``account-api``secondary-page-entry` 的测试名和断言原值都没改。
## 测试
| 命令 | 结果 |
| --- | --- |
| `.\node_modules\.bin\tsc --noEmit` | 通过 |
| `npm run lint` | exit 00 error119 条既有 warning,本次改动的文件不在其中 |
| `npx tsx --test tests/chart-profile-update-consistency.test.ts` | 11 pass / 0 fail |
| 同命令加上 `chart-view-route``chart-view-engine``server-owned-birth-profile``adopted-birth-date``account-api``secondary-page-entry` | 57 pass / 0 fail |
未跑全量 `npm test`,未跑 `next build`
## 偏差
- 现场那一户的数据库行仍未知,BUG-996 不把某一种残缺写成唯一根因。见 `BLOCKED.md`
- 账户 GET 的 `chartBirth` 是库存真值。chart-view 只在声明 offset 缺失、且不是 adopted 半截元组时,才在内存里补时区;指纹仍用库存行,所以和 GET 的键一致。带齐 offset 的合成 fixture 上,日期、时间、offset、provenance 完全相同。
- 没有改 `frontend/src/app/(app)/page.tsx`、没有改 `scripts/jyotish_api_server.py`、没有改迁移。
## 环境缺口
无受控登录态,不能复核会议里的那一户。无新迁移,故不用 Docker 跑 `test:db`