Files
Jyotisha/docs/tasks/TASK-rectification-compare-card-polish-20260909.md
T

83 lines
9.2 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 · 三列对比卡修正与减法:按候选分钟算经历对照与未来窗(键不匹配)、交付旁白被裁成一句、卡片与右栏做减法、本命宫位改北印星盘(2026-09-09)
- 基线:`origin/staging` @ `365ad799`(三列卡 `a43a6db8`、对话精简 `aa7ccb30`、时间轴修复 `92e3d5e7` 均已合入)
- 分支:`codex/rectification-compare-card-polish-20260909`,基于 `origin/staging`
- 执行方:coding agent;验收:Claude
- 涉及文件:`scripts/rectification/refinement_packet.py``build_refinement_packet``columns` / `column_times_for_compare`)、`scripts/rectification/event_probes.py``prospective_windows_by_time`)、`frontend/src/lib/rectification-agentic/v9/divergence-panel.ts`(列投影、缺数据的表达)、`frontend/src/components/rectification-range-delivery.tsx``frontend/src/lib/rectification-agentic/user-copy.ts``frontend/src/lib/rectification-agentic/v9/agent-run.ts``trimEvidenceTurnBody` 的适用范围)、`frontend/src/components/rectification-board.tsx``frontend/src/components/rectification-house-table.tsx`、复用 `frontend/src/components/personal-report/vedic-chart-svg.tsx``VedicChartSvg` + `NorthIndianChartModel`)、`frontend/src/app/globals.css``frontend/DESIGN.md``frontend/docs/VOICE.md`
- BUG 编号起点:**BUG-614**`docs/BUG_HISTORY.md` 当前最大 BUG-611612/613 已由 `TASK-consultation-daily-empty-answer-20260909.md` 占用)
- 优先级:**P1**(卡片正在展示错误数字:"强相关 0 · 有关联 0 · 弱关联 0"、"未来一年没有明显的窗口")
- 设计口径:**less is more,避免过度提示,用起来顺**。本单每一条减法都要能回答"删掉它用户会少知道什么",答不上来就删。
## 1. 事故实证(2026-09-09 staging,只写结构)
三列卡:04:4951%/ 04:4724%/ 04:5324%)。
| 现象 | 事实 |
| --- | --- |
| 第 2、3 列"强相关 0 · 有关联 0 · 弱关联 0" | 引擎在 compare 里按**引擎分数前三的分钟**算 `event_dasha_ledger_by_time``refinement_packet.py::column_times_for_compare(candidate_times, representative)`,客户端没有传 `column_times`,grep 为空),而卡片的三列是**推断层后验前三**。两套前三不同,`divergence-panel.ts` L313 按时间查表查不到,只有代表分钟回退到 `eventDashaLedger` 才有数 |
| 三列都写"未来一年没有明显的窗口" | 同一原因:`prospectiveWindowsByTime[time]` 三个键都查不到,`?? []` 后文案把"没算"说成"没有" |
| 第 1、2 列性格三句一字不差 | 两分钟同在天秤/巨蟹/月宿较早一侧;三列写全的决定让相同内容重复出现 |
| 交付旁白只剩"校正到这里可以收口了。" | BUG-606 的 `trimEvidenceTurnBody`(超过两句只留首句)对所有 evidence 轮生效,交付轮也是 evidence 轮,BUG-595 定的"交付正文三句"被裁掉 |
| 右栏 | 宫位表 + 确认门折叠 + 换升时刻逐分钟 LayerChips + 显示层折叠 + 两段本命上升折叠。时间轴上线后,换升时刻列表与它表达同一件事(哪些分钟在换升) |
## 2. 决策记录
1. **BUG-614by_time 对引擎全部候选分钟计算,不再只算三个。** `build_refinement_packet``columns` = 引擎 `candidate_times` 去重全集(≤9`minute_step=1` 时仍是引擎给出的候选集,不是整窗 31 分钟);`event_dasha_ledger` 是字典查表,`prospective_windows_for_time` 每分钟一次 Dasha 时间线,`column_compare_ms` 写进度记录,预期 <1s。客户端投影:找不到键时**不得**回退成 0 或"没有窗口",写 `fit: null` / `windows: null`,卡片渲染为"这一分钟还没对照"(一句,灰字)。
2. **BUG-615:交付轮不裁句。** `trimEvidenceTurnBody` 只对"本轮之后仍有下一问"的 evidence 轮生效;本轮 `persistNextInterviewIfIdle` 返回 `terminalNote`(交付)时保留 ≤3 句(BUG-595 决策 4 的口径),超过 3 句才裁到 3 句。
3. **卡片减法(设计)**
- 相同的句子只写一次:三列共有的性格句提到卡片顶部一行("三个时间的事业盘都在巨蟹座:做事以照顾人为主"),列内只留**有差别**的句子;某列没有差别句就不显示性格块,不写"同上"。
- 经历对照改说人话:一行 "8 件经历里 7 件对得上,最不合的是 2024 年 5 月那段感情"(数字来自 strong+medium / total,最不合取 worst);删掉"强相关 4 · 有关联 3 · 弱关联 1"和"经历对照"标题。
- 未来窗一行:"下一个值得留意的时段:2027 年 3 月前后(事业)";没有就一行"未来一年没有明显的时段";没算出来一行"这一分钟还没对照"。删"往后 12 个月"标题。
- 列内不再有 `<h3>` 小标题;每列 = 时间 + 相对可能性 + 至多三行 + 「更像这个」。
- 卡顶保留一行范围与经历数;卡底边界句保留;「查看验证报告」保留。
4. **右栏减法(设计)**
- **本命宫位改北印星盘**:用 `VedicChartSvg``NorthIndianChartModel { houses: [{houseNumber, sign, occupants}] }`)渲染 `house_tables_by_time[代表分钟]`,宫位表 `RectificationHouseTableView` 退为星盘下方的 `<details>`(读屏与复制仍可用)。换分钟时(`changedHouses` / `lagnaChanged`)只高亮变化的宫,不做动画。
- **换升时刻折叠**:时间轴已常驻显示范围与候选点,右栏"换升时刻"整段默认收进 `<details>`summary"换升时刻 · N 个"),逐分钟 LayerChips 不变;"显示层"子折叠并入同一折叠。
- 确认门折叠、两段本命上升折叠保留原样。
- 右栏顶部不加任何新说明文字。
5. 不动采用 RPC、各道门槛、`SCORE_DELTA`、四选项合同、时间轴;Skill 不 bump(只改用户文案与投影)。
## 3. 任务分解
- 3.1 BUG-614:引擎 columns 全集 + 客户端 null 表达;测试——`test_rectification_v5_services.py` 断言 `set(ledgers) == set(candidate_times)``column_compare_ms < 1000``rectification-delivery-ui-simplify-20260908.test.ts` 扩:推断层前三与引擎前三不同时三列 `fit` 都非 null;键缺失时 `fit === null` 且 DOM 出现"这一分钟还没对照"、不出现 "0 · 0 · 0"。
- 3.2 BUG-615`agent-run` 交付轮 ≤3 句;测试——mock 交付轮模型写 4 句 → 落库 3 句;普通证据轮 3 句 → 1 句(既有行为不变)。
- 3.3 卡片减法:投影加 `shared_traits: string[]`、列内 `traits` 只含差异;`fit_line` / `window_line` 由服务端拼好(文案进 `user-copy.ts`,对照 VOICE.md);组件删 `<h3>``agent-voice-copy-contract` 收新句、把"强相关""有关联""弱关联"加进用户可见文案禁用词。三栏说明。
- 3.4 右栏:北印星盘 + 折叠;`rectification-board` 合同测试三栏;`/` 仍 Static、首屏 gzip ±2%(星盘组件已在报告分包,校正面 `dynamic()` 分包不进首屏)。
- 3.5 记录:BUG-614(关联 BUG-597)、BUG-615(关联 BUG-606 / BUG-595);`CHANGELOG.md``frontend/DESIGN.md`(交付卡、右栏两节重写,写明"相同句只写一次""换升时刻默认折叠");`VOICE.md``PROGRESS-…``docs/testing/rectification-scenarios-20260907.md` 交付段更新。
## 4. 让步顺序
3.1、3.2 当天必做并部署(数字错误);3.3 必做;3.4 北印星盘必做、折叠必做;3.5 不可省。
## 5. 开工前置命令
```bash
git fetch origin --prune
git worktree add -b codex/rectification-compare-card-polish-20260909 .worktrees/rectification-compare-card-polish-20260909 origin/staging
cd .worktrees/rectification-compare-card-polish-20260909
ln -s /workspace/Jyotisha/frontend/node_modules frontend/node_modules
ln -s /workspace/Jyotisha/.venv .venv
cd frontend && ./node_modules/.bin/tsc --noEmit; npm run lint 2>&1 | tail -1
ls tests/rectification-*.test.ts tests/agent-voice-copy-contract.test.ts | grep -v database | xargs npx tsx --test 2>&1 | grep -E "^# (tests|pass|fail)"
cd .. && .venv/bin/python -m pytest tests/test_rectification_v5_services.py -q
```
## 验收(Claude2026-09-09`origin/staging` @ `fef54b6e`staging 已部署同 SHA
| 门 | 结果 |
| --- | --- |
| tsc | 0 错 |
| lint | 0 error / 108 warning |
| 前端 rectification + consultation + session + home-bootstrap + public-thinking + voice + skill-registry(非 DB | 1400 / 0 |
| Python v5_services + event_probes + growth contract | 76 passed |
| 项 | 结论 |
| --- | --- |
| BUG-614 | 通过,但留一个缺口:`column_times_for_compare(limit=9)`。BUG-623 之后一小时窗口有 17 个候选,±120 最多 64 个,by_time 仍只算 9 个;推断层前三若不在引擎前九里,卡片会显示"这一分钟还没对照"(诚实,但丢信息)。写进 `TASK-rectification-followups-20260909.md` |
| BUG-615 | 通过。交付轮 ≤3 句、证据轮 1 句;补一条 `answer.delta replace` 让气泡与落库一致(偏离 5 合理) |
| 卡片减法 | 通过。共有句提卡顶、`fit_line` / `window_line`、无小标题、禁用"强相关/有关联/弱关联" |
| 右栏 | 通过。`VedicChartSvg` 北印星盘,宫位表与换升时刻默认折叠 |
| 真实环境 | 欠:三列卡与右栏像素 |
结论:通过(1 个缺口另立)。