Repository navigation
Description
Context
Issue #470 completed 90% of the SurrealDB migration, but some advanced features require complex SurrealDB implementations that are temporarily stubbed out with graceful degradation.
This issue tracks implementing the remaining 10% of advanced features properly in SurrealDB.
What's Working (90%)
✅ Core CRUD operations
✅ Node creation, reading, updating, deletion
✅ Hierarchy operations (parent-child, move, reorder)
✅ Mentions and relationships
✅ Schema management
✅ Basic querying and filtering
✅ Property updates
What Needs Implementation (10%)
1. Version-Checked Operations
Current: Updates ignore version checks (optimistic locking disabled)
Needed: Implement conditional updates based on version field in SurrealDB
// NodeService::update_node_with_version_check
// Currently: Falls back to regular update without version check
// Should: Only update if version matches (optimistic locking)2. Embedding Staleness Tracking
Current: No-op (embeddings regenerated on next batch)
Needed: Track which nodes need embedding regeneration after content changes
// NodeService methods affected:
// - mark_embedding_stale()
// - get_nodes_with_stale_embeddings()3. Complex Query Operations
Current: Simplified or stubbed
Needed: Implement SurrealDB equivalents for:
- Queries with mention joins
- Embedding staleness filtering
- Complex multi-table operations
4. Embedding Services Integration
Current: Embedding generation/updates temporarily disabled
Needed: Full integration with SurrealStore
embedding_service.rs- Uses DatabaseService (needs SurrealStore)embedding_processor.rs- Uses DatabaseService (needs SurrealStore)
Acceptance Criteria
- Version-checked updates implemented with optimistic locking
- Embedding staleness tracking working
- Complex queries migrated to SurrealDB syntax
- Embedding services fully integrated with SurrealStore
- All
tracing::warnTODO messages removed - Full test coverage for advanced features
- Zero performance regressions
Implementation Notes
SurrealDB Features to Use:
- Conditional updates:
UPDATE ... WHERE version = $expected_version - Transactions for atomicity
- Graph relations for complex queries
- Native JSON operations for property filtering
Testing:
- Add integration tests for version conflicts
- Test embedding staleness workflow end-to-end
- Performance benchmarks for complex queries
Related Issues
- Remove NodeStore abstraction, use SurrealDB directly #470: Complete SurrealDB migration (base implementation)
- SurrealDB Migration - Hybrid Architecture (Desktop-Only) #461: Epic - SurrealDB Migration (original architecture)
- SurrealDB Feasibility PoC - Quick Evaluation #460: SurrealDB PoC (performance validation)
Priority
Medium - Core functionality works, these are optimizations and advanced features. Can be implemented incrementally as needed.
Note: This is technical debt from the incomplete Epic #461 migration, now being addressed systematically.
Activity
WIP: Complete SurrealDB migration - Phase 1 (nodespace-core lib compi…
Complete SurrealDB migration - Fix all test files and desktop-app ini…
Fix: Temporarily disable embedding endpoints during migration
WIP: Fix 24 SurrealDB migration tests - Phase 3 complete (451/455 pas…
WIP: Fix 4 remaining SurrealDB migration tests - Phase 3 complete (45…
WIP: Complete SurrealDB migration - Phase 1 (nodespace-core lib compi…
Complete SurrealDB migration - Fix all test files and desktop-app ini…
Fix: Temporarily disable embedding endpoints during migration
WIP: Fix 24 SurrealDB migration tests - Phase 3 complete (451/455 pas…
WIP: Fix 4 remaining SurrealDB migration tests - Phase 3 complete (45…
Address code review feedback from PR #485
malibio commentedon Nov 13, 2025
Test Baseline ():
✅ 764 tests passing
⏭️ 26 tests skipped (database mode tests - in-memory baseline)
Test Distribution:
No test failures detected - Clean baseline for issue #481 implementation.
Starting work on completing SurrealDB migration advanced features.
23 remaining items
WIP: Fix 24 SurrealDB migration tests - Phase 3 complete (451/455 pas…
WIP: Fix 4 remaining SurrealDB migration tests - Phase 3 complete (45…
Address code review feedback from PR #485
Complete SurrealDB migration - Advanced features (#487)
Re-enable NLP Integration for Vector Embeddings (#491)
Root-Aggregate Embedding Architecture for Semantic Search (#734)
WIP: Complete SurrealDB migration - Phase 1 (nodespace-core lib compi…
Complete SurrealDB migration - Fix all test files and desktop-app ini…
Fix: Temporarily disable embedding endpoints during migration
WIP: Fix 24 SurrealDB migration tests - Phase 3 complete (451/455 pas…
WIP: Fix 4 remaining SurrealDB migration tests - Phase 3 complete (45…
Address code review feedback from PR #485
Complete SurrealDB migration - Advanced features (#487)
Re-enable NLP Integration for Vector Embeddings (#491)
Root-Aggregate Embedding Architecture for Semantic Search (#734)