zeroclaw/src/peripherals
Giulio V 61de3d5648
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
2026-03-17 01:11:29 -04:00
..
arduino_flash.rs refactor: update firmware path references to match directory renames 2026-03-09 23:49:20 -04:00
arduino_upload.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
capabilities_tool.rs Ehu shubham shaw contribution --> Hardware support (#306) 2026-02-16 11:40:10 -05:00
mod.rs feat(knowledge): add knowledge graph for expertise capture and reuse (#3596) 2026-03-17 01:11:29 -04:00
nucleo_flash.rs refactor: update firmware path references to match directory renames 2026-03-09 23:49:20 -04:00
rpi.rs fix: resolve unused import warnings in channels and peripherals 2026-03-07 09:34:46 -05:00
serial.rs fix(build): unblock strict 32-bit no-default-features builds (#3375) 2026-03-13 15:45:03 -04:00
traits.rs docs(code): expand doc comments on security, observability, runtime, and peripheral traits 2026-02-19 13:19:46 -08:00
uno_q_bridge.rs refactor: update firmware path references to match directory renames 2026-03-09 23:49:20 -04:00
uno_q_setup.rs refactor: update firmware path references to match directory renames 2026-03-09 23:49:20 -04:00