fix(web): persist uncertain birth time as a start/end clock window

Users pick a clock range instead of a coarse period plus notes, so
rectification and window consult scan that range instead of a leftover afternoon bucket.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-08-22 20:48:01 +08:00
parent f3197ce3f6
commit 8ed6118b9a
31 changed files with 760 additions and 144 deletions
+16
View File
@@ -5339,3 +5339,19 @@
- 复发自:无
- 修复版本:97620634
## BUG-353 | 不确定时间只扫五档时段,补充描述里的钟点纠正用不上
- 状态:resolved
- 首次发现:2026-08-22
- 最近更新:2026-08-22
- 影响面:出生时间表单、`profiles.declared_window_start/end`、V9 Case 候选窗、普通咨询 declared window、账户 PATCH
- 用户现象:用户已把不确定时间改成 14:30–15:00,或写在补充描述里,生时纠正和 Agent 仍按下午 12:0017:59 扫描。
- 触发条件:`birth_time_source=period_only` 且用户记得的是一段钟点而不是五档粗时段;旧资料把钟点写在 `birth_time_clue`
- 根因:`period_only` 只把 `birth_time_period` 映射成五档固定窗。`birth_time_clue` 不进 Case fingerprint、不进 `candidate_range`、也不被解析。Case 窗在创建时冻结,聊天工具不能改。正则解析备注会把“6—8 点”这类歧义话当成扫描分钟。
- 修复:不确定路径改为开始/结束钟点,不再收集备注。保存 `declared_window_start/end`;自定义钟点优先于五档时段;开始结束相同则拒绝;允许跨午夜。旧 `afternoon` 等行回填对应钟点,用户可以收紧到 14:30–15:00。收紧后 fingerprint 变化,首页开新 Case。不解析 clue,保存时把 clue 写成 null。
- 验证:`frontend/tests/birth-time-intake.test.ts` 锁定开始结束表单、14:30–15:00 持久化且不留下 afternoon 桶;`frontend/tests/declared-birth-window.test.ts` 锁定自定义钟点覆盖 afternoon;`frontend/tests/rectification-v9-case-service.test.ts` 锁定 Case 开窗 14:3015:00 且 fingerprint 变化;`frontend/tests/consultation-route-service.test.ts` 锁定咨询窗;`frontend/tests/account-api.test.ts` 锁定 PATCH 接受开始结束、拒绝同一分钟。
- 防复发:不得把备注正则解析成扫描窗。不得只扫五档时段而丢掉用户选择的开始结束。不得把自定义窗的中点写成 `reported_birth_time`。改窗必须开新 Case,旧会话继续展示冻结窗。
- 相关记录:BUG-197、BUG-198
- 复发自:BUG-197(不确定入口恢复后仍用五档时段加备注,备注从未进入扫描窗)
- 修复版本:待提交