marqdo-knowledge cca8fbdab1 feat(storage): one rebuildable SQLite projection with derived indexes
- add schema revision 1 with application id, singleton build row, documents,
  nodes, aliases, edges, contexts, inputs, diagnostics, search_units,
  FTS5 search_fts, grams and embeddings tables; spans and resolved-target
  invariants are enforced by CHECK constraints and foreign_keys=ON
- full rebuild stages a private database in the target directory and renames
  it atomically after source recheck and quick_check; a foreign or symlinked
  database is refused, never overwritten
- incremental publish replaces the projection inside one transaction, so
  readers see the old or the new complete snapshot and failures roll back to
  the last successful artifact
- store exact UTF-8 source bytes and digest-guarded normalised facts for the
  incremental re-analysis cache; inputs are content digests, never mtimes
- build one search unit per structural node/chunk with CJK bigram FTS
  segmentation, weighted FTS fields and bounded 2/3-gram fuzzy rows
- add read-only store API (nodes, aliases, edges, units, FTS/gram candidates,
  exact-name lookup, embeddings, diagnostics, integrity, currentness) and
  integration tests for publish/read/search/incremental/foreign-db safety
2026-11-26 01:10:39 +08:00
2026-11-25 09:11:56 +08:00

marqdo-knowledge

Deterministic, offline knowledge compiler for Markdown and Marqdo documents.

marqdo-knowledge turns a directory of existing .md / .mq.md files into a single rebuildable SQLite projection: document structure, heading scopes, links, imports, function identities and static calls. It is a separate CLI tool dispatched by marqdo through the marqdo.cli-tool protocol; it never executes knowledge, never fetches documents from the network and never rewrites source files.

marqdo tool install ./dist/tool.json
cd my-knowledge
marqdo knowledge compile .
marqdo knowledge query '如何判断量子态是否合法' --kind function
marqdo knowledge query '概率归一化' --format markdown
marqdo knowledge check .

The only persistent artifact of normal use is .marqdo/knowledge.sqlite. It is derived, can be deleted at any time and is rebuilt from the Markdown sources. There is no project configuration file, no metadata sidecar, no node manifest and no separate knowledge IR file.

Status

This repository is an implementation in progress against the development specification marqdo-knowledge-development.md (kept outside this repository's source tree; the frozen contract is mirrored in spec/knowledge.md). See docs/STATUS.md for the exact, evidence-based state of each capability. Do not infer unimplemented behavior from design documents.

Building

cargo build --release --locked
cargo test --workspace --locked

The release candidate platform is Linux x86_64. The core CLI used for static analysis is an external dependency: this tool calls $MARQDO_BIN (or the explicit --marqdo-bin development override) with check ENTRY --emit PATH. Plain .md documents are parsed by this tool's own CommonMark/GFM projection; .mq.md documents always use the core CLI's current public Analysis contract (marqdo.analysis, revision 3).

Commands

marqdo knowledge compile [ROOT] [--exclude GLOB ...] [--rebuild] [--json]
marqdo knowledge check [ROOT] [--okf] [--json]
marqdo knowledge query QUERY [--root ROOT] [--exact] [--kind KIND] [--limit N]
    [--depth N] [--relation KIND ...] [--reverse] [--slice document|execution|hybrid]
    [--format markdown|json] [--snapshot] [--semantic]

See spec/knowledge.md for the contract and docs/architecture/OVERVIEW.md for the internal architecture.

License

Apache-2.0. See LICENSE-APACHE.

S
Description
No description provided
Readme
392 KiB
0 Stars 1 Watchers 0 Forks
Languages
Rust 94.2%
Python 4.8%
Shell 1%