Skip to content

feat(llm-wiki): source verification, knowledge graph analysis, and keyword search (#888, #889, #890) - #892

Merged
tommy-ca merged 1 commit into
mainfrom
feat/llm-wiki-engine-parity
Oct 31, 2026
Merged

tommy-ca merged 1 commit into
mainfrom
feat/llm-wiki-engine-parity

Conversation

@tommy-ca

Copy link
Copy Markdown
Owner

Summary

Closes #888, closes #889, closes #890. Part of Epic #887.

Provides pure Python standard library implementations for reference engine parity:

  1. Source Hash Verification ([LLM-Wiki-v3][P0] Source hash verification: tamper detection against append-only log #888):
    • Implemented verify_sources(wiki_dir) in scripts/llm_wiki.py.
    • Computes SHA-256 for all raw sources in .llm-wiki/raw/sources/ and validates against .llm-wiki/log.md digests.
    • Detects tampered, missing, or unlogged raw sources.
    • Added verify-sources CLI command and --sources flag to check.
  2. Knowledge Graph Analysis ([LLM-Wiki-v3][P1] Knowledge graph analysis: directed cross-reference extraction and orphan detection #889):
    • Implemented build_knowledge_graph(wiki_dir) in scripts/llm_wiki.py.
    • Resolves markdown cross-references within wiki/, calculates inbound/outbound links, graph density, and detects orphan articles.
    • Added graph CLI command supporting --json and --orphans-only.
  3. In-Memory Search Engine ([LLM-Wiki-v3][P1] Headless keyword search: fast multi-field query engine in pure Python stdlib #890):
    • Implemented search_wiki(wiki_dir, query) in scripts/llm_wiki.py.
    • Multi-term scoring matching title, headings, and body snippets without external dependencies.
    • Added search CLI command supporting --json.
  4. Comprehensive Test Suite:
    • 30 tests in tests/test_llm_wiki.py and tests/test_llm_wiki_safety.py covering positive paths, tamper detection, link isolation, and subprocess CLI contracts.

…is, and keyword search (#888, #889, #890)

- Add verify_sources to check all raw sources against log.md SHA-256 digests.
- Add build_knowledge_graph to extract cross-references and identify orphan pages.
- Add search_wiki for fast multi-field query matching across titles and bodies.
- Wire verify-sources, graph, and search CLI subcommands with JSON output options.
- Add unit, negative, and tamper safety tests for all new capabilities.
@tommy-ca
tommy-ca merged commit 40a1e27 into main Oct 31, 2026
1 check passed
@tommy-ca
tommy-ca deleted the feat/llm-wiki-engine-parity branch October 31, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant