feat(knowledge): add knowledge graph for expertise capture and reuse (#3596)
* feat(knowledge): add knowledge graph for expertise capture and reuse
SQLite-backed knowledge graph system for consulting firms to capture,
organize, and reuse architecture decisions, solution patterns, lessons
learned, and expert matching across client engagements.
- KnowledgeGraph (src/memory/knowledge_graph.rs): node CRUD, edge
creation, FTS5 full-text search, tag filtering, subgraph traversal,
expert ranking by authored contributions, graph statistics
- KnowledgeTool (src/tools/knowledge_tool.rs): Tool trait impl with
capture, search, relate, suggest, expert_find, lessons_extract, and
graph_stats actions
- KnowledgeConfig (src/config/schema.rs): disabled by default,
configurable db_path/max_nodes, cross_workspace_search off by default
for client data isolation
- Wired into tools factory (conditional on config.knowledge.enabled)
20 unit tests covering node CRUD, edge creation, search ranking,
subgraph queries, expert ranking, and tool actions.
* fix: address CodeRabbit review findings
- Fix UTF-8 truncation panic in truncate_str by using char-based
iteration instead of byte indexing
- Add config validation for knowledge.max_nodes > 0
- Add subgraph depth boundary validation (must be > 0, capped at 100)
* fix(knowledge): address remaining CodeRabbit review issues
- MAJOR: Add db_path non-empty validation in Config::validate()
- MAJOR: Reject tags containing commas in add_node (comma is separator)
- MAJOR: Fix subgraph depth boundary (0..depth instead of 0..=depth)
- MAJOR: Apply project and node_type filters consistently in both
tag-only and similarity search paths
* fix: correct subgraph traversal test assertion and sync CI workflows