fix: rectification recap no longer repeats a date the event already carries (BUG-1496, issue #161)
Staging showed 「记下了:2016-09 2016 年 9 月上大学。」. evidenceRecapLine only
recognised an unspaced 「2016年」 as the phrase's own date, so a spaced year or
an ISO / slash date got the label in front again. It now recognises
`\d{4}\s*年` and `\d{4}[-/.]\d{1,2}`; phrases without a date still get the
label. Regression test fails before the fix and passes after.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20447,3 +20447,18 @@
|
||||
- 关联:BUG-1494。
|
||||
- 复发自:无。
|
||||
- 修复版本:分支 `codex/upstream-sync9b-20261028`。
|
||||
|
||||
## BUG-1496 | 生时校正复述把日期说了两遍(「2016-09 2016 年 9 月上大学」)
|
||||
|
||||
- 状态:resolved(代码 + 回归测试;待部署后 staging 复测)
|
||||
- 首次发现 / 最近更新:2026-10-28 / 2026-10-28(issue #161;issue #148 验收时在 staging 实测发现)
|
||||
- 影响面:`frontend/src/lib/rectification-agentic/v9/host-fallback.ts::evidenceRecapLine`。所有证据轮复述都经过它:本轮入账复述(`acceptedRecapLines`)、每条回复的入账清单(`recordedEvidenceByTurn`)、收束卡「我说错了,改一条」的事件列表(`fixableEvidenceLines`)。
|
||||
- 现象:用户说「2016 年 9 月上大学。」,回复「记下了:2016-09 2016 年 9 月上大学。」
|
||||
- 触发条件:事件说法里自带日期,且年份和「年」之间有空格,或写成 ISO / 斜杠日期。
|
||||
- 根因:拼复述时,判断「事件说法已带日期」的规则只认不带空格的 `\d{4}年`(BUG-1136 加的拼接规则),漏掉「2016 年」「2016-09」「2016/9」,于是又在前面加了一次日期标签。
|
||||
- 修复:改为识别 `\d{4}\s*年` 或 `\d{4}[-/.]\d{1,2}`;事件说法里有这样的日期就只用事件说法,没带日期的照旧加标签。
|
||||
- 验证:`tests/rectification-host-fallback.test.ts` 新增「the recap does not repeat a date the event phrase already carries」,修复前红、修复后绿;覆盖带空格年份、不带空格、ISO、斜杠四种写法,以及不带日期、中文标签、非年份数字(「600 分」)三种不变的情况。`rectification-message-cleanup-20261001`、`rectification-grounding-20260927`、`rectification-event-date-bounds-20261002` 同时通过。
|
||||
- 防复发:上面那条测试固定了「带空格的年份」这一例。拼复述只在 `evidenceRecapLine` 一处做。
|
||||
- 关联:BUG-1136。
|
||||
- 复发自:无。
|
||||
- 修复版本:分支 `codex/rectification-recap-date-dup-20261028`。
|
||||
|
||||
Reference in New Issue
Block a user