Add Phase 4 knowledge graph: nodes, cells, facts, edges, gRPC service

Build the knowledge graph pillar with the kg package:
- Node: hierarchical notes with parent/children, C2 wiki-style naming,
  shared tag/category pool with artifacts
- Cell: content units (markdown, code, plain) with ordinal ordering
- Fact: EAV tuples with transaction timestamps and retraction support
- Edge: directed graph links (child, parent, related, artifact_link)

Includes schema migration (002_knowledge_graph.sql), protobuf definitions
(kg.proto), full gRPC KnowledgeGraphService implementation, CLI commands
(node create/get), and comprehensive test coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 10:05:43 -07:00
parent a336dc1ebb
commit 051a85d846
14 changed files with 3283 additions and 6 deletions

View File

@@ -71,6 +71,7 @@ func main() {
grpcServer := grpc.NewServer()
pb.RegisterArtifactServiceServer(grpcServer, server.NewArtifactServer(database, blobStore))
pb.RegisterKnowledgeGraphServiceServer(grpcServer, server.NewKGServer(database))
// Graceful shutdown on SIGINT/SIGTERM.
sigCh := make(chan os.Signal, 1)