Ontology-driven knowledge system for fact-traceable maintenance of training content.
- Repo: /Users/roy/Projects/kanon
- Language: Python 3.11+
- Venv: .venv (activate with
.venv/bin/python) - Entry point:
kanonCLI (installed viapip install -e .) - Planning docs (source of truth):
/Library/Mobile Documents/iCloudmd~obsidian/Documents/Brain II/Projects/Kanon/
.venv/bin/python -m pytest tests/ -q # all tests (197)
.venv/bin/python -m pytest tests/test_validation.py -v # validation suite (20)
.venv/bin/kanon graph # browse knowledge graph
.venv/bin/kanon generate --type setup_guide --concepts tool_use --audience enterprise_developer --dry-run
.venv/bin/kanon generate --type setup_guide --concepts tool_use --audience enterprise_developer
.venv/bin/kanon drift --evidence anthropic_tool_use_docs --change "API format changed"
.venv/bin/kanon review # hard failure conditions on all assets
.venv/bin/kanon crawl # fetch evidence URLs, detect changes
.venv/bin/kanon ingest --file doc.txt --source "Name" --save # decompose text into entitieskanon/models/entities.py— Pydantic entity definitions (Concept, Fact, Evidence, Asset, etc.)kanon/graph.py— KnowledgeGraph with forward/reverse indexes, BFS traversalkanon/generate.py— dry-run + LLM asset generation from knowledge graph contextkanon/citations.py— {{fact:ID}} citation extraction, validation, strippingkanon/citation_report.py— markdown + HTML citation reportskanon/review.py— hard failure conditions, approve/reject lifecycle actionskanon/crawl.py— evidence URL fetching, HTML stripping, baseline diffingkanon/ingest.py— LLM decomposition of unstructured text into ontology entitieskanon/confidence.py— scoring engine (evidence, freshness, structural, transformation)kanon/drift.py— detect evidence changes, trace impact to facts and assetskanon/auth.py— Anthropic API auth (OAuth from ~/.pi/agent/auth.json or ANTHROPIC_API_KEY)kanon/cli.py— Click CLIkanon/visualize.py— HTML graph visualizationdata/— YAML knowledge graph (concepts, facts, evidence, tasks, audiences, assets)kanon/templates/— asset templates (setup_guide, facilitator_guide)
- Tests first. Run all tests before and after changes. Never commit with failing tests.
- Commit as you go. Each logical change gets its own commit with a descriptive message.
- Git signing may fail. Use
git -c commit.gpgsign=false commitif 1Password agent errors. - LLM generation constraint. Generated assets use ONLY knowledge graph content. No LLM supplementation. See docs/raw/llm-generation-constraints.md.
- OAuth for Claude API. OAuth tokens require Claude Code identity prefix in system prompt for Sonnet/Opus models. See kanon/auth.py.
- All 6 experiments complete, merged to main
- 197 tests (192 unit + 5 LLM), all passing
- See VALIDATION.md for PoC results, EXPERIMENT_FRAMEWORK.md in Obsidian for full experiment findings
Two knowledge graph domains exist:
- Claude/AI training — in
data/(7 concepts, 8 facts, 4 evidence sources) - Food/recipe — in test fixtures only (
tests/test_validation.py::FOOD_ENTITIES)