feat: document role in query hits (#14 P2) #16

Merged
cflmy merged 1 commits from codex/issue-14-document-role into master 2026-11-30 17:11:13 +08:00
Owner

概述

继续 marqdo-knowledge#14 P2:查询命中新增 additive role 字段(entry/index/log/document/concept/unknown),只从现有公开路径约定推导,用于 agent 区分入口、导航与普通知识文稿;不新增元数据语法、不额外读源码、不建第二索引。

交付

  • src/query/mod.rs:hit 组装与输出新增 role;document_role 只按路径(index.mq.md→entry,OKF index.md/log.md→index/log,其它 .mq.md→document,.md→concept)。
  • spec/knowledge.md §3.1.1 记录字段语义;§4.1 增加 path→role 映射行。
  • docs/STATUS.md 记录实现;测试 tests/query.rs::hits_expose_entry_navigation_and_concept_roles 用真实 compile/query 覆盖四类。
  • 证据 docs/evidence/2026-11-30-document-role.md。

验证(真实,Linux x86_64 / glibc 2.43)

CLI 3.0.0-rc.6 merge afea4f9 + Bundle 0.3.0(tree 4e47b0ff…)
cargo fmt --check / clippy -D warnings          PASS
MARQDO_BIN=<cli> ... cargo test --workspace     141 passed, 0 failed
cargo test --test query                         13 passed

role 是导航信息,不是执行/权威性声明;nature 仍为 unspecified。未创建 release;schema_version 保持 1(additive 字段)。

边界

  • 未改 CLI/其它组件;未新增跨仓依赖;未读取额外源文件。
  • 检索质量首轮指标(#14 P3)与冷启动联调仍是后续项。

refs #14 #12

## 概述 继续 `marqdo-knowledge#14` P2:查询命中新增 additive `role` 字段(entry/index/log/document/concept/unknown),只从现有公开路径约定推导,用于 agent 区分入口、导航与普通知识文稿;不新增元数据语法、不额外读源码、不建第二索引。 ## 交付 - `src/query/mod.rs`:hit 组装与输出新增 `role`;`document_role` 只按路径(`index.mq.md`→entry,OKF `index.md`/`log.md`→index/log,其它 `.mq.md`→document,`.md`→concept)。 - `spec/knowledge.md` §3.1.1 记录字段语义;§4.1 增加 path→role 映射行。 - `docs/STATUS.md` 记录实现;测试 `tests/query.rs::hits_expose_entry_navigation_and_concept_roles` 用真实 compile/query 覆盖四类。 - 证据 `docs/evidence/2026-11-30-document-role.md`。 ## 验证(真实,Linux x86_64 / glibc 2.43) ```text CLI 3.0.0-rc.6 merge afea4f9 + Bundle 0.3.0(tree 4e47b0ff…) cargo fmt --check / clippy -D warnings PASS MARQDO_BIN=<cli> ... cargo test --workspace 141 passed, 0 failed cargo test --test query 13 passed ``` `role` 是导航信息,不是执行/权威性声明;`nature` 仍为 `unspecified`。未创建 release;schema_version 保持 1(additive 字段)。 ## 边界 - 未改 CLI/其它组件;未新增跨仓依赖;未读取额外源文件。 - 检索质量首轮指标(#14 P3)与冷启动联调仍是后续项。 refs #14 #12
cflmy added 1 commit 2026-11-30 17:01:55 +08:00
Continue marqdo-knowledge#14 P2 with one additive, path-convention-derived
field on every query hit: role = entry (index.mq.md), index/log (OKF reserved
files), document (other .mq.md), concept (other .md), or unknown without a
source path.

This is navigation information for agents, not execution or authority: no new
metadata syntax, no extra source read, no second index. spec/knowledge.md
records the field and the path mapping; tests/query.rs compiles a real project
with all four roles; STATUS records implementation and test.

No release; schema_version stays 1 (additive optional-aware field).
cflmy merged commit 90d5d3d2fb into master 2026-11-30 17:11:13 +08:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cflmy/marqdo-knowledge#16