diff --git a/crates/memoryos-adapters/src/wiki/confluence_backend.rs b/crates/memoryos-adapters/src/wiki/confluence_backend.rs index 25455e8..0f83f9e 100644 --- a/crates/memoryos-adapters/src/wiki/confluence_backend.rs +++ b/crates/memoryos-adapters/src/wiki/confluence_backend.rs @@ -95,8 +95,8 @@ impl ConfluenceExportBackend { html.push_str(&format!("

{}

\n", h3)); } else if line == "---" { html.push_str("
\n"); - } else if line.starts_with("- ") { - html.push_str(&format!("
  • {}
  • \n", &line[2..])); + } else if let Some(item) = line.strip_prefix("- ") { + html.push_str(&format!("
  • {}
  • \n", item)); } else if line.starts_with("**") && line.ends_with("**") { html.push_str(&format!( "

    {}

    \n", diff --git a/crates/memoryos-core/src/security/gdpr.rs b/crates/memoryos-core/src/security/gdpr.rs index 72b18e8..54bd260 100644 --- a/crates/memoryos-core/src/security/gdpr.rs +++ b/crates/memoryos-core/src/security/gdpr.rs @@ -3,18 +3,19 @@ use serde::{Deserialize, Serialize}; use std::path::PathBuf; use tracing::info; +/// Type alias for GDPR snapshot data (consents map + deletion requests) +pub type GdprSnapshotData = ( + std::collections::HashMap>, + Vec, +); + pub trait GdprStorageBackend: Send + Sync { fn save_snapshot( &self, consents: &std::collections::HashMap>, deletion_requests: &[DeletionRequest], ); - fn load_snapshot( - &self, - ) -> Option<( - std::collections::HashMap>, - Vec, - )>; + fn load_snapshot(&self) -> Option; } pub struct FileGdprBackend { @@ -48,12 +49,7 @@ impl GdprStorageBackend for FileGdprBackend { } } - fn load_snapshot( - &self, - ) -> Option<( - std::collections::HashMap>, - Vec, - )> { + fn load_snapshot(&self) -> Option { if self.path.exists() { std::fs::read_to_string(&self.path) .ok() diff --git a/crates/memoryos-gateway/Cargo.toml b/crates/memoryos-gateway/Cargo.toml index 36e9fed..377ff98 100644 --- a/crates/memoryos-gateway/Cargo.toml +++ b/crates/memoryos-gateway/Cargo.toml @@ -41,6 +41,7 @@ rand = "0.8" default = ["s3"] s3 = ["memoryos-wiki-gen/s3"] integration-tests = [] +memory-route-tests-disabled = [] [dev-dependencies] tower.workspace = true diff --git a/crates/memoryos-wiki-gen/src/endpoint/fastapi_extractor.rs b/crates/memoryos-wiki-gen/src/endpoint/fastapi_extractor.rs index b5b238e..0a4aa71 100644 --- a/crates/memoryos-wiki-gen/src/endpoint/fastapi_extractor.rs +++ b/crates/memoryos-wiki-gen/src/endpoint/fastapi_extractor.rs @@ -139,5 +139,6 @@ impl FastApiExtractor { } fn normalize_path(path: &str) -> String { - path.replace("{", "{").replace("}", "}") + // FastAPI uses {param} natively — no transformation needed + path.to_string() } diff --git a/crates/memoryos-wiki-gen/src/endpoint/spring_extractor.rs b/crates/memoryos-wiki-gen/src/endpoint/spring_extractor.rs index 5445299..ebdeca3 100644 --- a/crates/memoryos-wiki-gen/src/endpoint/spring_extractor.rs +++ b/crates/memoryos-wiki-gen/src/endpoint/spring_extractor.rs @@ -192,5 +192,6 @@ fn combine_paths(class_path: &str, method_path: &str) -> String { } fn normalize_path(path: &str) -> String { - path.replace("{", "{").replace("}", "}") + // Spring uses {param} natively — no transformation needed + path.to_string() } diff --git a/crates/memoryos-wiki-gen/src/lib.rs b/crates/memoryos-wiki-gen/src/lib.rs index 24d15e7..98396b1 100644 --- a/crates/memoryos-wiki-gen/src/lib.rs +++ b/crates/memoryos-wiki-gen/src/lib.rs @@ -13,6 +13,8 @@ pub mod llm_adapter; pub mod llm_gen; pub mod manifest; pub mod page_builder; +// Tree-sitter visitor functions require multiple context parameters for recursive AST traversal +#[allow(clippy::too_many_arguments)] pub mod parser; pub mod storage; pub mod wiki_index; @@ -148,7 +150,7 @@ impl WikiGenerator { ProgressStyle::with_template( "{spinner:.green} [{elapsed_precise}] [{bar:40.cyan/blue}] {pos}/{len} {msg}", ) - .unwrap() + .expect("BUG: invalid progress bar template") .progress_chars("#>-"), ); diff --git a/crates/memoryos-wiki-gen/src/storage/tests.rs b/crates/memoryos-wiki-gen/src/storage/tests.rs index 8a850ac..256bc6c 100644 --- a/crates/memoryos-wiki-gen/src/storage/tests.rs +++ b/crates/memoryos-wiki-gen/src/storage/tests.rs @@ -1,47 +1,45 @@ -#[cfg(test)] -mod tests { - use super::super::{GitConnector, LocalConnector, StorageConnector}; - use tempfile::TempDir; - - #[tokio::test] - async fn test_local_connector() { - let temp_dir = TempDir::new().unwrap(); - let test_file = temp_dir.path().join("test.txt"); - tokio::fs::write(&test_file, b"hello world").await.unwrap(); - - let mut connector = LocalConnector::new(temp_dir.path().to_path_buf()); - connector.connect().await.unwrap(); - - // Test exists - assert!(connector.exists("test.txt").await.unwrap()); - assert!(!connector.exists("nonexistent.txt").await.unwrap()); - - // Test read - let content = connector.read_file("test.txt").await.unwrap(); - assert_eq!(content, b"hello world"); - - // Test metadata - let meta = connector.metadata("test.txt").await.unwrap(); - assert_eq!(meta.size, 11); - assert!(!meta.is_dir); - } - - #[tokio::test] - #[ignore] // Requires network - async fn test_git_connector_public_repo() { - // Test with a small public repo (no auth needed) - let mut connector = - GitConnector::new("https://github.com/rust-lang/rustlings.git".to_string()) - .with_branch("main".to_string()); - - // This will clone the repo - connector.connect().await.unwrap(); - - // Test exists - assert!(connector.exists("README.md").await.unwrap()); - - // Test read - let content = connector.read_file("README.md").await.unwrap(); - assert!(!content.is_empty()); - } +#![cfg(test)] + +use super::{GitConnector, LocalConnector, StorageConnector}; +use tempfile::TempDir; + +#[tokio::test] +async fn test_local_connector() { + let temp_dir = TempDir::new().unwrap(); + let test_file = temp_dir.path().join("test.txt"); + tokio::fs::write(&test_file, b"hello world").await.unwrap(); + + let mut connector = LocalConnector::new(temp_dir.path().to_path_buf()); + connector.connect().await.unwrap(); + + // Test exists + assert!(connector.exists("test.txt").await.unwrap()); + assert!(!connector.exists("nonexistent.txt").await.unwrap()); + + // Test read + let content = connector.read_file("test.txt").await.unwrap(); + assert_eq!(content, b"hello world"); + + // Test metadata + let meta = connector.metadata("test.txt").await.unwrap(); + assert_eq!(meta.size, 11); + assert!(!meta.is_dir); +} + +#[tokio::test] +#[ignore] // Requires network +async fn test_git_connector_public_repo() { + // Test with a small public repo (no auth needed) + let mut connector = GitConnector::new("https://github.com/rust-lang/rustlings.git".to_string()) + .with_branch("main".to_string()); + + // This will clone the repo + connector.connect().await.unwrap(); + + // Test exists + assert!(connector.exists("README.md").await.unwrap()); + + // Test read + let content = connector.read_file("README.md").await.unwrap(); + assert!(!content.is_empty()); }