7c776bdd3a
BUG-430 loaded Inter via next/font/google, which failed Gitea publish run 2408 when the Docker build could not reach fonts.googleapis.com. Co-authored-by: Cursor <cursoragent@cursor.com>
55 lines
4.4 KiB
Markdown
55 lines
4.4 KiB
Markdown
# PROGRESS · 学业质量探针去重(2026-09-04)
|
||
|
||
工作树:`.worktrees/rectification-quality-probe-dedupe-20260904`
|
||
分支:`codex/rectification-quality-probe-dedupe-20260904`
|
||
基线:任务书写 `origin/staging` `a75929c1`;开工时 `origin/staging` 已是 `a68fd01f`(含本任务书)。未改 `.gitea/workflows/**`、未动迁移、未升级依赖、未 bump Skill(仍 10.0.14)、未改 `page.tsx`(2041 行)。
|
||
|
||
| 任务 | 状态 | BUG |
|
||
| --- | --- | --- |
|
||
| 5.1 `pickProbe` 按键选探针 | 完成 | BUG-540 |
|
||
| 5.2 质量探针按事件 kind 发 | 完成 | BUG-541 |
|
||
| 5.3 同域同分组去重 | 完成 | BUG-541 |
|
||
| 5.4 记录 | 完成 | — |
|
||
|
||
## 编号
|
||
|
||
开工时 `docs/BUG_HISTORY.md` 最大号 BUG-539。本单 **BUG-540、BUG-541**。未占用并行任务书预留的 BUG-542。
|
||
|
||
## 实现要点
|
||
|
||
- `pickProbe`:`probe_id` → `semantic_key` → 无键才按 `choice_kind` 兜底。有键找不到 → `null`,`buildChoiceFrame` 不出卡。`ChoiceCardFollowup` 补 `probe_id`;`makeFollowup` 已有字段,透传即可。
|
||
- `question_id` 在 followup 带 `semantic_key` / `probe_id` 时拼进该键,避免两张质量卡共用 `d5_education:education_style:score`。
|
||
- `_quality_distinguish_probes` 只对 `event_kind ∈ {education_start, education_change, education_interruption}` 的学业事件发;`education_completion` 与其它 kind、非学业域不发。字段读 `event_kind` 或 `kind`。
|
||
- 同域同 yes/no 分钟集合只留信息增益最高、并列取时间最早的一条;被去掉的不计入 `MAX_QUALITY_DISTINGUISH_PROBES`。`candidate_split_hash` 与四选项文案未改。
|
||
|
||
## 偏离
|
||
|
||
- 任务书验收「不同分组 → 两条」在 `_quality_distinguish_probes` 里同域事件共用同一套 D24 yes/no,单次调用不会出现不同分组。不同分组与上限 2 的断言写在 `_select_quality_distinguish_rows`(5.3 实际去重函数)。
|
||
- 「仅毕业仍参与普通时间探针」:3 条事件会被 holdout 抽走 1 条,训练门关、整表空。测试补了第四条家人事件让训练门仍开,断言仍有 dasha 存在性探针、零条质量探针。
|
||
- 有键找不到探针 → 不出卡:新测试覆盖;既有 `rectification-choice-card` 夹具没有出现过这种情况。
|
||
- 非学业域的区分质量探针一并停发(与 BUG-390「质量探针只对学业发出」对齐)。既有「事业不发质量卡」测试仍过。
|
||
|
||
## 测试
|
||
|
||
| 命令 | 结果 |
|
||
| --- | --- |
|
||
| `.venv/bin/python -m pytest tests/test_rectification_event_probes.py tests/test_probe_question_contract.py -q` | 40 passed |
|
||
| `npx tsx --test tests/rectification-choice-card.test.ts tests/rectification-probe-question-contract.test.ts` | 47/47 |
|
||
| 上两项 + `rectification-eight-method` + `rectification-answer-choice` | 140/140 |
|
||
| `tsc --noEmit` | 0 错 |
|
||
| `npx eslint . --quiet` | 0 error |
|
||
| `page.tsx` | 2041 行,未改 |
|
||
| `run_quality_gate.py --profile quick` 内 `npm test` | 2682 tests / 2673 pass / **9 fail**,全部是 Docker 迁移 `database migration failed`(`database-foundation` / `database-local-business` / redeem / identity / secret-refs / v9×3 / Skill migration)。与本单无关,属既有环境缺口。 |
|
||
|
||
未跑全量 `npm test`(时间);未做浏览器真人走查(无登录态)。清单:`docs/testing/rectification-quality-probe-dedupe-20260904.md`。
|
||
|
||
## 门禁修复(BUG-543)
|
||
|
||
Gitea run 2408:`validate` 通过,`publish` 在 `railway-web.Dockerfile` `RUN npm run build` 失败。报错 `Failed to fetch Inter from Google Fonts`。根因是 BUG-430 的 `next/font/google` 在镜像构建里访问不到 Google。未改 workflow。
|
||
|
||
| 项 | 原值 | 新值 | 原因 |
|
||
| --- | --- | --- | --- |
|
||
| `site-style-isolation-contract` Inter 加载断言 | `import { Inter } from "next/font/google"` | `import localFont from "next/font/local"` + 仓内 woff2 魔数 + `frontend/src` 禁止 `from "next/font/google"` / `fonts.googleapis.com` | 构建期不得出网拉字体 |
|
||
|
||
本机补充:`npx tsx --test tests/site-style-isolation-contract.test.ts` **4/4**;`tsc --noEmit` 0 错;改动文件 eslint 0 error。本机 `npm run build` 被 worktree 里 `frontend/node_modules` 指向仓外的 symlink 挡住(Turbopack `points out of the filesystem root`),属既有环境缺口;CI publish 镜像内是 `npm ci`,无此 symlink。编号:BUG-543(未占用预留的 BUG-542)。未改 `.gitea/workflows/**`。
|