Run rustfmt on all Rust files to fix CI formatting checks.
This addresses pre-existing formatting inconsistencies across:
- cognitum-gate-kernel
- cognitum-gate-tilezero
- prime-radiant
- ruvector-* crates
- examples/benchmarks
- and other crates
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Move datum and false arguments to same line in from_polymorphic_datum
- Join split let text_len = ... assignment to single line
These changes fix CI rustfmt check failures.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit fixes a critical P0 bug where HNSW indexes on ruvector
columns would crash PostgreSQL with a segmentation fault when using
parameterized queries (prepared statements, ORMs, application drivers).
Root Cause:
- Query vector extraction failed for parameterized queries
- Code fell back to zero vector without validation
- Zero vector caused segfault during HNSW search
Changes:
- Add multi-method query vector extraction pipeline
1. Direct RuVector::from_polymorphic_datum()
2. Text parameter conversion for parameterized queries
3. Validated varlena fallback with dimension checking
- Add query_valid flag to track extraction success
- Add validation before search execution:
- Reject empty/invalid query vectors with clear errors
- Reject all-zero vectors (invalid for similarity search)
- Validate dimension match between query and index
- Apply same fixes to IVFFlat for consistency
Testing:
- Added regression tests for parameterized queries
- Added tests for zero vector error handling
- Added tests for dimension mismatch errors
- Added 384-dimension production-scale tests
Fixes: #141
See: docs/adr/ADR-0027-hnsw-parameterized-query-fix.md
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add ChatEnhancer for enhanced chat processing with skills, memory,
and proactive assistance integration
- Add SkillExecutor for skill lifecycle management and execution
- Add builtin skills: CodeSkill, MemorySkill, SummarizeSkill, WebSearchSkill
- Improve server.ts with better error handling and session management
- Update AIDefenceGuard with enhanced security checks
- Update chat UI with improved styling and interactions
- Bump version to 0.1.1 with delta crates integration
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the full delta-behavior framework - systems where change is
permitted but collapse is not.
## Core Implementation
- Coherence type with [0,1] bounds and safe constructors
- Three-layer enforcement: energy cost, scheduling, memory gating
- DeltaSystem trait for coherence-preserving systems
- DeltaConfig with strict/relaxed/default presets
## 11 Exotic Applications
1. Self-Limiting Reasoning - AI that does less when uncertain
2. Computational Event Horizon - bounded computation without hard limits
3. Artificial Homeostasis - synthetic life with coherence-based survival
4. Self-Stabilizing World Model - models that refuse to hallucinate
5. Coherence-Bounded Creativity - novelty without chaos
6. Anti-Cascade Financial System - markets that cannot collapse
7. Graceful Aging - systems that simplify over time
8. Swarm Intelligence - collective behavior without pathology
9. Graceful Shutdown - systems that seek safe termination
10. Pre-AGI Containment - bounded intelligence growth
11. Extropic Substrate - goal mutation, agent lifecycles, spike semantics
## Performance Optimizations
- O(n²) → O(n·k) swarm neighbor detection via SpatialGrid
- O(n) → O(1) coherence calculation with incremental cache
- VecDeque for O(1) history removal
- SIMD utilities with 8x loop unrolling
- Bounded history to prevent memory leaks
## Security Fixes
- Replaced unsafe static mut with AtomicU64 for thread-safe RNG
- NaN validation on all coherence inputs
- Overflow protection in calculations
## WASM + TypeScript SDK
- Full wasm-bindgen exports for all 11 applications
- High-level TypeScript SDK with ergonomic APIs
- Browser and Node.js examples
## Test Coverage
- 32 lib tests, 14 WASM tests, 13 doc tests (59 total)
Resolves#140
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add GoogleAIProvider for direct Gemini API access
- Support Gemini 2.5 Flash, Pro, and Lite models
- Add Gemini 3.x preview models
- Auto-detect and use Google AI when GOOGLE_AI_API_KEY is set
- Update chat UI with debugging and LLM status checks
- Fix model routing for Google Cloud deployments
- Bump version to 0.1.8
Tested models:
- gemini-2.5-flash (stable, recommended)
- gemini-2.5-pro (stable)
- gemini-2.5-flash-lite (stable)
Sources:
- https://ai.google.dev/gemini-api/docs/models
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add embedded chat UI with dark mode default (ADR-015)
- Add channel setup commands for Slack, Discord, Telegram
- Add webhook configuration CLI commands
- Add cloud deployment CLI with Cloud Run, Docker, Kubernetes support
- Add gcloud CLI integration and curl-based installer
- Add template library system for quick starts
- Update Dockerfile to include static files
- Bump version to 0.1.6
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix pino error serialization (use 'err' key instead of 'error')
- Add detailed logging for JSON parse errors with rawBody preview
- Add nested try-catch for AIDefence output validation
- Block critical threats with SECURITY_BLOCKED error code
- Add /api/models endpoint with 12+ supported LLM models
- Add Gemini 2.5 Pro support via OpenRouter
- Update README with stronger security messaging vs Clawdbot
- Update FEATURE_COMPARISON.md with security gap analysis
- Bump version to 0.1.1
Tested and verified on Cloud Run deployment:
- All endpoints working: health, ready, status, models, agents, sessions, chat
- Chat returns proper fallback when LLM not configured
- Error logs now properly serialize error objects
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add server.ts with REST API endpoints for RuvBot
- Implement health/ready checks for Cloud Run
- Add agent and session management API
- Integrate AIDefence security layer in production
- Fix Dockerfile CMD path to dist/server.js
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create missing learning/memory/MemoryManager.ts with Embedder and VectorIndex interfaces
- Fix core/index.ts to re-export memory types from learning module instead of non-existent core/memory
- Fix HybridSearch to await async vectorIndex.add() call and handle empty queries
- Fix MockSlackWebClient name collisions (users, files, reactions private Maps shadowed by API objects)
- Fix MockRouter path matching to properly split method:path keys with param colons
- Fix SkillRegistry updateMetrics calculation for success rate
- Fix test mocks to match async interface signatures (VectorIndex, Embedder)
- Update skill test latency calculation to use performance.now() for sub-ms precision
Test results: 561 passing (previously 287), 10 remaining edge case failures
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>