Files
Jyotisha/docs/tasks/TASK-rectification-candidate-compare-columns-20260908.md
T

77 lines
8.3 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 · 生时校正交付卡改成三列对比:每列写相对可能性、按该分钟推出的性格处事与经历对照、往后 12 个月的事件窗,让用户选更像哪一列(2026-09-08)
- 基线:`origin/staging` @ `7e3b6cdc`BUG-595/596 已合入并部署;本轮转录跑在这版:逐行卡已上线,范围 04:51–04:59
- 分支:`codex/rectification-candidate-compare-columns-20260908`,基于 `origin/staging`
- 执行方:coding agent;验收:Claude
- 涉及文件:`frontend/src/components/rectification-range-delivery.tsx``frontend/src/lib/rectification-agentic/v9/divergence-panel.ts`(投影改列)、`frontend/src/lib/rectification-candidate-result.ts``frontend/src/app/globals.css``scripts/rectification/refinement_packet.py``event_dasha_ledger` / `prospective_event_windows` 按候选分钟各算一份)、`scripts/rectification/api_service.py``frontend/src/lib/rectification-agentic/v9/score-persist.ts`(透传)、`frontend/DESIGN.md``frontend/docs/VOICE.md``skills/jyotish-birth-time-rectification/references/candidate-comparison.md`
- BUG 编号起点:**BUG-597**
- 优先级:**P1**(产品负责人 2026-09-08 决定;这是交付卡第三次改形,本单定稿后不再改形,只调文案)
## 1. 产品决定(原话要点)
"选项一个 row 三个 column 好一些,里面要加上这个时间的可能性、基于这个时间往下推的事件或者性格处事之类,让用户选择他更偏向哪个,而不是现在直接出一个时间。"
这是 09-07 提过的 GPT 式并排对比,当时我改成"区间卡 + 分歧面板",09-08 又改成逐行卡;用户看过实物后选定并排三列。本单**推翻** `TASK-rectification-delivery-ui-simplify-20260908.md` 决策 1 的逐行形态。
## 2. 现状问题(本轮转录)
逐行卡里 04:59 那一行右侧是空的(与代表分钟 D9/D10 相同就不写),用户看不出为什么要选它;04:53 被预先标成"排盘用",用户觉得是"直接出一个时间"。
## 3. 决策记录
1. **一行三列,每列一个候选分钟簇。** 列 = `credible_range` 内按后验概率最高的至多 3 个候选(`inference_state.candidates``probability`,同簇合并取代表);不足 3 列就少列;超过 3 个时末尾一句"还有 N 个分钟可能性更低,已并入范围"。**不预标"排盘用"**,最高概率列排第一即可。移动端三列改为横向滑动,不堆叠成三段。
2. **每列内容固定五段,全部服务端算好,模型不写:**
- 时间 + **相对可能性**`probability` 四舍五入到整数百分比,标签就叫"相对可能性";这是答题后的后验,不是引擎置信度,卡底边界句保留)。
- **性格与处事**:D9 类型表一句(感情相处)、D10 类型表一句(做事方式)、月宿边界两句(若 `nakshatra_boundary.near_boundary`,按该分钟落在较早/较晚一侧取 traits)。三列写全,不再只写差异;相同的句子也写,用户自己对比。
- **经历对照**:该分钟下用户 N 件经历的"强相关 / 有关联 / 弱关联"计数 + 最不吻合的一件(只写"年-月 + 领域",不写摘要)。来源:引擎对 `credible_range` 内 ≤3 个候选各算一份 `event_dasha_ledger_by_time`(同一次 compare 内算,不加请求)。
- **往后 12 个月**:该分钟下 1–2 个事件窗(领域 + 月份区间),来源 `prospective_event_windows` 按候选分钟各算(`prospective_windows_by_time`);没有窗就写"未来一年没有明显的窗口"。
- **按钮「更像这个」**:点即采用该分钟(走现有 accept RPC"正在采用…"→"已采用"),采用后其它列仍可点即改选。用户的选择**不计分**(题库已耗尽,这是采用动作不是探针)。
3. 卡底一句边界句"这只是代表性候选,不是已确认的唯一出生分钟",「查看验证报告」折叠块保留在卡下。
4. 引擎侧:`api_service.compare` 返回 `event_dasha_ledger_by_time``prospective_windows_by_time`(键为 HH:MM,只算 `credible_range` 内至多 3 个分钟),与现有 `event_dasha_ledger`(代表分钟)并存;`minute_step=1``_relative_support`、各道门槛不动;额外耗时写进进度记录(预期每分钟 <1s)。
5. 采用 RPC、确认门不动;Skill 正文口径不变(不 bump),只改 `references/candidate-comparison.md` 的卡片描述段(不进 SKILL.md hash?——`references/` 在 skill 包内,任何字节变化都要 bump**bump 10.0.18**,只改这一段)。
## 4. 顺带修的流程问题(本轮复盘)
- **BUG-598P2,需核对)**:点选题"2015 年 5 月前后有没有搬家或长期住到外地"——按 2016 年入学推算用户当年约 17 岁,`DOMAIN_AGE_LO.relocation = 18` 本应挡掉。`probeBelowAdultFloor` 只在 `method-followup.ts` 三处生效,`core/candidate-contrast-packet.ts::inspectDiscriminatorProbes` 没有 `birthDate``decideAfterInferenceChange``matched ?? inspected.selected` 回退路径会漏。修:`inspectDiscriminatorProbes``birthDate` 并沿用同一 floor。执行方先用该 Case 的出生年核对是否真的越线(≤1997 年生则不算越线),核对结果写进度记录。
- **P2(产品可否决)**:采集题(家人 / 财务 / 健康 …)给一个 44px 的「没有」按钮,点了等于口述拒答(走现有 declined 路径),用户不用每次打字"没有"。
- **不动**:点选题前置于采集(先问 2023.05 再问"哪年入职")是现有设计;每件经历 compare ≈22s 是引擎耗时,本单不动。
## 5. 任务分解
- 5.1 引擎:决策 4`tests/test_rectification_v5_services.py` 加"三分钟各一份 ledger 与窗口、键为 HH:MM、与代表分钟 ledger 一致"。
- 5.2 投影:`divergence-panel.ts` 改为 `columns: [{time, candidate_id, probability_percent, traits: {d9, d10, nakshatra[]}, fit: {strong, medium, weak, worst: {year_month, domain} | null}, windows: [{domain, from, to}], more_count}]`;标签只取类型表与 `nakshatra_boundary.options[].traits`
- 5.3 组件:三列布局、横向滑动、「更像这个」= `onAccept(candidateId)``rectification-delivery-ui-simplify-20260908.test.ts` 三栏(原逐行 → 三列;原值/新值/原因);`agent-voice-copy-contract` 收「更像这个」「相对可能性」「未来一年没有明显的窗口」。
- 5.4 BUG-598 + 「没有」按钮(若产品同意)。
- 5.5 记录:`docs/BUG_HISTORY.md` BUG-597(关联 BUG-595/583/568)、BUG-598`CHANGELOG.md`Skill 10.0.18);`frontend/DESIGN.md`L234 candidates 行、L477 交付段重写);`VOICE.md``PROGRESS-…``docs/testing/rectification-scenarios-20260907.md` 交付段重写。
## 6. 让步顺序
5.1–5.3 必做同一提交;「往后 12 个月」若引擎在 `credible_range` 内没有窗,写固定句即可,不得空白;5.4 的「没有」按钮等产品答复,BUG-598 必做;5.5 不可省。
## 7. 开工前置命令
```bash
git fetch origin --prune
git worktree add -b codex/rectification-candidate-compare-columns-20260908 .worktrees/rectification-candidate-compare-columns-20260908 origin/staging
cd .worktrees/rectification-candidate-compare-columns-20260908
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 tests/skill-registry.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` @ `724a1215`;实现提交 `a43a6db8`
门禁同时间轴验收段(tsc 0 / lint 0 error / 前端 1331/0 / Python 全绿)。
| 项 | 结论 |
| --- | --- |
| 决策 1–3 三列卡 | 通过。「更像这个」走 accept,不预标排盘用,五段服务端算好 |
| 决策 4 引擎 by_time 字段 | 通过。`test_rectification_v5_services.py` 35 绿 |
| Skill 10.0.18 | 通过。快照字节一致 |
| BUG-598 成年下限 | 通过。inspect 回退路径接 birthDate;出生年核对结果见进度记录 |
| 「没有」按钮 | 未做,等产品答复(合理) |
结论:通过。真实环境三列卡观感待下次实测。