Implement the P1 slice of marqdo-knowledge#14 with the #12 contract: every
query hit now carries the document-structure identity and source evidence it
came from, without re-parsing and without a second knowledge body.
- Index anchors from the public Analysis document facts next to each unit node,
including module_id, unit_kind, mode, level and path; plain-Markdown
documents keep null upstream identity instead of fabricating one.
- Query hits add an additive `location` object (module_id, unit_id, unit_kind,
anchors, path, level, mode, nature, exact span) and an `evidence` object
(status current|stale, source_digest, snapshot_digest). `nature` is
`unspecified` because the current public inputs do not declare authority;
Knowledge never guesses it.
- spec/knowledge.md documents §3.1.1 candidate location/evidence and §4.1
document-structure index semantics: entry vs navigation, units/anchors/spans,
and the link != import != call separation (links never become execution
edges). Schema stays version 1; fields are additive and optional.
- tests/query.rs asserts location/evidence on a real compiled project.
No new parser, no metadata syntax, no cross-repo dependency, no execution or
network behavior change.
- exact channel resolves canonical ids, aliases and unique exact names only;
multiple exact names are returned as candidates, never silently chosen
- lexical channel uses weighted FTS5 BM25 over CJK-bigram segmented fields and
reports the matching field; fuzzy channel recalls via the gram index with
bounded edit distance, CJK single-character and prefix fallbacks for typos
whose bigrams do not overlap
- weighted RRF fuses per-node ranks (exact 1.5, lexical/fuzzy/semantic 1.0) and
bounded graph expansion follows references both ways, contains children,
calls/imports in their direction with --relation/--reverse, depth decay and
explicit truncation; --kind filters after expansion
- document/execution/hybrid slices share one plan+materialise traversal, skip
ancestor duplication, include module context for execution imports, report
external/dynamic gaps, enforce the 32 KiB budget on UTF-8 boundaries and keep
exact source text with path/span provenance
- stale databases are refused unless --snapshot is explicit; query never
compiles implicitly and emits the single result envelope with honest
channels/truncated/diagnostics
- add end-to-end query tests for CJK recall, typo recall, exact/ambiguous ids,
kind filtering, graph neighbours, slices, staleness, missing database,
no-result honesty and explicit semantic-config failure