Files
Jyotisha/docs/tasks/TASK-rectification-followups-20260909.md
T

35 lines
3.0 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.
# TASK · 验收补漏两条:申报时段拦截误伤带钟点的经历;by_time 只算 9 个候选(2026-09-09
- 基线:`origin/staging` @ `fef54b6e`
- 分支:`codex/rectification-followups-20260909`,基于 `origin/staging`;与 BUG-626628 无重叠
- 执行方:coding agent;验收:Claude
- 涉及文件:`frontend/src/lib/rectification-agentic/v9/declared-window-utterance.ts``frontend/src/app/api/rectification/agent/route.ts` L272、`scripts/rectification/refinement_packet.py::column_times_for_compare`
- BUG 编号起点:**BUG-631**`docs/BUG_HISTORY.md` 当前最大 BUG-630
- 优先级:**P1**(第一条会吞掉用户的经历)
## 1. BUG-631(P1):申报时段拦截只看钟点样式,不看语境
`parseDeclaredBirthWindow` 匹配 `HH:MM` / `X 点 Y 分``到 / 至 / -``左右 / 前后`。用户报经历时常带钟点:"2024 年 8 月 8 日 20:00 左右分手""下午 3 点到 5 点被车撞""2019 年 10 月 23 日 9 点半入职"。这些都会在 `route.ts` L272 被拦成"申报出生时段",回固定句、不进模型、证据不落库。
决策:命中钟点样式后再加两道门——(a) 句中含出生语境词(出生 / 生的 / 生于 / 出生时间 / 时辰 / 几点生 / 钟点是)才算申报;(b) 句中含年月日(`\d{4}\s*年``\d{1,2}\s*月``\d{1,2}\s*日`)且无出生语境词 → 一律当经历,不拦。用例:上面三句 → 不拦;"我的出生时间是 14 点 45 到 14 点 50""我是 14:47 左右生的" → 拦;"14:4514:50"(裸范围,无语境) → 拦(intake 之后用户最常这样说)。
## 2. BUG-632P2):by_time 只算引擎前 9 个候选
BUG-623 后引擎候选最多 64 个(一小时 17 个)。`column_times_for_compare(limit=9)` 只给前 9 个算经历对照与未来窗;推断层前三若不在其中,卡片列写"这一分钟还没对照"。决策:`limit` 改为候选全集(≤64);经历对照是字典查表,未来窗每分钟一次 Dasha 时间线,`column_compare_ms` 写进度记录,若 64 个超 3 秒则只对推断层 active 候选算(TS 把 active 列表作为 `column_times` 传入)。用例:17 候选 → by_time 17 键;`column_compare_ms` 断言上限。
## 3. 记录
BUG-631(关联 BUG-625)、BUG-632(关联 BUG-614 / 623);`CHANGELOG.md``PROGRESS-rectification-followups-20260909.md`;走查清单加"报经历带钟点不得被当成申报时段"。
## 4. 开工前置命令
```bash
git fetch origin --prune
git worktree add -b codex/rectification-followups-20260909 .worktrees/rectification-followups-20260909 origin/staging
cd .worktrees/rectification-followups-20260909
ln -s /workspace/Jyotisha/frontend/node_modules frontend/node_modules
ln -s /workspace/Jyotisha/.venv .venv
cd frontend && npx tsx --test tests/rectification-declared-window*.test.ts tests/rectification-v9-agent.test.ts 2>&1 | grep -E "^# (tests|pass|fail)"
cd .. && .venv/bin/python -m pytest tests/test_rectification_v5_services.py -q
```