Files

45 lines
2.8 KiB
Markdown
Raw Permalink 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.
---
type: schema
node_id: schema:baseline-diagnosis
title: "表结构: baseline_diagnosis(逐题诊断信号)"
date: 2026-07-15
---
# 表结构: baseline_diagnosis(逐题诊断信号)
> 载体:`harness.db``workspaces/<ws>/harness.db`)。用途:把已有 baseline run(如 `infer_adhoc`)的每道错题诊断结果落成信号行,供视频级切分选择器消费。**逐题 upsert,可断点续跑。**
> 实现:`schema:results-driven-video-split` 计划 Task 3(端口 `DiagnosisSignalStore``core/evolution/protocols.py`+ 适配 `adapters/baseline_diagnosis_store.py`),遵循 `app/harness/log.py::HarnessLog` 既有约定(`create_table` + `insert(mode="replace")` 实现 upsert)。
## 列定义
| 列 | 类型 | 可空 | 说明 |
|----|------|:---:|------|
| question_id | TEXT | 否 | 题唯一标识(canonical 取行 = 每 qid 第一行 `ORDER BY rowid` |
| video_id | TEXT | 否 | 视频标识 |
| baseline_run_id | TEXT | 否 | 溯源 run(如 `infer_adhoc` |
| diag_fingerprint | TEXT | 否 | `hash(诊断prompt版本 + model + 诊断代码git短SHA)``--force` 用新值不覆盖旧 |
| task_type | TEXT | 否 | 12 类之一 |
| error_type | TEXT | **是** | extraction/search/reasoning/mixed**T0(INFRA)/uncertain 行为 NULL** |
| cause_category | TEXT | 是 | defect/lapse;正确题/INFRA/未判为 NULL |
| tier | TEXT | 否 | T0 / T1 / T2 / uncertain |
| evolution_target | TEXT | **是** | 由 error_type 派生 tool/skill/systemerror_type 为 NULL 时亦 NULL |
| degraded | INTEGER | 否 | judge 解析失败降级 0/1 |
| infra | INTEGER | 否 | INFRAstop_reason∈{error,parse_error})排除 0/1 |
| session_id | TEXT | 是 | 遥测关联 ID |
**主键**`(question_id, baseline_run_id, diag_fingerprint)` —— 保证 upsert 幂等、不同 fingerprint 隔离、断点续跑按已完成集跳过。
**tier 写规则**INFRA 题 `infra=1, tier=T0, error_type/cause_category/evolution_target=NULL`degraded/诊断失败题 `degraded=1, tier=uncertain, error_type` 可 NULL`cause_category='defect'``tier=T2``='lapse'``tier=T1`。仅 T2 进 48 格覆盖。
## 埋点位置
| 位置 | 动作 |
|------|------|
| `app/harness/baseline_diagnosis.py::run_baseline_diagnosis`(计划 Task 4 | 投影 `run_diagnosis``error_attributions` + `infra_question_ids` + `degraded_question_ids` → 逐行 `store.upsert(DiagnosisSignalRow)` |
| `adapters/baseline_diagnosis_store.py::SqliteDiagnosisSignalStore.upsert`(计划 Task 3 | `INSERT OR REPLACE`(单事务原子) |
| 读回 | `.done_question_ids(run,fp)`(续跑跳过)/ `.load(run,fp)`(选择器输入) |
## 关联
- 实现设计:`design:results-driven-video-split`
- 被度量:`metric:split-signal-tier-distribution``metric:split-cell-coverage`