fix(consult): pass birth-time accuracy instead of treating every chart as unrectified

Hospital records and adopted rectification times were still fed to the model as not_auto_rectified because the chart request omitted declared_accuracy/time_source and mastra hardcoded the boundary. Map profile truth into the engine request, keep rectified for accepted/confirmed active times only, and leave window/general guards unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-02 01:21:40 +08:00
parent 8617eb565c
commit 56daf6be49
14 changed files with 531 additions and 14 deletions
+16
View File
@@ -7166,3 +7166,19 @@
- 相关记录:BUG-464、BUG-465
- 复发自:无
- 修复版本:待发布
## BUG-467 | 填报精确出生时间后咨询仍按未校正范围交互
- 状态:resolved
- 首次发现:2026-09-01
- 最近更新:2026-09-01
- 影响面:`prepareConsultationRoute` / `serverChartFromProfile``runConsultationWorkflow` 请求体、`toAgentConsultationContext``run_rectification_gate` / `_build_consumer_context`、咨询模型指令
- 用户现象:初始化已填医院记录级精确出生时间,或已付费采用校正时间的用户,咨询时模型仍说没做过生时校正、要按时间范围交互。
- 触发条件:`hospital_record` 未校正填报分钟进入咨询;或 `birth_time_status``accepted` / `confirmed` 且存在 `active_birth_time``verified_chart` 咨询。
- 根因:前端星盘 `toolInput` 不传 `declared_accuracy` / `time_source`,引擎默认 `minute`+`family_clear` 得到 `5min` 且矩阵缺档;mastra 又无条件把 `rectification.boundary` 写成 `not_auto_rectified`
- 修复:按档案真值映射精度字段;`rectified` 只在 `accepted`/`confirmed` 且有 active time 时声明。workflow 透传引擎 gate 边界。补 `5min` 分盘档与分级文案。`declared_birth_window` / `general_no_birth_time` 与输出守卫不改。
- 验证:任务 0 不变量先红后绿;`consultation-birth-time-mode` 守卫 9 条保持全绿;聚焦 `consultation-*` / `consult-*` / `chat-*` / `rectification-*``tests/test_rectification_*.py``tests/test_consultation_birth_accuracy.py`
- 防复发:不得对未采用校正的档案声明 `rectified`;不得把 `not_auto_rectified` 写回每次咨询;不得改输出守卫或 window/general 两档指令来“修好”精度传递。
- 相关记录:BUG-009、BUG-073
- 复发自:无
- 修复版本:待发布