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

  1. Content Digest (content_sha256): Every public Markdown page and referenced raw/ artifact is hashed over its exact UTF-8 byte stream.
  2. Tarjan SCC Condensation: Because wiki concept and entity pages legitimately form mutual cross-reference cycles, compute_merkle_dag_hashes condenses the dependency graph (source_pages plus depends-on, derived-from, extends, supports, compares) into Strongly Connected Components in time.
  3. Transitive Epistemic Merkle Digest (merkle_sha256): Each SCC is hashed in reverse topological order, combining self digests, raw/ file digests, and upstream merkle_sha256 values.
  4. Dirty-Propagation Wavefronts (plan_incremental_rebuild): On incremental builds, unchanged PageIR nodes are reused from wiki/catalog.json v3 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.