Files
marqdo-knowledge/docs/QUALITY.md
T
cflmy a7f0740cc1
ci/woodpecker/pr/ci Pipeline was successful
test: define the first-round knowledge quality口径
Implement the P3 part of marqdo-knowledge#14 with an executable, fixture-scoped
quality set instead of unmeasured claims:

- tests/quality.rs: fixed 5-document fixture (navigation index + 4 knowledge
  docs), 5 unique-title queries; computes hit@1, hit@3, MRR, navigation role,
  stale refusal and snapshot stale marking; prints one QUALITY_METRICS JSON
  line so CI logs can archive the numbers.
- docs/QUALITY.md defines each metric, the first-round values, the fixed
  fixture scope and the explicit non-claims (no production recall/latency/RSS
  threshold).
- docs/STATUS.md records the implementation; evidence:
  docs/evidence/2026-11-30-quality-first-round.md (5/5 hit@1, MRR 1.0,
  navigation role index, stale refused/marked on this fixture).

No CLI/other component change, no release, no new index or metadata.
2026-11-30 17:35:48 +08:00

1.7 KiB
Raw Blame History

检索质量口径(首轮,issue #14 P3)

本文件定义 marqdo-knowledge 的首轮可执行质量口径。它不是生产基准,也不承诺 召回/延迟/RSS 门槛;数字只适用于固定 fixture 与真实候选制品。

1. 固定 fixture 与查询集

tests/fixtures 之外,首轮口径使用 tests/quality.rs 内的 5 文档确定性 fixture: 一个 index.md 导航入口 + 4 个领域知识文档(归一化、矩阵分解、缓存失效、 时区转换)。查询集为 5 个与标题唯一匹配的问题,期望目标按源路径精确判定。

2. 指标

指标 定义 首轮取值(固定 fixture)
hit@1 期望目标位于第 1 条命中的查询比例 5/5 = 1.0
hit@3 期望目标位于前 3 条命中的查询比例 5/5 = 1.0
MRR 期望目标排名的倒数均值 1.0
navigation role index.md 命中携带 role: index PASS
stale 拒绝 源变更后普通 query 返回 knowledge.database_stale PASS
stale 标记 --snapshot 查询返回 current:false + knowledge.snapshot_stale PASS

执行入口:

cargo test --locked --test quality -- --nocapture
# 输出一行 QUALITY_METRICS {json},CI 日志可归档

3. 边界(不宣称)

  • 固定 fixture 只有 5 个文档/5 个查询,不能代表真实语料;数字不是 Recall@10/MRR 产品门槛,也没有延迟/RSS/大规模性能数据。
  • 指标只覆盖 plain Markdown 命中与导航/新鲜度;.mq.md Analysis 索引、语义通道、 跨域候选排序由各自测试与 marqdo#55 §15 冷启动评估另行覆盖。
  • 修改 fixture/查询集视为改动本口径;应在对应 PR 记录新数字,不沿用旧值。