Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0193vBv6w5MV2cifdTUu9H5P
78 lines
6.3 KiB
Markdown
78 lines
6.3 KiB
Markdown
# TASK · 生时校正修复单:答完「2023 年 5 月前后有没有…」又问「2023 年前后有没有…」(2026-09-08)
|
||
|
||
- 基线:`origin/staging` @ `7ca6ade2`(BUG-590/591 已合入并部署;本轮转录跑在这版)
|
||
- 分支:`codex/rectification-same-year-probe-dedupe-20260908`,基于 `origin/staging`
|
||
- 执行方:coding agent;验收:Claude
|
||
- 涉及文件:`frontend/src/lib/rectification-agentic/core/candidate-contrast-packet.ts`(`inspectDiscriminatorProbes`)、`v9/method-followup.ts`(`rankRenderableDiscriminators` 的 `asked` 处理、`existenceProbeAsked`)、`v9/probe-question-contract.ts`(`rankDiscriminatorScore`)、`v9/decision-from-dossier.ts`(`decideAfterInferenceChange`)
|
||
- BUG 编号起点:**BUG-592**
|
||
- 优先级:**P1**(连续三次实测都出现;用户原话"相同的选择题又问了两遍")
|
||
|
||
## 1. 事故实证(三次实测同形;只写结构)
|
||
|
||
点选题顺序:D9 风格 → `career.2023.05.dasha_boundary`(答 C 没发生)→ `career.2024.04.dasha_boundary` → `relocation.2015.05.dasha_boundary` → **`career.2023.dasha_activation`**(题干"2023 年前后,有没有入职、换工作或职责加重?")。上一个 Case 的 `rounds` 也是同一顺序,且顺序正好等于各题 `information_gain` 降序(1.53 / 1.10 / 0.97 / 0.74 / 0.46)。
|
||
|
||
同一领域、同一年、同一句问法问了两遍;用户已经答过 5 月"明确没有发生",整年再问一遍没有信息量。
|
||
|
||
## 2. 根因(BUG-559 复发)
|
||
|
||
BUG-559 的修复分两半:引擎侧在**重新生成**时按 `asked_probe_keys` 屏蔽同年与相邻年(`event_probes.py::_existence_blocked_years`),TS 侧加了 `existenceProbeAsked`。但:
|
||
|
||
1. **点选答题不重跑引擎。** 五道题都来自同一次 compare 生成的 `inference_state.probes`,`career.2023.05.dasha_boundary` 和 `career.2023.dasha_activation` 同时在列表里。引擎侧屏蔽只在下一次 compare 生效,而 compare 只在新证据写入时才跑。
|
||
2. **TS 侧只降权、不排除。** 点选后的下一题由 `decideAfterInferenceChange` → `core/candidate-contrast-packet.ts::inspectDiscriminatorProbes` 挑选,`askedAlready` 只认精确 `semantic_key` / `candidate_split_hash` / `probe_id` / 分盘层,没有领域+年份规则;`method-followup.ts::rankRenderableDiscriminators` 虽然调了 `existenceProbeAsked`,结果只是把 `asked=true` 交给 `rankDiscriminatorScore`,`semanticNovelty` 从 1 降到 0.35——0.46×0.35≈0.16 仍高于 0.08 门槛,前面的题问完就轮到它。`remainingReverseVerifyProbes` 里倒是 `continue` 排除,但那只管采用后核对。
|
||
|
||
BUG-559 的验证用例只锁了引擎重生成和 `existenceProbeAsked` 本身返回 true,没有锁"同一份 probes 列表里答完 5 月后不得再问同年"。
|
||
|
||
## 3. 决策记录
|
||
|
||
1. **同领域同年份,答过一道就不再问第二道(硬排除)。** `inspectDiscriminatorProbes` 与 `rankRenderableDiscriminators` 都增加:`askedKeys` 中存在同 `domain` 且**同 `year`** 的 key(`SEMANTIC_YEAR` 解析)→ 不进候选,`dropped_probes(reason="same_year_asked")`。`year=0` 的分盘风格题不受影响。
|
||
2. **相邻年(±1)维持降权,不硬排除。** 本轮 2023 年 5 月答"没发生"、2024 年 4 月答"发生",两题分裂的候选组不同,都有信息量;BUG-559 引擎侧对相邻年的屏蔽只影响重生成,不动。
|
||
3. `existenceProbeAsked` 拆成 `sameYearProbeAsked`(硬)与现有的邻近年判断(软);`rankDiscriminatorScore` 的 `semanticNovelty` 语义不变。
|
||
4. 引擎 `asked_probe_keys` 行为不变;`SCORE_DELTA`、四选项合同、各道门槛不动;Skill 不 bump。
|
||
|
||
## 4. 任务分解
|
||
|
||
### 4.1 BUG-592
|
||
- 验收(`rectification-probe-year-dedupe-20260906.test.ts` 扩 + `rectification-inference-*.test.ts`):
|
||
- (a) `inference_state.probes` 同时含 `career.2023.05.dasha_boundary`(gain 1.10)与 `career.2023.dasha_activation`(gain 0.46),答完前者后 `decideAfterInferenceChange(...).probe.semantic_key !== "career.2023.dasha_activation"`,`dropped_probes` 含 `same_year_asked`。
|
||
- (b) 同列表含 `career.2024.04.dasha_boundary` → 仍可被问(相邻年不硬排除)。
|
||
- (c) `buildMethodFollowupPlan` 路径同 (a)。
|
||
- (d) 事故顺序回放(五道题 + D10):第五题不再是 2023 activation,而是 D10 风格题或直接进入交付。
|
||
- (e) 引擎 `tests/test_rectification_event_probes.py` 全绿(不改)。
|
||
|
||
### 4.2 记录
|
||
- `docs/BUG_HISTORY.md` BUG-592:**复发自 BUG-559**,写明旧防线为何没拦住(引擎侧只管重生成;TS 侧只降权);`CHANGELOG.md`;`PROGRESS-rectification-same-year-probe-dedupe-20260908.md`;`docs/testing/rectification-scenarios-20260907.md` 加"同领域同年份的点选题只出一次"。
|
||
|
||
## 5. 让步顺序
|
||
|
||
4.1 (a)(c)(d) 必做;(b) 是守卫,防止把有信息量的相邻年题一起砍掉;4.2 不可省。
|
||
|
||
## 6. 开工前置命令
|
||
|
||
```bash
|
||
git fetch origin --prune
|
||
git worktree add -b codex/rectification-same-year-probe-dedupe-20260908 .worktrees/rectification-same-year-probe-dedupe-20260908 origin/staging
|
||
cd .worktrees/rectification-same-year-probe-dedupe-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 | grep -v database | xargs npx tsx --test 2>&1 | grep -E "^# (tests|pass|fail)"
|
||
cd .. && .venv/bin/python -m pytest tests/test_rectification_event_probes.py -q
|
||
```
|
||
|
||
## 验收(Claude,2026-09-08,`origin/staging` @ `6a687085`,staging 已部署同 SHA)
|
||
|
||
| 门 | 结果 |
|
||
| --- | --- |
|
||
| tsc | 0 错 |
|
||
| lint | 0 error / 103 warning |
|
||
| 前端 rectification + consultation + voice + skill-registry(非 DB) | 1270 / 0 |
|
||
| Python v5_services + event_probes + growth contract | 全绿 |
|
||
|
||
| 项 | 结论 |
|
||
| --- | --- |
|
||
| 4.1 (a)(c)(d) | 通过。`sameYearProbeAsked` 在 inspect 与 followup 两条路都硬排除;真实 Case(2026-09-08 第八次实测)答完 2023.05 后未再出 2023 activation |
|
||
| 4.1 (b) | 通过。相邻年只降权;偏离 3(`remainingConflictProbes` 改同年硬排除)合理 |
|
||
| 4.2 记录 | 通过(复发自 BUG-559) |
|
||
|
||
结论:通过。
|