Incremental Merkle Compilation
Incremental Merkle Compilation models an interlinked Markdown knowledge base as a content-addressed dependency graph analogous to incremental software build systems (such as Bazel or Salsa).
depends-on veriwiki-architecture extends llm-wiki
Mechanism
- Content Digest (
content_sha256): Every public Markdown page and referencedraw/artifact is hashed over its exact UTF-8 byte stream. - Tarjan SCC Condensation: Because wiki concept and entity pages legitimately form mutual cross-reference cycles,
compute_merkle_dag_hashescondenses the dependency graph (source_pagesplusdepends-on,derived-from,extends,supports,compares) into Strongly Connected Components in time. - Transitive Epistemic Merkle Digest (
merkle_sha256): Each SCC is hashed in reverse topological order, combining self digests,raw/file digests, and upstreammerkle_sha256values. - Dirty-Propagation Wavefronts (
plan_incremental_rebuild): On incremental builds, unchangedPageIRnodes are reused fromwiki/catalog.jsonv3 without re-parsing Markdown bodies, while upstream changes emit ordered topological rebuild wavefronts (Wave 1,Wave 2, …) and flag downstream temporal lag (lag_days > drift_lag_days).
Compact Catalog v3 Normalization
- EXTRACTED: Normalized Compact Catalog v3 stores structured metadata, section SHA-256 spans, extracted claims, typed edges, and capped per-field term frequency maps (
t,g,h,c,b) instead of duplicating raw page bodies multiple times, cutting index size by roughly 85–90% while preserving exact BM25F scoring.
Counterpoints and Gaps
- INFERRED: Capping body term maps at the top 260 distinct non-stopword stems per page negligibly affects top-K retrieval precision on standard technical notes, though ultra-long 25,000-word notebooks rely on live disk re-reading during Stage 3 section selection for tail terms.