Clippy fixes (8 warnings → 0):
- Replace 5 manual Default impls with #[derive(Default)]
- Use .clamp() instead of .min().max() chain
- Use .is_some_and() instead of .map_or(false, ...)
- Add type alias for complex return type in scene_graph_to_adjacency
P0 correctness fixes from code review:
- Fix NaN panic: use unwrap_or(Ordering::Equal) in cognitive_core think()
- Fix integer overflow: use checked_mul in OccupancyGrid::new
- Fix potential unwrap: use map_or in domain_expansion score_avoidance
Co-Authored-By: claude-flow <ruv@ruv.net>
SpatialIndex: replace Vec<Vec<f32>> with flat Vec<f32> buffer for cache
locality and zero per-point heap allocation; use squared Euclidean
distance in kNN/radius search (defer sqrt to final k results); fuse
cosine distance into single loop.
Clustering: add union-by-rank to union-find preventing tree
degeneration (O(α(n)) amortized); add #[inline] on hot helpers.
A* planning: add closed set (HashSet) to avoid re-expanding nodes;
reuse neighbor buffer to eliminate per-expansion Vec allocation;
pre-allocate HashMap capacity; add #[inline] on helpers.
Perception: defer sqrt in bounding_sphere (compare squared distances,
one sqrt at end); defer sqrt in scene graph edge construction (filter
on squared threshold); add #[inline] on dist_3d.
Sensor fusion: pre-allocate merged vectors from total eligible cloud
size. Anomaly detection: fuse distance + statistics into single pass
using Welford's online algorithm (eliminates one full data pass).
All 281 tests pass.
https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
New `rvf` feature flag enables the `ruvf::RoboticsRvf` wrapper that
bridges point clouds, scene graphs, trajectories, Gaussian splats, and
obstacles into the RuVector Format (.rvf) for persistence and similarity
search.
RoboticsRvf supports:
- pack_point_cloud (dim 3)
- pack_scene_objects / pack_scene_graph (dim 9)
- pack_trajectory (dim 3)
- pack_gaussians (dim 7) — converts PointCloud→GaussianSplatCloud→RVF
- pack_obstacles (dim 6)
- query_nearest (kNN via HNSW index)
- open/open_readonly/close lifecycle
9 unit tests covering create, ingest, query, reopen, dimension mismatch,
and empty data rejection. Also fixes unused import warnings in integration
tests. All 290 tests pass across default, domain-expansion, and rvf features.
https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
New modules for ruvector-robotics:
- bridge/gaussian: GaussianSplat types, PointCloud→Gaussian conversion, vwm-viewer JSON export
- planning: A* pathfinding on OccupancyGrid with octile heuristic, potential field velocity commands
- mcp/executor: ToolExecutor dispatching ToolRequests to perception pipeline and spatial index
- perception/sensor_fusion: multi-sensor cloud fusion with timestamp alignment and voxel downsampling
Rewrites integration tests to use actual crate APIs instead of local reimplementations,
eliminating ~280 lines of false-positive test code. Adds 15 benchmark groups covering
all new modules (Gaussian conversion, A* planning, potential fields, sensor fusion, MCP execution).
All 270+ tests pass including domain-expansion feature.
https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY
- Remove unsafe pointer aliasing in BehaviorTree::tick(), use safe
disjoint field borrowing instead (P0)
- Fix usize underflow in score_scene_graph when expected_objects < 2 (P0)
- Fix cluster ID overflow in reference_solution for PointCloudClustering (P0)
- Fix NaN handling in MaxDistEntry::cmp — NaN treated as maximally
distant so it gets evicted from kNN heap first (P1)
- Clamp cosine_distance output to prevent negative values from
floating-point rounding (P1)
- Change search_radius to return Ok(Vec::new()) for empty index instead
of Err(EmptyIndex) for correct semantics (P1)
- Add debug_assert guards for empty slices in bounding_sphere and
cluster_to_object (P1)
- Remove dead PipelineConfig.spatial_search_k field (P2)
- Use serde_json::from_value instead of to_string+from_str roundtrip
in domain_expansion for better performance (P2)
All 257 tests pass.
https://claude.ai/code/session_01H1GkTK5z9ppVVQDQukjBsY