1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Knowledge graph synchronization engine for spec-ai.
//!
//! This crate provides a distributed synchronization engine for knowledge graphs
//! using vector clocks for causal ordering and conflict detection.
//!
//! # Features
//!
//! - **Adaptive Sync Strategy**: Automatically decides between full and incremental sync
//! based on the amount of changes.
//! - **Vector Clock Based Ordering**: Uses vector clocks to track causal relationships
//! and detect concurrent modifications.
//! - **Conflict Resolution**: Configurable conflict resolution strategies for handling
//! concurrent updates.
//! - **Tombstone Support**: Proper handling of deleted entities across distributed instances.
//!
//! # Usage
//!
//! To use this crate, implement the [`SyncPersistence`] trait for your storage backend,
//! then create a [`SyncEngine`] instance:
//!
//! ```ignore
//! use spec_ai_graph_sync::{SyncEngine, SyncPersistence};
//!
//! // Implement SyncPersistence for your storage
//! struct MyStorage { /* ... */ }
//! impl SyncPersistence for MyStorage { /* ... */ }
//!
//! // Create the sync engine
//! let storage = MyStorage::new();
//! let engine = SyncEngine::new(storage, "instance-1".to_string());
//!
//! // Perform sync operations
//! let payload = engine.sync_full("session-1", "default").await?;
//! ```
// Re-export main types for convenience
pub use ;
pub use SyncPersistence;
pub use ;
pub use ;
pub use ;
// Re-export vector clock types from knowledge-graph crate
pub use crate;