mirror of
https://github.com/samvallad33/vestige.git
synced 2026-06-08 20:25:16 +02:00
chore: apply clippy fixes to e2e tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e06dd3d69a
commit
ad1e1796f3
13 changed files with 27 additions and 40 deletions
|
|
@ -511,9 +511,9 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn test_embedding_assertions() {
|
||||
let emb1 = vec![1.0f32, 0.0, 0.0];
|
||||
let emb2 = vec![0.9, 0.1, 0.0];
|
||||
let emb3 = vec![0.0, 1.0, 0.0];
|
||||
let emb1 = [1.0f32, 0.0, 0.0];
|
||||
let emb2 = [0.9, 0.1, 0.0];
|
||||
let emb3 = [0.0, 1.0, 0.0];
|
||||
|
||||
assert_embeddings_similar!(emb1, emb2, 0.8);
|
||||
assert_embeddings_different!(emb1, emb3, 0.5);
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ mod tests {
|
|||
let sim = service.cosine_similarity(&emb1, &emb2);
|
||||
|
||||
// Cosine similarity should be in [-1, 1]
|
||||
assert!(sim >= -1.0 && sim <= 1.0);
|
||||
assert!((-1.0..=1.0).contains(&sim));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -22,21 +22,19 @@
|
|||
use chrono::{Duration, Utc};
|
||||
use vestige_core::{
|
||||
// Advanced reconsolidation
|
||||
AccessContext, AccessTrigger, LabileState, MemorySnapshot, Modification,
|
||||
ReconsolidatedMemory, ReconsolidationManager, RelationshipType,
|
||||
AccessContext, AccessTrigger, Modification, ReconsolidationManager, RelationshipType,
|
||||
// FSRS
|
||||
Rating, retrievability, retrievability_with_decay, initial_difficulty, initial_stability,
|
||||
next_interval, FSRSScheduler, FSRSState,
|
||||
Rating, retrievability, retrievability_with_decay, initial_difficulty,
|
||||
next_interval, FSRSScheduler,
|
||||
// Neuroscience - Synaptic Tagging
|
||||
SynapticTaggingSystem, SynapticTag, ImportanceEvent, ImportanceEventType,
|
||||
CaptureWindow, DecayFunction, ImportanceCluster, CapturedMemory,
|
||||
SynapticTaggingSystem, ImportanceEvent, ImportanceEventType,
|
||||
CaptureWindow, DecayFunction,
|
||||
// Neuroscience - Memory States
|
||||
MemoryState, MemoryLifecycle, StateTransitionReason, AccessibilityCalculator,
|
||||
CompetitionManager, CompetitionCandidate, StateDecayConfig, StateUpdateService,
|
||||
MemoryStateInfo,
|
||||
MemoryState, MemoryLifecycle, AccessibilityCalculator,
|
||||
CompetitionManager, CompetitionCandidate,
|
||||
// Neuroscience - Importance Signals
|
||||
ImportanceSignals, NoveltySignal, ArousalSignal, RewardSignal, AttentionSignal,
|
||||
ImportanceContext, AccessPattern, AttentionSession, OutcomeType, CompositeWeights,
|
||||
ImportanceContext, AttentionSession, OutcomeType,
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
|
@ -458,7 +456,7 @@ fn test_fsrs_initial_difficulty_order() {
|
|||
|
||||
// All within valid bounds (1.0 to 10.0)
|
||||
for d in [d_again, d_hard, d_good, d_easy] {
|
||||
assert!(d >= 1.0 && d <= 10.0, "Difficulty {} out of bounds", d);
|
||||
assert!((1.0..=10.0).contains(&d), "Difficulty {} out of bounds", d);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
use vestige_core::neuroscience::spreading_activation::{
|
||||
ActivationConfig, ActivationNetwork, LinkType,
|
||||
};
|
||||
use std::collections::HashSet;
|
||||
|
||||
// ============================================================================
|
||||
// SERIAL POSITION EFFECT TESTS (5 tests)
|
||||
|
|
|
|||
|
|
@ -14,14 +14,9 @@
|
|||
use vestige_core::neuroscience::spreading_activation::{
|
||||
ActivationConfig, ActivationNetwork, LinkType,
|
||||
};
|
||||
use vestige_core::neuroscience::synaptic_tagging::{
|
||||
CaptureWindow, ImportanceEvent, ImportanceEventType, SynapticTaggingSystem,
|
||||
};
|
||||
use vestige_core::neuroscience::hippocampal_index::{
|
||||
BarcodeGenerator, HippocampalIndex,
|
||||
};
|
||||
use vestige_core::neuroscience::synaptic_tagging::SynapticTaggingSystem;
|
||||
use vestige_core::neuroscience::hippocampal_index::HippocampalIndex;
|
||||
use chrono::Utc;
|
||||
use std::collections::HashSet;
|
||||
|
||||
// ============================================================================
|
||||
// MALFORMED INPUT HANDLING (2 tests)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ use vestige_core::neuroscience::synaptic_tagging::{
|
|||
use vestige_core::neuroscience::hippocampal_index::{
|
||||
HippocampalIndex, IndexQuery,
|
||||
};
|
||||
use std::collections::HashSet;
|
||||
|
||||
// ============================================================================
|
||||
// RANDOM OPERATION SEQUENCE TESTS (2 tests)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ fn test_math_edge_weight_multiplication() {
|
|||
let mut network = ActivationNetwork::with_config(config);
|
||||
|
||||
// Create edges with different weights
|
||||
let test_weights = vec![0.1, 0.25, 0.5, 0.75, 1.0];
|
||||
let test_weights = [0.1, 0.25, 0.5, 0.75, 1.0];
|
||||
|
||||
for (i, &weight) in test_weights.iter().enumerate() {
|
||||
network.add_edge(
|
||||
|
|
@ -349,7 +349,7 @@ fn test_math_embedding_dimensions() {
|
|||
// Compression ratio should be reasonable
|
||||
let compression_ratio = 384.0 / INDEX_EMBEDDING_DIM as f64;
|
||||
assert!(
|
||||
compression_ratio >= 2.0 && compression_ratio <= 4.0,
|
||||
(2.0..=4.0).contains(&compression_ratio),
|
||||
"Compression ratio should be 2-4x: {:.2}x",
|
||||
compression_ratio
|
||||
);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use vestige_core::neuroscience::synaptic_tagging::{
|
|||
SynapticTaggingSystem,
|
||||
};
|
||||
use vestige_core::neuroscience::hippocampal_index::{
|
||||
HippocampalIndex, HippocampalIndexConfig, IndexQuery, INDEX_EMBEDDING_DIM,
|
||||
HippocampalIndex, HippocampalIndexConfig, IndexQuery,
|
||||
};
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@ use chrono::{Duration, Utc};
|
|||
use vestige_core::{
|
||||
advanced::dreams::{
|
||||
ActivityTracker, ConnectionGraph, ConnectionReason, ConsolidationScheduler,
|
||||
DreamConfig, DreamMemory, InsightType, MemoryDreamer,
|
||||
DreamConfig, DreamMemory, MemoryDreamer,
|
||||
},
|
||||
consolidation::SleepConsolidation,
|
||||
};
|
||||
use std::collections::HashSet;
|
||||
|
||||
// ============================================================================
|
||||
// HELPER FUNCTIONS
|
||||
|
|
|
|||
|
|
@ -290,13 +290,11 @@ fn test_roundtrip_preserves_all_data() {
|
|||
#[test]
|
||||
fn test_selective_export_by_tags() {
|
||||
// Create memories with different tags
|
||||
let memories = vec![
|
||||
ExportedMemory::new("Rust ownership", "concept", vec!["rust", "memory"]),
|
||||
let memories = [ExportedMemory::new("Rust ownership", "concept", vec!["rust", "memory"]),
|
||||
ExportedMemory::new("Python generators", "concept", vec!["python", "generators"]),
|
||||
ExportedMemory::new("Rust borrowing", "concept", vec!["rust", "borrowing"]),
|
||||
ExportedMemory::new("JavaScript async", "concept", vec!["javascript", "async"]),
|
||||
ExportedMemory::new("Rust async", "concept", vec!["rust", "async"]),
|
||||
];
|
||||
ExportedMemory::new("Rust async", "concept", vec!["rust", "async"])];
|
||||
|
||||
// Filter by "rust" tag
|
||||
let rust_memories: Vec<_> = memories
|
||||
|
|
|
|||
|
|
@ -12,10 +12,9 @@
|
|||
//! 4. System proactively suggests relevant memories
|
||||
//! 5. User benefits from context-aware assistance
|
||||
|
||||
use chrono::Utc;
|
||||
use vestige_core::advanced::intent::{
|
||||
ActionType, DetectedIntent, IntentDetector, LearningLevel, MaintenanceType,
|
||||
OptimizationType, ReviewDepth, UserAction,
|
||||
OptimizationType, UserAction,
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
|
@ -84,7 +83,7 @@ fn test_debugging_intent_detection() {
|
|||
|
||||
// Verify evidence is captured
|
||||
assert!(
|
||||
result.evidence.len() > 0 || result.confidence == 0.0,
|
||||
!result.evidence.is_empty() || result.confidence == 0.0,
|
||||
"Should capture evidence if intent detected"
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ fn test_standard_jsonrpc_error_codes() {
|
|||
|
||||
for (code, message) in error_codes {
|
||||
// All standard codes are in the reserved range
|
||||
assert!(code <= -32600 && code >= -32700,
|
||||
assert!((-32700..=-32600).contains(&code),
|
||||
"Standard error code {} ({}) must be in reserved range", code, message);
|
||||
}
|
||||
}
|
||||
|
|
@ -142,7 +142,7 @@ fn test_mcp_specific_error_codes() {
|
|||
|
||||
for (code, name) in mcp_error_codes {
|
||||
// MCP-specific codes are in the server error range
|
||||
assert!(code >= -32099 && code <= -32000,
|
||||
assert!((-32099..=-32000).contains(&code),
|
||||
"MCP error code {} ({}) must be in server error range", code, name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ fn test_mark_reviewed_with_rating() {
|
|||
|
||||
// Rating values: 1=Again, 2=Hard, 3=Good, 4=Easy
|
||||
let rating = tool_call["arguments"]["rating"].as_i64().unwrap();
|
||||
assert!(rating >= 1 && rating <= 4, "Rating must be 1-4");
|
||||
assert!((1..=4).contains(&rating), "Rating must be 1-4");
|
||||
|
||||
let expected_response = json!({
|
||||
"content": [{
|
||||
|
|
@ -356,7 +356,7 @@ fn test_mark_reviewed_invalid_rating() {
|
|||
|
||||
// Rating should be validated
|
||||
let r = tool_call["arguments"]["rating"].as_i64().unwrap();
|
||||
assert!(r < 1 || r > 4, "Rating {} should be invalid", r);
|
||||
assert!(!(1..=4).contains(&r), "Rating {} should be invalid", r);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue