mirror of
https://github.com/samvallad33/vestige.git
synced 2026-05-08 23:32:37 +02:00
- Add #![allow(dead_code)] to deprecated tool modules (kept for backwards compatibility but not exposed in MCP tool list) - Mark unused functions with #[allow(dead_code)] annotations - Fix unused variable warnings (prefix with _) - Apply clippy auto-fixes for redundant closures and derives - Fix test to account for protocol version negotiation - Reorganize tools/mod.rs to clarify active vs deprecated tools Security review: LOW RISK - no critical vulnerabilities found Dead code review: deprecated tools properly annotated Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
1.2 KiB
Rust
39 lines
1.2 KiB
Rust
#![allow(dead_code)]
|
|
//! Consolidation Tool (Deprecated)
|
|
//!
|
|
//! Run memory consolidation cycle with FSRS decay and embedding generation.
|
|
|
|
use serde_json::Value;
|
|
use std::sync::Arc;
|
|
use tokio::sync::Mutex;
|
|
|
|
use vestige_core::Storage;
|
|
|
|
/// Input schema for run_consolidation tool
|
|
pub fn schema() -> Value {
|
|
serde_json::json!({
|
|
"type": "object",
|
|
"properties": {},
|
|
})
|
|
}
|
|
|
|
pub async fn execute(storage: &Arc<Mutex<Storage>>) -> Result<Value, String> {
|
|
let mut storage = storage.lock().await;
|
|
let result = storage.run_consolidation().map_err(|e| e.to_string())?;
|
|
|
|
Ok(serde_json::json!({
|
|
"success": true,
|
|
"nodesProcessed": result.nodes_processed,
|
|
"nodesPromoted": result.nodes_promoted,
|
|
"nodesPruned": result.nodes_pruned,
|
|
"decayApplied": result.decay_applied,
|
|
"embeddingsGenerated": result.embeddings_generated,
|
|
"durationMs": result.duration_ms,
|
|
"message": format!(
|
|
"Consolidation complete: {} nodes processed, {} embeddings generated, {}ms",
|
|
result.nodes_processed,
|
|
result.embeddings_generated,
|
|
result.duration_ms
|
|
),
|
|
}))
|
|
}
|