@@ -5,6 +5,150 @@ All notable changes to the CodeGraph MCP Intelligence Platform will be documente
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 1.1.0] - 2025-11-18 - AutoAgents Integration & SurrealDB 2.x Compatibility
9+
10+ ### 🚀 ** Added - AutoAgents Framework Integration (Experimental)**
11+
12+ #### ** AutoAgents ReAct Pattern**
13+ - ** Replaced custom orchestrator** with AutoAgents framework (~ 1,200 lines removed)
14+ - ** Feature flag** : ` autoagents-experimental ` for opt-in testing
15+ - ** 6 inner graph analysis tools** for ReAct agent:
16+ - ` GetTransitiveDependencies ` , ` GetReverseDependencies ` , ` TraceCallChain `
17+ - ` DetectCycles ` , ` CalculateCoupling ` , ` GetHubNodes `
18+ - ** Tool call parsing** : Converts CodeGraph JSON format to AutoAgents ToolCall format
19+ - ** Maintains all 7 agentic MCP tools** : Full compatibility with existing API
20+ - ** Tier-aware prompting** : Preserved from legacy orchestrator
21+
22+ #### ** Semantic Chunking with Qwen2.5-Coder Tokenizer**
23+ - ** Ollama provider** : Added full semantic chunking support
24+ - ** Fallback mode** : Semantic chunking when embeddings feature disabled
25+ - ** Environment variables** :
26+ - ` CODEGRAPH_MAX_CHUNK_TOKENS=512 ` - Max tokens per chunk (default)
27+ - ` CODEGRAPH_CHUNK_OVERLAP_TOKENS=50 ` - Chunk overlap (reserved for future)
28+ - ** Token-accurate** : Uses Qwen2.5-Coder tokenizer for precise token counting
29+ - ** Chunk aggregation** : Multiple chunks averaged into single node embedding
30+ - ** Benefits** : Better embeddings for long functions/classes, preserves code structure
31+
32+ #### ** 768-Dimension Embedding Support**
33+ - ** Added support for embeddinggemma** and other 768-dim models
34+ - ** Complete pipeline** : Indexer, storage, HNSW indexes, vector search
35+ - ** New constant** : ` SURR_EMBEDDING_COLUMN_768 `
36+ - ** Schema** : HNSW index for ` embedding_768 ` column with EFC 200, M 16
37+ - ** Auto-detection** : Automatic column selection based on embedding dimension
38+
39+ #### ** File Location Requirements in Agent Outputs**
40+ - ** All EXPLORATORY prompts** now require file locations in responses
41+ - ** Format** : ` ComponentName in path/to/file.rs:line_number `
42+ - ** Example** : "ConfigLoader in src/config/loader.rs:42" instead of just "ConfigLoader"
43+ - ** 6 prompts updated** : code_search, dependency_analysis, call_chain, architecture, context_builder, semantic_question, api_surface
44+ - ** Enables** : Downstream agents can drill into specific files for detailed analysis
45+
46+ ### 🐛 ** Fixed - Critical Database Persistence Bugs**
47+
48+ #### ** Async Writer Flush Bugs**
49+ - ** file_metadata flush** : Added missing flush after ` persist_file_metadata() ` (line 1237)
50+ - ** Impact** : project_metadata and file_metadata tables remained empty
51+ - ** Root cause** : Metadata queued but never written before shutdown
52+ - ** symbol_embeddings flush** : Added flush after symbol embedding precomputation (line 979)
53+ - ** Impact** : symbol_embeddings table incomplete or empty
54+ - ** Root cause** : Embeddings queued but not flushed before edge resolution
55+ - ** embedding_model tracking** : Added to node metadata in ` annotate_node() `
56+ - ** Impact** : Nodes showed hardcoded 'jina-embeddings-v4' instead of actual model
57+ - ** Root cause** : embedding_model not added to metadata attributes
58+
59+ #### ** AutoAgents Runtime Fixes**
60+ - ** Tool call parsing** : Implemented ` tool_calls() ` method to extract ToolCall from CodeGraph JSON
61+ - ** Impact** : Agent was stopping at step 0, tools never executed
62+ - ** Root cause** : ` CodeGraphChatResponse::tool_calls() ` always returned None
63+ - ** Runtime panic** : Fixed "Cannot start a runtime from within a runtime"
64+ - ** Impact** : Tool execution crashed with panic
65+ - ** Root cause** : Using ` block_on ` directly in async context
66+ - ** Fix** : Wrapped in ` tokio::task::block_in_place ` at tool_executor_adapter.rs:38
67+ - ** Steps reporting** : Fixed ` steps_taken ` to show actual tool execution count
68+ - ** Impact** : Always showed "0" even when tools executed
69+ - ** Fix** : Extract count from ` ReActAgentOutput.tool_calls.len() `
70+ - ** Feature-gate warning** : Fixed unused ` ai_matches ` variable warning
71+ - ** Fix** : Added ` #[cfg(feature = "ai-enhanced")] ` to declaration and accumulation
72+
73+ ### 🐛 ** Fixed - SurrealDB 2.x Compatibility**
74+
75+ #### ** Record ID System Overhaul**
76+ - ** Removed manual id field definitions** from 3 tables (nodes, edges, symbol_embeddings)
77+ - ** Impact** : Defining ` id ` as string broke SurrealDB's built-in record ID system
78+ - ** Root cause** : SurrealDB 2.x ` id ` is always a record type, overriding with string breaks queries
79+ - ** Updated fn::node_info()** : Changed parameter type from ` string ` to ` record `
80+ - ** Added explicit record casting** to all 5 graph functions:
81+ - ` fn::node_reference() ` , ` fn::get_transitive_dependencies() ` , ` fn::trace_call_chain() `
82+ - ` fn::calculate_coupling_metrics() ` , ` fn::get_reverse_dependencies() `
83+ - ** Pattern** : ` LET $record = type::thing('nodes', $node_id); `
84+ - ** Ref** : https://surrealdb.com/docs/surrealql/datamodel/casting
85+ - ** Changed UPSERT queries** from ` CONTENT ` to ` SET ` :
86+ - ** Impact** : CONTENT $doc tried to overwrite id field with string → data corruption
87+ - ** Fix** : Explicit SET field list excludes id field
88+ - ** Applies to** : UPSERT_NODES_QUERY, UPSERT_EDGES_QUERY, UPSERT_SYMBOL_EMBEDDINGS_QUERY
89+
90+ #### ** Schema Syntax Corrections**
91+ - ** ASSERT statements** : Added ` $value = NONE OR ` for proper null handling
92+ - ** FLEXIBLE metadata** : Changed metadata fields to ` FLEXIBLE TYPE option<object> `
93+ - ** HNSW syntax** : Corrected index definitions for SurrealDB 2.3.10
94+ - ** Removed duplicate** : Eliminated duplicate ANALYZER definition
95+
96+ ### ⚡ ** Performance Improvements**
97+
98+ #### ** File Metadata Optimization (120x Faster)**
99+ - ** Optimized complexity** : O(N²) → O(N) using HashMaps
100+ - ** Before** : 2 minutes for 1,000 files (10M+ iterations)
101+ - ** After** : ~ 1 second for 1,000 files (15K iterations)
102+ - ** Pattern** : Pre-build lookup tables instead of nested iterations
103+ - ** Added progress bar** : Shows file-by-file processing status
104+
105+ #### ** Throughput Display Fixes**
106+ - ** Fixed duplicate units** : "21,970/s/s" → "21,970/s"
107+ - ** Root cause** : ` {per_sec} ` placeholder already includes "/s" suffix
108+ - ** Fixed 3 progress bars** : batch, enhanced, simple progress templates
109+
110+ ### 🗑️ ** Removed**
111+ - ** Dependency cleanup** : Removed 79 unused dependencies across 17 crates
112+ - ** Tool** : cargo machete for detection
113+ - ** Impact** : Faster compilation, smaller binaries
114+ - ** Broken schema files** : Deleted 6 individual function files in ` schema/functions/ `
115+ - ** calculate_coupling_metrics.surql** : Syntax error with orphaned code
116+ - ** detect_circular_dependencies.surql** : Wrong function name (fn::coupling_metrics)
117+ - ** get_hub_nodes.surql** : Wrong function signature
118+ - ** get_reverse_dependencies.surql, get_transitive_dependencies.surql, trace_call_chain.surql** : Incomplete implementations
119+ - ** Impact** : Conflicted with correct implementations in codegraph.surql
120+
121+ ### ⚠️ ** Breaking Changes**
122+
123+ #### ** SurrealDB Schema Migration Required**
124+ - ** Record ID system change** : Manual ` id ` field definitions removed
125+ - ** Migration steps** :
126+ 1 . Re-apply schema: ` cd schema && ./apply-schema.sh `
127+ 2 . Re-index codebase: ` codegraph index -l rust -r --force . `
128+ - ** Reason** : Compatibility with SurrealDB 2.x record ID handling
129+ - ** Impact** : Existing data incompatible, full re-index required
130+
131+ #### ** AutoAgents Feature Flag**
132+ - ** Default** : Uses legacy orchestrator (stable)
133+ - ** Experimental** : Use ` autoagents-experimental ` feature for new framework
134+ - ** Build** : ` cargo build --features "autoagents-experimental,ai-enhanced,faiss,ollama" `
135+ - ** Status** : Testing in progress, production-ready in v1.2.0
136+
137+ ### 📝 ** Changed**
138+
139+ #### ** Environment Variables**
140+ - ** Unified chunking** : ` CODEGRAPH_MAX_CHUNK_TOKENS ` now works across all providers
141+ - ** Ollama support** : Ollama provider now respects chunking configuration
142+ - ** Jina unchanged** : Still uses ` JINA_MAX_TOKENS ` (provider-specific)
143+
144+ ### 📚 ** Documentation**
145+ - ** GraphFunctions enrichment plan** : Comprehensive plan saved to ` .ouroboros/plans/graphfunctions-enrichment-20251118.md `
146+ - Schema alignment recommendations
147+ - Missing field identification (qualified_name, column positions, timestamps)
148+ - Implementation phases with SQL examples
149+
150+ ---
151+
8152## [ Unreleased] - 2025-01-08 - Agentic Code Intelligence & Architecture Migration
9153
10154### 🚀 ** Added - Agentic MCP Tools (AI-Enhanced Feature)**
0 commit comments