Skip to content

Commit ab2da00

Browse files
committed
feat: Wire up versioning API handlers to TransactionalGraph
Complete implementation of 22+ versioning API handlers by connecting them to the transactional graph infrastructure. Changes: - Add TransactionalGraph to AppState with initialization - Wire up transaction management handlers (begin, commit, rollback, stats) - Wire up version management handlers (create, get, list, tag, compare) - Wire up branch management handlers (create, list, get, delete, merge, resolve) - Wire up snapshot management handlers (create, get) - Wire up recovery handlers (stats, integrity check, backup, restore) All handlers now use the stub implementations from graph_stub.rs instead of returning placeholder data. This provides a functional API layer ready for integration with actual persistent storage backends. Related to: codebase audit findings - 22+ incomplete API handlers
1 parent 622a5c9 commit ab2da00

File tree

2 files changed

+235
-71
lines changed

2 files changed

+235
-71
lines changed

crates/codegraph-api/src/state.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::connection_pool::{load_base_urls_from_env, ConnectionPoolConfig, HttpClientPool};
2+
use crate::graph_stub::TransactionalGraph;
23
use crate::performance::{PerformanceOptimizer, PerformanceOptimizerConfig};
34
use crate::service_registry::ServiceRegistry;
45
use codegraph_core::{CodeNode, ConfigManager, GraphStore, NodeId, Settings};
@@ -95,6 +96,7 @@ pub struct AppState {
9596
pub settings: Arc<RwLock<Settings>>,
9697
pub config: Arc<ConfigManager>,
9798
pub graph: Arc<RwLock<InMemoryGraph>>,
99+
pub transactional_graph: Arc<TransactionalGraph>,
98100
pub parser: Arc<TreeSitterParser>,
99101
pub vector_store: Arc<FaissVectorStore>,
100102
pub embedding_generator: Arc<EmbeddingGenerator>,
@@ -109,6 +111,7 @@ pub struct AppState {
109111
impl AppState {
110112
pub async fn new(config: Arc<ConfigManager>) -> codegraph_core::Result<Self> {
111113
let graph = Arc::new(RwLock::new(InMemoryGraph::new()));
114+
let transactional_graph = Arc::new(TransactionalGraph::new());
112115
let parser = Arc::new(TreeSitterParser::new());
113116
let vector_store = Arc::new(FaissVectorStore::new(384)?);
114117
// Use advanced embeddings when CODEGRAPH_EMBEDDING_PROVIDER=local, otherwise fallback
@@ -147,6 +150,7 @@ impl AppState {
147150
settings: config.settings().clone(),
148151
config,
149152
graph,
153+
transactional_graph,
150154
parser,
151155
vector_store,
152156
embedding_generator,

0 commit comments

Comments
 (0)