Key changes: new events.rs (NATS EventingStorage decorator), storage/factory.rs (backend selection), orchestration.rs, SurrealDB v3 engine upgrade, expanded Nickel schemas, and two new ADRs (006, 007).
19 KiB
19 KiB
Changelog
All notable changes to the Knowledge Base project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]
Added
SurrealDB 3.0 — Config-Driven Engine Abstraction (surrealdb-backend feature)
SurrealEngineConfigtagged enum (mem,surreal_kv,rocks_db,ws) selects the engine at runtime viasurrealdb::engine::any::connect(url)URL dispatch — no recompilation required to change backends.SurrealDbBackendConfigdual hot/cold layout:graphengine (default: SurrealKV B-tree) for nodes/edges/metadata,hotengine (default: RocksDB LSM) for embeddings and session logs.SurrealDbStorage::from_config()constructor replaces ad-hoc field initialization;Surreal<Any>unified type — no generics, noArc<RwLock<>>.- All SurrealDB CRUD routes through
serde_json::Value(to_json/from_jsonhelpers) to satisfy theSurrealValuetrait bound without coupling domain models to the database library. SurrealDbStorage::save_embedding()andlog_session()for hot-engine direct access.- Removed
Database(#[from] surrealdb::Error)variant fromKbError— all SurrealDB errors propagate asKbError::Storage(e.to_string()). surrealdb-backendCargo feature activateskv-surrealkv,kv-rocksdb,protocol-ws,rustlsengine features on top of the workspacekv-membase.
Storage Factory (storage::factory)
storage::factory::build(config, base_path)— config-driven engine dispatch: SurrealDB whensecondary.enabled,MemoryStoragewhenprimary == memory,FilesystemStorageotherwise. Zero recompilation to switch backends.storage::factory::build_eventing(config, base_path, default_graph)— builds the base backend then wraps it withEventingStoragewhenconfig.natsisSome; falls through tobuildwhen NATS is not configured (nats-eventsfeature required).impl Storage for Box<dyn Storage>— blanket delegation impl enablingEventingStorage<Box<dyn Storage>>without knowing the concrete backend type at compile time.
NATS JetStream Event Publishing (nats-events feature)
KogralEventtyped enum (NodeSaved,NodeDeleted,GraphSaved) with computed NATS subject (kogral.{graph}.node.saved, etc.) andserdeJSON serialization.EventPublisherwrapsplatform_nats::EventStreamand publishesKogralEventas JSON to JetStream after each mutation.EventingStorage<S>decorator wraps anyStorageimplementation with automatic event publishing aftersave_graph,save_node, anddelete_node— inner backend unchanged.NatsEventConfigschema type withFromconversion toplatform_nats::NatsConfig.nats-eventsfeature addsplatform-natsandbytesworkspace dependencies.
Orchestration Integration (orchestration feature)
orchestration::pipeline_context_from_event(event, payload, state, schema_dir)bridgesKogralEventtostratum-orchestrator'sPipelineContext::newfor downstream pipeline triggering.orchestrationfeature activatesstratum-orchestratorandstratum-stateworkspace deps; impliesnats-events.
Nickel Config Schema Updates
secondary.surrealdbsub-record replaces flaturl/namespace/databasefields:graphandhotengine selectors withengine,path/urlfields per engine type.natstop-level block inStorageConfigfor optional JetStream configuration.SurrealEngineValidatorcontract andSurrealEngineConfig/SurrealDbBackendConfig/NatsEventConfigtype contracts added toschemas/kogral/contracts.ncl.schemas/kogral/defaults.nclupdated with dual-engine defaults andnatsdisabled block.
Nickel Import Resolver
config::nickel::resolve_nickel_imports(path)runsncl-import-resolveronresolver-manifest.json(when present) beforenickel export. No-op when manifest absent.
Changed
BREAKING: MCP Protocol Rebranding
- All MCP URIs, tool names, and prompts updated to KOGRAL namespace
-
URI Scheme:
kb://→kogral://kb://project/notes→kogral://project/noteskb://project/decisions→kogral://project/decisionskb://project/guidelines→kogral://project/guidelineskb://project/patterns→kogral://project/patternskb://shared/guidelines→kogral://shared/guidelineskb://shared/patterns→kogral://shared/patterns
-
Tool Names:
kb/*→kogral/*kb/search→kogral/searchkb/add_note→kogral/add_notekb/add_decision→kogral/add_decisionkb/link→kogral/linkkb/get_guidelines→kogral/get_guidelineskb/list_graphs→kogral/list_graphskb/export→kogral/exportkb/find_blocks→kogral/find_blockskb/find_todos→kogral/find_todoskb/find_cards→kogral/find_cards
-
Prompt Names:
kb/*→kogral/*kb/summarize_project→kogral/summarize_projectkb/find_related→kogral/find_related
-
Server Name:
kb-mcp→kogral-mcp -
Migration Required: Users must update
~/.config/claude/config.json:{ "mcpServers": { - "kb-mcp": { - "command": "/path/to/kb-mcp", + "kogral-mcp": { + "command": "/path/to/kogral-mcp", - "env": { "KB_DIR": "/path/to/.kb" } + "env": { "KOGRAL_DIR": "/path/to/.kogral" } } } } -
Rationale: Complete branding consistency across all interfaces. Pre-release status (v0.x) allows breaking changes without user pain.
-
Files updated:
crates/kb-mcp/src/resources.rs: All URI definitions and parsingcrates/kb-mcp/src/tools.rs: All tool name definitions and dispatchcrates/kb-mcp/src/prompts.rs: All prompt name definitions and dispatchcrates/kb-mcp/src/main.rs: Server name registrationcrates/kb-mcp/tests/integration_test.rs: Test assertions updateddocs/apps/mcp-quickguide.md: All examples and referencesdocs/kogral/core-concepts.md: MCP protocol documentationdocs/api/mcp-tools.md: API reference documentationREADME.md: MCP integration examples
-
Branding
- Rebranded to KOGRAL (KOwledge GRAphs, Local-first)
- Updated project name from "Knowledge Base" to "KOGRAL" across all documentation
- New tagline: "Git-native knowledge graphs for developer teams"
- Updated description emphasizing structured knowledge management for developers
- Documentation folder renamed:
docs/kb/→docs/kogral/ - Documentation files renamed:
docs/kogral/what-is-kb.md→what-is-kogral.mddocs/kogral/why-kb.md→why-kogral.md
- Technical names maintained for compatibility:
kb-core,kb-cli,kb-mcp(crate names),kb(CLI binary) - Hybrid naming strategy: KOGRAL as primary brand,
kb.vapora.devas future alias - Files updated:
README.md: Title, description, and brandingCargo.toml(workspace): Homepage, description, repository metadatacrates/kb-core/Cargo.toml: Package descriptioncrates/kb-cli/Cargo.toml: Package descriptioncrates/kb-mcp/Cargo.toml: Package descriptioncrates/kb-core/src/lib.rs: Module documentation commentscrates/kb-core/src/models.rs: Type documentation commentscrates/kb-cli/src/main.rs: CLI description and messagesdocs/kogral/what-is-kogral.md: Full KOGRAL branding with acronym explanationdocs/kogral/core-concepts.md: All "KB" references replaced with "KOGRAL"docs/README.md: Title and section headersdocs/book.toml: mdBook title and descriptiondocs/SUMMARY.md: Navigation titles.claude/CLAUDE.md: Project description and documentation links
BREAKING: Filesystem Paths and Environment Variables
- Directory structure renamed from
.kb/to.kogral/- Project directory:
.kb/→.kogral/ - Shared directory:
.kb-shared/→.kogral-shared/ - Configuration paths updated throughout codebase
- All storage paths use
.kogral/prefix
- Project directory:
- Environment variable renamed from
KB_DIRtoKOGRAL_DIR- MCP server configuration requires
KOGRAL_DIRenvironment variable - CLI tools respect
KOGRAL_DIRfor custom directory location
- MCP server configuration requires
- Migration Required:
- Rename existing directory:
mv .kb .kogral - Update environment variables:
KB_DIR→KOGRAL_DIR - Update config files referencing
.kb/paths
- Rename existing directory:
- Rationale: Complete branding consistency across all filesystem operations. Pre-release status allows breaking changes.
- Files updated:
- All Rust source files in
crates/: Path constants and variable names crates/kb-core/src/config/loader.rs: Configuration path discoverycrates/kb-core/src/storage/filesystem.rs: Storage pathscrates/kb-cli/src/main.rs: CLI messages and examplescrates/kb-mcp/src/main.rs: Environment variable handling- All documentation in
docs/: Examples and instructions README.md: Setup and usage examples.claude/CLAUDE.md: Project configuration paths
- All Rust source files in
Added
Core Infrastructure
- Initial project structure with Cargo workspace (kb-core, kb-cli, kb-mcp)
- Core graph models (Node, Edge, Graph) with 6 node types and 6 relationship types
- Config-driven architecture using Nickel schemas (NCL → JSON → Rust)
- Markdown parser with Logseq compatibility (YAML frontmatter + wikilinks)
- Storage backends: Filesystem (default), In-Memory, SurrealDB (feature-gated)
- Embedding integration via rig-core (OpenAI, Claude, Ollama) + fastembed local fallback
- Tera template engine for document generation and export
Logseq Blocks Support (ADR-004)
- Block Data Structures (
crates/kb-core/src/models.rs):TaskStatusenum: TODO, DOING, DONE, LATER, NOW, WAITING, CANCELLEDBlockPropertiesstruct: tags, task status, custom properties, block/page referencesBlockstruct: hierarchical content blocks with properties and childrenNode.blocksfield: Optional cached block structure (lazy parsing)
- BlockParser (
crates/kb-core/src/block_parser.rs):- Bidirectional parser: Markdown outliner ↔ Block structures
- Supports: task markers, #tags, custom properties (key:: value), ((block-refs)), page-refs
- Hierarchical parsing based on indentation
- Round-trip fidelity for Logseq import/export
- 15 comprehensive tests covering parsing, serialization, and round-trips
- Block Query API:
Node::get_blocks(): Lazy parsing from content with cachingNode::find_blocks_by_tag(): Find blocks with specific tagNode::find_all_todos(): Find all task blocksNode::find_blocks_by_status(): Find blocks by task statusNode::find_blocks_by_property(): Find blocks with custom propertyGraph::find_blocks_by_tag(): Search blocks across all nodesGraph::find_all_todos(): Find TODOs across entire graph- 6 integration tests for Node and Graph block queries
- SurrealDB Schema (
schemas/surrealdb/blocks.surql):blocktable with indexes on node_id, block_id, tags, status, parent_id- Full-text search index on content
- Support for hierarchical queries and tag-based filtering
- Migration queries and example usage patterns
- Logseq Import/Export (
crates/kb-core/src/import/logseq.rs,crates/kb-core/src/export/logseq.rs):- Round-trip import: Logseq markdown → KB Node with blocks
- Property parsing: key:: value format, tags (tag and #tag), references, timestamps
- Export to Logseq page/journal formats with block serialization
- 12 comprehensive tests covering import/export round-trips
- MCP Block Tools (
crates/kb-mcp/src/tools.rs):kb/find_blocks: Search blocks by tag, task status, or custom propertykb/find_todos: Find all TODO blocks across KBkb/find_cards: Find all flashcard blocks (#card tag)- Fixed borrowing issues with two-phase data collection pattern
- Configuration Schema (
schemas/kb-config.ncl,config/*.ncl):- Added
BlocksConfigschema with 4 settings:enabled: Enable/disable Logseq blocks parsing (default: false, opt-in)parse_on_import: Auto-parse blocks from Logseq imports (default: true)serialize_on_export: Serialize blocks to outliner format on export (default: true)enable_mcp_tools: Enable block-related MCP tools (default: true)
- Updated all config files (defaults.ncl, production.ncl, minimal.ncl)
- Validated: All configs export to JSON successfully
- Added
- Documentation:
- Complete technical design:
docs/architecture/logseq-blocks-design.md - Architectural Decision Record:
docs/architecture/adrs/004-logseq-blocks-support.md - 6-phase implementation plan documented
- Use cases and examples for flashcards, task tracking, and block references
- Complete technical design:
Applications
- CLI tool (kb-cli) with 13 commands (init, add, search, link, sync, serve, etc.)
- MCP server (kb-mcp) with 10 tools (7 core + 3 block tools), 6 resources, 2 prompts for Claude Code integration
- NuShell maintenance scripts (6 scripts: sync, backup, reindex, import/export Logseq, stats)
Configuration System (Nickel)
- Complete Nickel configuration schema following typedialog/provisioning pattern
- Schema contracts (
schemas/kb/contracts.ncl) - Type definitions with validation - Default values (
schemas/kb/defaults.ncl) - Base configuration values - Composition helpers (
schemas/kb/helpers.ncl) - merge_with_override, compose_config - Mode overlays (
schemas/kb/modes/{dev,prod,test}.ncl) - Environment-specific tuning - Runtime configurations (
.kb-config/core/kb.ncl,.kb-config/platform/*.ncl) - Double validation pattern: Nickel contracts + serde deserialization
- Config export to JSON for Rust consumption (
.kb-config/targets/*.json)
Templates
- Tera templates for 6 document types (note, decision, guideline, pattern, journal, execution)
- 4 export format templates (Logseq page/journal, summary, JSON)
- Customizable template system with frontmatter generation
Documentation (mdBook)
- Complete mdBook documentation structure with SUMMARY.md navigation
- 4 SVG diagrams for visual guides:
architecture-overview.svg- Complete system architecturecore-concepts.svg- Node types and relationshipsconfig-composition.svg- Configuration flow (Schema → Defaults → Mode → User → JSON)storage-architecture.svg- Hybrid storage strategy
- 11 major documentation sections (kb/, guides/, architecture/, setup/, config/, storage/, ai/, templates/, cli/, apps/, api/, contributing/)
- ADR documentation (ADR-001: Nickel vs TOML, ADR-002: FastEmbed + AI providers, ADR-003: Hybrid storage)
- Use cases documentation (8 real-world scenarios)
- MCP quick guide (5-minute setup for Claude Code)
- Config-driven architecture deep dive
- Storage architecture deep dive with code examples
- docs/README.md - Comprehensive guide for using and building documentation
Build System
- Modular justfile system (7 modules: build, test, dev, ci, nickel, docs, scripts)
- Nickel validation and export recipes (
just nickel::validate-all,just nickel::export-all) - mdBook documentation recipes (
just docs::serve,just docs::build,just docs::test) - CI/CD pipeline recipes (format, lint, test, build validation)
- NuShell script validation and execution recipes
Project Documentation
- Enhanced README.md with complete documentation links and visual diagram references
- Directory structure documentation with detailed explanations
- Quick start guide with MCP integration
- Integration guides (Vapora, Logseq, Claude Code)
- CHANGELOG.md following Keep a Changelog format
Changed
- Updated README.md with comprehensive documentation links (mdBook, guides, architecture, config)
- Enhanced directory structure documentation with .kb-config/ and schemas/kb/ details
- Improved documentation section with visual diagrams and just recipe references
- Blocks Feature Documentation:
- README.md: Added Logseq blocks section with examples, features, and configuration
- README.md: Updated architecture diagram to include BlockParser
- README.md: Added 3 new MCP tools to integration section
- docs/kb/core-concepts.md: Added comprehensive "Logseq Content Blocks" section with examples, use cases, and queries
- docs/api/mcp-tools.md: Added "Block Tools" section documenting kb/find_blocks, kb/find_todos, kb/find_cards
- docs/api/mcp-tools.md: Updated overview from 7 to 10 tools
Infrastructure
- Cargo workspace with 3 crates
- Feature flags:
filesystem(default),surrealdb,fastembed,full - 90 tests across workspace (81 kb-core + 5 kb-mcp + 4 kb-cli)
- 15 tests for block parser
- 12 tests for Logseq import/export
- 6 tests for block queries
- mdBook integration for documentation (serves on http://localhost:3000)
- Nickel → JSON → Rust configuration pipeline
- Justfile modules: build, test, dev, ci, nickel, docs, scripts
- CI/CD pipeline recipes (format, lint, test, build validation)
- mdBook documentation structure with SUMMARY.md
- NuShell script validation recipes
[1.0.0] - TBD
Initial release (planned).
Planned Features
- Full FilesystemStorage implementation with file watching
- Complete Query Engine with semantic search
- Guideline inheritance resolution (shared → local override priority)
- SurrealDB schema and complete backend implementation
- Sync mechanism: bidirectional Filesystem ↔ SurrealDB
- FastEmbed local embeddings integration
- API provider integrations (OpenAI, Claude, Ollama) for embeddings
- Cross-graph queries (project + shared knowledge bases)
- Template customization system
- Export to multiple formats (Logseq, JSON, Markdown)
- Import from Logseq graphs
- MCP protocol compliance testing
- Production-ready CLI tool
- Performance benchmarks
- Security audit
Version History
Version Numbering
This project follows semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: Incompatible API changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
Release Schedule
- Alpha (0.x.x): API unstable, features incomplete
- Beta (1.0.0-beta.x): API stable, features complete, testing phase
- Stable (1.0.0+): Production ready
Feature Roadmap
Phase 1: Foundation ✅ (Completed)
- Core models and graph structure
- Nickel configuration system
- Markdown parser with Logseq compatibility
- Storage trait abstraction
- CLI structure with clap
- MCP server protocol implementation
- NuShell maintenance scripts
- Documentation structure
Phase 2: Integration (In Progress)
- Full FilesystemStorage with file watching
- SurrealDB backend implementation
- Query engine with text + semantic search
- Embedding provider integrations
- Guideline inheritance resolution
- Sync mechanism implementation
Phase 3: Polish (Planned)
- Performance optimization
- Comprehensive error handling
- Production testing
- Security audit
- API stabilization
- Release preparation
Migration Guides
Upgrading from 0.x to 1.0
(To be documented when 1.0 is released)
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
(To be determined)