fix(rectification): narrate the credible range and stop scoring periods by length (BUG-569–570)

Choice copy was comparing the search window, so every answer said the range had not changed. Block-scan summed raw scores, so longer afternoon windows won before any evidence difference.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jesse_Chen
2026-09-07 10:03:28 +08:00
parent d6ee8cbb26
commit 517df002b5
17 changed files with 312 additions and 46 deletions
@@ -0,0 +1,42 @@
# PROGRESS · 校正能力补齐修复单(2026-09-07)
工作树:`.worktrees/rectification-capability-fix-20260907`
分支:`codex/rectification-capability-fix-20260907`(跟踪 `origin/staging`
基线:`origin/staging` @ `d6ee8cbb`(含 `814c924e` BUG-565568
未改 `SKILL.md`(仍 10.0.14)、未改采用门 / 确认门 / `MIN_SEPARATION_LEAD` / 分钟级 `_relative_support`、未改 `minute_step=1` 路径、未改 `page.tsx`。未把 `.venv` 加入提交。
本单状态:**待验收**。BUG-569 / BUG-570 已实现;P2 文案与 P3 BLOCKED 同提交。
| 任务 | 状态 | BUG |
| --- | --- | --- |
| 4.1 旁白比 credible_range | 完成 | BUG-569 |
| 4.2 时段支持度按段内均值 | 完成 | BUG-570 |
| 4.3 TRACK_LABEL + BLOCKED 归位 | 完成 | P2 / P3 |
| 4.4 记录 | 完成 | BUG_HISTORY / CHANGELOG / 本文件 / testing 第 2 条 |
## 实现要点
- `composeChoiceNarration` 入参改为 `credibleBefore/credibleAfter``applyRectificationChoice` 传入 `previous.credible_range``applied.state.credible_range`。搜索窗口 `range_start/range_end` 不再进旁白。
- `block_scan``raw_support = max(mean(score in block) min(all scores), 0)`,全零时五段各 20%。`candidate_count` 保留。
- `probe-explain.ts` 的大运标签改走 `publicRectificationMethodLabel``rectification-varga-sentence.ts`),不再维护第二份 TRACK_LABEL。
- `docs/BLOCKED.md` 的 BLK-001 搬回根目录 `BLOCKED.md` 并删除前者。
### 既有断言改动
| 文件 | 原值 | 新值 | 原因 |
| --- | --- | --- | --- |
| `rectification-answer-choice` 纯函数旁白 | `rangeBefore/rangeAfter` 直喂 | 入参改名 `credibleBefore/credibleAfter`,仍测拼句;新增 `applyRectificationChoice` 端到端 | 直喂拦不住把搜索窗口当可信区间 |
| `rectification-choice-card` why_user | 只锁「分成两组」 | 并锁 Vimshottari / Narayana,禁止音译 | P2 |
## 测试
| 命令 | 结果 |
| --- | --- |
| 非 DB `rectification-*` + `consultation-*` + `report-*` + `personal-report-*` + `agent-voice-copy-contract` | **1521 pass / 0 fail**(≥ 1518 |
| `.venv/bin/python -m pytest tests/test_rectification_v5_services.py -k 'not seven_events'` | **31 pass / 0 fail**(含 BUG-570 等分网格与清晨抬高) |
| `test_block_scan_seven_events_finishes_within_fifteen_seconds` 单独跑 | 通过。整文件连跑时偶发 16.0s / 24s / 34.8s,与本次均值公式无关;机器有负载时 15s 预算偏紧 |
| `npx tsc --noEmit` | 0 错 |
| `./node_modules/.bin/eslint --quiet src tests` | 0 error |
排除 `rectification-*-database.test.ts`。ERR-011:验收命令用 `.venv/bin/python -m pytest`。未改 `page.tsx`。未改 `minute_step=1` 指纹。
@@ -13,7 +13,7 @@
| 5.1 单一写入方 | 完成 | BUG-565 |
| 5.2 穷尽态视为已交付 | 完成 | BUG-565 |
| 5.3 穷尽分支不吞题 | 完成 | BUG-566 |
| 5.4 范围小字还原 + 记录 | 完成 | BUG-567BUG-560 根因升级;`docs/BLOCKED.md` BLK-001 |
| 5.4 范围小字还原 + 记录 | 完成 | BUG-567BUG-560 根因升级;`BLOCKED.md` BLK-001 |
## 实现要点
@@ -38,7 +38,7 @@
| 非 DB `tests/rectification-*.test.ts` + `agent-voice-copy-contract.test.ts` | **910 pass / 0 fail**(解释层叠上后 917 |
| `npx tsc --noEmit` | 0 错 |
| `npm run lint` | 0 error / 81 warning(既有 warning,未清) |
| `.venv/bin/python -m pytest tests/test_active_rectification_api.py::test_long_real_conversation_reaches_vedastro_after_local_range_is_narrow` | 失败:`winning_segment` 04:16 / 宽 1 vs 期望 05:0705:08 / 宽 2。基线 `e2f4b55c` 同样失败。见 `docs/BLOCKED.md` BLK-001。 |
| `.venv/bin/python -m pytest tests/test_active_rectification_api.py::test_long_real_conversation_reaches_vedastro_after_local_range_is_narrow` | 失败:`winning_segment` 04:16 / 宽 1 vs 期望 05:0705:08 / 宽 2。基线 `e2f4b55c` 同样失败。见 `BLOCKED.md` BLK-001。 |
排除 `rectification-*-database.test.ts`。ERR-011:验收命令用 `.venv/bin/python -m pytest`。未改 `page.tsx`
+1 -1
View File
@@ -66,7 +66,7 @@
| `TASK-rectification-explain-layer-20260906.md` | `PROGRESS-rectification-explain-layer-20260906.md` | 过程解释层(对照上游 yinduzhanxing 旧工作台唯一领先的业务层):每张卡服务端生成「为什么问这题」与 A/B/C/D「答了会怎样」、答后旁白改成「哪段升降 + 范围从 X 收到 Y」、每轮步骤条「第 N 步 / 为什么 / 下一步」;不做双视图 | 已验收(带修复单:答后旁白比的是搜索窗口,永远「范围没变」,P1) | `814c924e`;修复单 `TASK-rectification-capability-fix-20260907.md`BUG-569 |
| `TASK-rectification-range-reading-20260906.md` | `PROGRESS-rectification-range-reading-20260906.md` | 可信区间成为一等公民:采用时落库 `adopted_credible_range`,报告 `read_report_candidate_range` 与聊天 `verified_chart(accepted)` 都改读它并接同一份 `birth_time_sensitivity`(现在报告读的是开工窗口,BUG-568);引擎 >15 分钟只取 3 样本改为 ≤31 逐分钟;采用旁白加「稳定 / 随分钟变」两句;`declared_birth_window` 复用 | 已验收通过(test:db 37/0 为执行方数字,本机无 Docker) | `814c924e`(BUG-568);两条迁移待应用 |
| `TASK-rectification-unknown-time-20260906.md` | `PROGRESS-rectification-unknown-time-20260906.md` | 完全不知道出生时间的两段式路线:`stage=block_scan` 以 10 分钟步长扫 24 小时只做事件计分、出五时段四选卡(不写账本不采用),选定后进现有分钟流程;引擎加 `minute_step`;开场读 `birth_time_clue`;删 intake 劝退文案 | 已验收(带修复单:时段支持度按段长偏置,下午段先天 25%,P1) | `814c924e`;修复单 `TASK-rectification-capability-fix-20260907.md`BUG-570 |
| `TASK-rectification-capability-fix-20260907.md` | `PROGRESS-rectification-capability-fix-20260907.md` | 能力补齐修复单:答后旁白把 `range_start/range_end`(搜索窗口)当范围比较,每题都说「范围没变」;`block_scan` 五段支持度按段内原始分求和,长时段先天占优(24/24/36/30/30 个候选);`TRACK_LABEL` 音译与产品 Vimshottari/Narayana 口径不一;BLK-001 写到 `docs/BLOCKED.md` 应回根目录 | 待领取 | `codex/rectification-capability-fix-20260907`BUG-569570 |
| `TASK-rectification-capability-fix-20260907.md` | `PROGRESS-rectification-capability-fix-20260907.md` | 能力补齐修复单:答后旁白把 `range_start/range_end`(搜索窗口)当范围比较,每题都说「范围没变」;`block_scan` 五段支持度按段内原始分求和,长时段先天占优(24/24/36/30/30 个候选);`TRACK_LABEL` 音译与产品 Vimshottari/Narayana 口径不一;BLK-001 写到 `docs/BLOCKED.md` 应回根目录 | 待验收 | `codex/rectification-capability-fix-20260907`BUG-569570 |
| `TASK-api-not-configured-mislabel-20260904.md` | `PROGRESS-api-not-configured-mislabel-20260904.md` | 16 处路由把数据库瞬断(部署切换窗口)兜底翻译成 503「服务尚未配置」;改为仅配置错误用该文案,其余 `service_unavailable`,收敛为共享 helper | 已验收 | `5483649b`(BUG-542);2 条子进程测试留 CI Node 22 复核 |
| `TASK-rectification-ux-20260902.md` | `PROGRESS-rectification-ux-20260903.md` | 会话面空白假死与交互摩擦 | 已验收 | `d159f08e`(09-03 在新基线重做后合入,BUG-505509 |