Commit graph

468 commits

Author SHA1 Message Date
Claude
d35e5906ab
fix(dag): resolve compilation errors and API mismatches
Fixes across attention mechanisms, SONA engine, and examples:

Attention mechanisms:
- hierarchical_lorentz: Use dag.node_count(), dag.children() API
- parallel_branch: Replace get_children() with children()
- temporal_btsp: Fix node.estimated_cost access, remove selectivity
- cache: Use dag.node_ids() and dag.children() for iteration
- mincut_gated: Fix return type to match DagAttentionMechanism trait
- selector: Update tests to use OperatorNode::new()

SONA/QuDAG:
- sona/engine: Add deprecated Scan/Join match arms
- ml_kem: Fix unused parameter warnings
- ml_dsa: Fix unused parameter warnings

Examples:
- basic_usage: Use dag.children() instead of get_children()
- learning_workflow: Fix HnswScan/Sort field names, trajectory access
- attention_demo: Import DagAttentionMechanism trait
- attention_selection: Fix CausalConeConfig field names
- self_healing: Remove non-existent result fields
- federated_coherence: Add parentheses for comparison expression

Cargo.toml:
- Register all exotic examples with explicit paths

All 12 examples now build and run successfully.
2025-12-30 01:50:51 +00:00
Claude
cc18f19aee
feat(dag): add federated coherence network example
Distributed coherence-sensing substrates that maintain collective
homeostasis across nodes without central coordination.

federated_coherence.rs (508 lines):
- Consensus through coherence, not voting
- Tension propagates across federation boundaries
- Patterns learned locally, validated globally
- Network-wide instinct alignment
- Graceful partition handling with coherence degradation

Message protocol (7 types):
- Heartbeat: tension state + pattern count
- ProposePattern: share locally learned patterns
- ValidatePattern: confirm pattern efficacy
- RejectPattern: report low local efficacy
- TensionAlert: broadcast stress spikes
- SyncRequest/Response: bulk pattern sync

"Not distributed computing. Distributed feeling."
2025-12-29 23:59:35 +00:00
Claude
44475cecb9
feat(dag): add exotic examples - coherence-sensing substrates
Six examples demonstrating systems that respond to internal tension
rather than external commands. Intelligence as homeostasis.

1. synthetic_reflex_organism.rs (286 lines)
   - No global objective function
   - Minimizes structural stress over time
   - Learns only when instability crosses thresholds
   - "Intelligence as homeostasis, not problem-solving"

2. timing_synchronization.rs (334 lines)
   - Machines that feel timing, not data
   - Measures when things stop lining up
   - Synchronizes with biological rhythms
   - "You stop predicting intent. You synchronize with it."

3. coherence_safety.rs (442 lines)
   - Capability degradation: Full → Reduced → Conservative → Minimal → Halted
   - Self-halts when internal coherence drops
   - "Safety becomes structural, not moral"

4. artificial_instincts.rs (406 lines)
   - Biases enforced by mincut/attention/healing
   - Avoid fragmentation, preserve causality, prefer reversibility
   - "Closer to evolution than training"

5. living_simulation.rs (349 lines)
   - Simulations that maintain stability under perturbation
   - Exposes fragile boundaries, not forecasts
   - "No longer modeling reality. Modeling fragility."

6. thought_integrity.rs (421 lines)
   - Reasoning integrity monitored like voltage
   - Reduce precision, exit early, route to simpler paths
   - "Always-on intelligence without runaway cost"

Total: 2,238 lines of exotic coherence-sensing code
2025-12-29 23:51:55 +00:00
Claude
b2fbd2beee
docs(postgres): add Neural DAG Learning section to README
- Document 59 SQL functions for DAG-based query optimization
- Add rudag_* function examples (config, analysis, attention, status, patterns, trajectories, healing, qudag)
- Update function count: 230+ -> 290+
- Add Neural DAG Learning to feature comparison table
- Highlight MinCut control signal, SONA, 7 attention mechanisms, QuDAG integration
2025-12-29 23:41:47 +00:00
Claude
a90dd92cc3
feat(dag-wasm): add minimal WASM build for browser/embedded
- 130KB raw, 58KB gzipped WASM binary
- 13-method API surface (add_node, add_edge, topo_sort, critical_path, attention)
- 3 attention mechanisms (topological, critical path, uniform)
- Binary and JSON serialization
- wee_alloc feature for even smaller builds
- TypeScript type definitions included

Also updates ruvector-dag README with:
- Design philosophy: MinCut as central control signal
- Policy layer for attention mechanism selection
- SONA state vector structure with per-operator LoRA weights
- Predictive healing based on rising cut tension
- External cost model trait for PostgreSQL/embedded/chip schedulers
- QuDAG sync frequency bounds (1min-1hr adaptive)
- End-to-end convergence example with logs
2025-12-29 23:35:37 +00:00
Claude
bc4e63d4d4
feat(dag): implement Neural Self-Learning DAG with QuDAG integration
Complete implementation of the Neural DAG Learning system combining RuVector
vector database with QuDAG quantum-resistant consensus.

Core Features:
- QueryDag structure with HashMap-based adjacency and cycle detection
- 18+ operator types (SeqScan, HnswScan, HashJoin, NestedLoop, etc.)
- Topological, DFS, and BFS traversal iterators
- JSON/binary serialization

Attention Mechanisms (7 total):
- Basic: Topological, CausalCone, CriticalPath, MinCutGated
- Advanced: HierarchicalLorentz, ParallelBranch, TemporalBTSP
- UCB bandit selector for automatic mechanism selection
- LRU attention cache with 10k entry default

SONA (Self-Optimizing Neural Architecture):
- MicroLoRA adaptation (<100μs, rank-2)
- TrajectoryBuffer with lock-free ArrayQueue (10k capacity)
- ReasoningBank with K-means++ clustering
- EWC++ for catastrophic forgetting prevention (λ=5000)

MinCut Optimization:
- O(n^0.12) subpolynomial amortized updates
- Local k-cut approximation for sublinear bottleneck detection
- Criticality-based flow computation
- Redundancy analysis and repair suggestions

Self-Healing System:
- Z-score anomaly detection with adaptive thresholds
- Index health monitoring (HNSW/IVFFlat metrics)
- Learning drift detection with ADWIN algorithm
- Repair strategies: reindex, parameter tuning, learning reset

QuDAG Integration:
- ML-KEM-768 quantum-resistant encryption
- ML-DSA-65 quantum-resistant signatures
- Differential privacy (Laplace/Gaussian mechanisms)
- rUv token staking, rewards (5% APY), governance (67% threshold)

PostgreSQL Extension:
- GUC variables for configuration
- Planner/executor hooks for query interception
- Background worker for continuous learning
- 50+ SQL functions for all features

Testing:
- 46+ integration tests across all modules
- 11 benchmark groups for performance validation
- Test fixtures and data generators
- Mock QuDAG client for isolated testing

Documentation:
- Comprehensive README with architecture overview
- 5 example programs demonstrating all features
- Implementation notes for attention mechanisms

Total: ~12,000+ lines of new Rust code
2025-12-29 22:58:43 +00:00
Claude
87441caf16
docs(dag): add comprehensive Neural DAG Learning implementation plan
Add complete documentation for 15-agent swarm implementation of self-learning
DAG system integrating RuVector with QuDAG quantum-resistant consensus.

Documents created:
- 00-INDEX.md: Document index and priority matrix
- 01-ARCHITECTURE.md: 7-layer system architecture
- 02-DAG-ATTENTION-MECHANISMS.md: 7 novel attention mechanisms
- 03-SONA-INTEGRATION.md: Self-Optimizing Neural Architecture
- 04-POSTGRES-INTEGRATION.md: pgrx extension integration
- 05-QUERY-PLAN-DAG.md: Query plan to DAG conversion
- 06-MINCUT-OPTIMIZATION.md: Subpolynomial O(n^0.12) algorithms
- 07-SELF-HEALING.md: Autonomous anomaly detection and repair
- 08-QUDAG-INTEGRATION.md: Quantum-resistant distributed consensus
- 09-SQL-API.md: Complete SQL function reference (50+ functions)
- 10-TESTING-STRATEGY.md: Unit, integration, property tests
- 11-AGENT-TASKS.md: 15-agent task breakdown and dependencies
- 12-MILESTONES.md: 8-phase implementation milestones

Key features documented:
- 7 DAG-centric attention mechanisms (Topological, Causal Cone, etc.)
- SONA integration with MicroLoRA (<100μs adaptation)
- ReasoningBank with K-means++ clustering
- EWC++ for catastrophic forgetting prevention
- ML-KEM-768 and ML-DSA quantum-resistant cryptography
- rUv token integration for distributed pattern learning
2025-12-29 22:15:55 +00:00
github-actions[bot]
2c9b784d1d chore: Update NAPI-RS binaries for all platforms
Built from commit 0a6608b1ae

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-29 21:18:28 +00:00
rUv
0a6608b1ae chore(npm): add dist files for ruvector publish
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:14:34 +00:00
rUv
61f1eee0fd feat(npm): add hooks support to ruvector package
- Add self-learning intelligence hooks for Claude Code
- Include Q-learning patterns, vector memories, file sequences
- Add pre-edit/post-edit, pre-command/post-command hooks
- Add session management and swarm coordination
- Bump version to 0.1.36

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:14:34 +00:00
github-actions[bot]
7cb6cee256 chore: Update NAPI-RS binaries for all platforms
Built from commit ae4915d304

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-29 19:23:32 +00:00
rUv
ae4915d304 chore(crates): add version specs for crates.io publishing
- Add version = "0.1.29" to ruvector-mincut dependency in mincut-wasm
- Add version = "0.1.29" to ruvector-mincut dependency in mincut-node
- Add version = "0.1.29" to ruvector-core dependency in rvlite

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 19:19:26 +00:00
rUv
7ec696c261 chore(crates): add missing metadata for crates.io publishing
- Add description, keywords, categories to ruvector-nervous-system
- Add metadata and README to ruvector-mincut-wasm
- Add metadata and README to ruvector-mincut-node
- Remove cargo publish restriction from settings.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 19:19:26 +00:00
github-actions[bot]
749027ef13 chore: Update NAPI-RS binaries for all platforms
Built from commit 10fbe57f07

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-29 19:11:50 +00:00
rUv
10fbe57f07 chore(npm): bump @ruvector/core to v0.1.29
- Update @ruvector/core to 0.1.29
- Update all platform dependencies to 0.1.29
- Published: ruvector-core-{linux-x64-gnu,linux-arm64-gnu,darwin-x64,darwin-arm64,win32-x64-msvc}@0.1.29

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 19:06:16 +00:00
github-actions[bot]
3c31c658b6 chore: Update NAPI-RS binaries for all platforms
Built from commit 60dc662afe

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-29 19:02:47 +00:00
rUv
60dc662afe fix(node): remove ESM type declaration for NAPI-RS compatibility
- Remove "type": "module" that conflicted with NAPI-RS CommonJS output
- Bump @ruvector/node to 0.1.19
- Update optionalDependencies to 0.1.19
- Update hooks to use absolute path to ruvector-cli

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:57:01 +00:00
github-actions[bot]
e732f1206b chore: Update NAPI-RS binaries for all platforms
Built from commit 4bea76d087

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-29 18:22:32 +00:00
github-actions[bot]
5699686598 chore: Update NAPI-RS binaries for all platforms
Built from commit 2aac3e6026

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-29 18:20:42 +00:00
rUv
4bea76d087 chore(npm): bump @ruvector/cli to v0.1.28
Published to npm: https://www.npmjs.com/package/@ruvector/cli

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:07:20 +00:00
rUv
2aac3e6026
Merge pull request #85 from ruvnet/fix/ci-build-issues
feat(postgres): RuVector PostgreSQL v2.0.0 - Docker Hub Release
2025-12-29 13:03:37 -05:00
rUv
18e7c91082 fix(ci): use --memory-type flag for hooks remember command
The Rust CLI uses --memory-type, not --type.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:58:38 +00:00
rUv
964d6dc9cb fix(ci): install CLI deps in /tmp to escape workspace
- Copy CLI package to /tmp before npm install
- This prevents npm from finding the parent workspace lockfile
- Copy back node_modules and dist after build

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:50:24 +00:00
rUv
aa78053317 fix(ci): install CLI deps independently from workspace
- Remove workspace package-lock.json for CLI tests
- Install only CLI's own dependencies to avoid platform-specific packages
- Update paths to work from npm/packages/cli directory

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:47:58 +00:00
rUv
55cd0ce67f style: run cargo fmt across all crates
Fixes Rust formatting issues across:
- ruvector-mincut-gated-transformer
- ruvector-nervous-system
- ruvector-postgres
- ruvector-cli

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:41:49 +00:00
rUv
d01b6e4b7a fix(ci): use npm workspaces correctly for hooks-ci
- Run npm install from workspace root with --omit=optional
- Build using workspace flag -w @ruvector/cli
- Update test paths to packages/cli/dist/cli.js

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:35:36 +00:00
rUv
8ed9ac3d6f fix(ci): correct rust-toolchain action and npm install flags
- Change dtolnay/rust-action to dtolnay/rust-toolchain
- Add --ignore-scripts --no-optional to npm install to avoid platform issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:31:47 +00:00
rUv
f1e1f181be merge: incorporate changes from main branch
Resolves merge conflicts in intelligence data files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 17:29:05 +00:00
github-actions[bot]
2ae83bdcb1 chore: Update NAPI-RS binaries for all platforms
Built from commit 8aa59c9dfb

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-29 15:56:57 +00:00
rUv
8aa59c9dfb
Merge pull request #87 from ruvnet/claude/implement-hooks-docs-FXQ35
docs(hooks): Add comprehensive hooks system documentation
2025-12-29 10:52:32 -05:00
Claude
d313d2d3ff
feat(npm): Add Claude Code v2.0.55+ commands to npm CLI
Added 3 new hooks commands to npm CLI:
- lsp-diagnostic: Process LSP diagnostic events for learning
- suggest-ultrathink: Recommend ultrathink mode for complex tasks
- async-agent: Coordinate async sub-agent execution

Security review completed:
- No command injection vulnerabilities
- Safe file path handling with path.join
- Content length limits prevent memory issues
- Minimal dependencies (commander + optional pg)

Updated npm CLI to v0.1.27 with 29 hooks commands.
2025-12-29 01:30:57 +00:00
Claude
c76ee1bd6a
docs: Update README with 34 commands and v2.0.55+ features
- Update command count: 31 → 34 hooks commands
- Add Claude Code v2.0.55+ commands section:
  - lsp-diagnostic for LSP integration
  - suggest-ultrathink for extended reasoning
  - async-agent for parallel sub-agents
2025-12-29 01:19:18 +00:00
Claude
64d1da08c1
chore: Update settings.json to use Rust CLI hooks
Replaced Node.js intelligence layer with native Rust CLI:
- All 7 Claude Code hook types configured
- Added LSP diagnostics matcher (v2.0.55+)
- Added async sub-agent spawn/complete hooks
- Added UserPromptSubmit and Notification hooks
- Added ruvector:* to bash permissions
- Optimized timeouts (1-5s per hook)
2025-12-29 01:08:06 +00:00
Claude
49a8653c18
feat: Add Claude Code v2.0.55+ feature integrations
New commands for latest Claude Code features:
- `lsp-diagnostic` - Process LSP diagnostic events, learn from errors
- `suggest-ultrathink` - Recommend ultrathink mode for complex tasks
- `async-agent` - Coordinate async sub-agent spawn/sync/complete

Hook integrations:
- PostToolUse LSP matcher for diagnostics
- PreToolUse Task matcher spawns async agents
- PostToolUse Task matcher tracks agent completion

Ultrathink detection patterns:
- algorithm, optimize, refactor, debug, performance
- concurrent, async, architecture, security
- cryptograph, distributed, consensus, neural, ml
2025-12-29 01:05:19 +00:00
Claude
0d7dfa0c9c
feat: Add --postgres flag to hooks init for automatic schema setup
- Add --postgres flag to `ruvector hooks init` command
- Automatically apply PostgreSQL schema using embedded SQL
- Check for RUVECTOR_POSTGRES_URL or DATABASE_URL environment variable
- Provide helpful error messages and manual instructions if psql unavailable
- Update README with new --postgres flag documentation
2025-12-29 00:54:57 +00:00
Claude
d1e48f2239
fix: Fix postgres feature compilation errors
- Convert serde_json::Value to string for ToSql in remember()
- Parse metadata string back to JSON in recall()
- Pass get_intelligence_path() to Intelligence::new()
- Make get_intelligence_path() public for cross-module access
2025-12-29 00:47:48 +00:00
Claude
26c75dc6a3
docs: Update README with new hooks commands and fix typo
- Fix typo: "neighborsa" → "neighbors"
- Update command count: 29 → 31 hooks commands
- Add new commands to reference: suggest-context, track-notification, pre-compact
- Document --resume flag for session-start
- Document --auto flag for pre-compact
2025-12-28 23:55:41 +00:00
Claude
31f99087d3
feat: Add comprehensive Claude Code hook coverage with optimizations
New hooks added:
- UserPromptSubmit: Inject learned context before processing prompts
- Notification: Track notification patterns
- Task matcher in PreToolUse: Validate agent assignments before spawning

New commands:
- suggest-context: Returns learned patterns for context injection
- track-notification: Records notification events as trajectories

Optimizations:
- Timeout tuning: 1-5s per hook (vs 60s default)
- SessionStart: Separate startup vs resume matchers
- PreCompact: Separate auto vs manual matchers
- Stdin JSON parsing: Full HookInput struct with all Claude Code fields
- Context injection: HookOutput with additionalContext for PostToolUse

Technical improvements:
- HookInput struct: session_id, tool_input, tool_response, notification_type
- HookOutput struct: additionalContext, permissionDecision for control flow
- try_parse_stdin(): Non-blocking JSON parsing from stdin
- output_context_injection(): Helper for PostToolUse context injection

Now covers all 7 Claude Code hook types with optimized timeouts.
2025-12-28 21:59:05 +00:00
Claude
7fa4510213
fix: Add missing Stop and PreCompact hooks to init
- Add PreToolUse hook for Bash commands (pre-command)
- Add Stop hook for session-end with --export-metrics
- Add PreCompact hook to preserve memories before context compaction
- Update README with complete hooks table showing all 5 hooks

Now covers all Claude Code hook events:
- PreToolUse (Edit/Write/MultiEdit, Bash)
- PostToolUse (Edit/Write/MultiEdit, Bash)
- SessionStart
- Stop
- PreCompact
2025-12-28 21:52:50 +00:00
Claude
5b1996ad30
docs: Add technical details and architecture to Hooks section
- Add ASCII architecture diagram showing data flow
- Add Claude Code event integration explanation (PreToolUse, PostToolUse, SessionStart)
- Add Technical Specifications table (Q-Learning params, embeddings, cache, compression)
- Add Performance metrics table (lookup times, compression ratios)
- Expand Core Capabilities with technical implementation details
- Add Supported Error Codes table for Rust, TypeScript, Python, Go
- Document batch saves, shell completions features
2025-12-28 21:40:05 +00:00
Claude
b21f2078bf
docs: Add simpler introduction for Self-Learning Hooks
Explain the value proposition in plain language:
- AI assistants start fresh every session
- RuVector Hooks gives them memory and intuition
- Four key benefits: remembers, learns, predicts, coordinates
2025-12-28 21:23:26 +00:00
Claude
3ba8d2da48
docs: Add Self-Learning Intelligence Hooks section to README
- Add hooks introduction with feature overview
- Add QuickStart guide for both Rust and npm CLI
- Add complete commands reference (29 Rust, 26 npm commands)
- Add Tutorial: Claude Code Integration with settings.json example
- Add Tutorial: Swarm Coordination with agent registration and task distribution
- Add PostgreSQL storage documentation for production deployments
- Update main QuickStart section with hooks install commands

Features documented:
- Q-Learning based agent routing
- Semantic vector memory (64-dim embeddings)
- Error pattern learning and fix suggestions
- File sequence prediction
- Multi-agent swarm coordination
- LRU cache optimization (~10x faster)
- Gzip compression (70-83% savings)
2025-12-28 21:21:43 +00:00
Claude
b340971d65
Merge origin/main into claude/implement-hooks-docs-FXQ35
Resolves merge conflicts in .claude/intelligence/data/ files by keeping
feature branch changes (auto-generated learning data).

Brings in new features from main:
- ruvector-nervous-system crate (HDC, Hopfield, plasticity)
- Dendritic computation modules
- Event bus implementation
- Pattern separation algorithms
- Workspace routing
2025-12-28 20:39:25 +00:00
github-actions[bot]
0cb020e640 chore: Update NAPI-RS binaries for all platforms
Built from commit 5a8802b9b4

  Platforms updated:
  - linux-x64-gnu
  - linux-arm64-gnu
  - darwin-x64
  - darwin-arm64
  - win32-x64-msvc

  🤖 Generated by GitHub Actions
2025-12-28 15:34:40 +00:00
rUv
5a8802b9b4
Merge pull request #88 from ruvnet/claude/nervous-system-architecture-t57JG 2025-12-28 10:29:05 -05:00
Claude
84bda9cc98
feat(nervous-system): Add Tier 4 SOTA examples and improve documentation
Add 4 cutting-edge research examples:
- t4_neuromorphic_rag: Coherence-gated retrieval for LLM memory with 100x
  compute reduction when predictions are confident
- t4_agentic_self_model: Agent that models its own cognitive state, knows
  when it's capable, and makes task acceptance decisions
- t4_collective_dreaming: Swarm consolidation during downtime with
  hippocampal replay and cross-agent memory transfer
- t4_compositional_hdc: Zero-shot concept composition via HDC binding
  operations including analogy solving (king-man+woman=queen)

Improve README with:
- Clearer, more accessible introduction
- Mermaid diagrams for architecture visualization
- Better layer-by-layer feature descriptions
- Complete Tier 1-4 example listings
- Data flow sequence diagram
- Updated scorecard metrics section
2025-12-28 15:23:15 +00:00
Claude
fbdc349a76
refactor(examples): Consolidate tier examples into unified folder
Reorganized all application tier examples into a single `tiers/` folder
with consistent prefixed naming:

Tier 1 (Practical):
- t1_anomaly_detection: Infrastructure anomaly detection
- t1_edge_autonomy: Drone/vehicle autonomy
- t1_medical_wearable: Medical monitoring

Tier 2 (Transformative):
- t2_self_optimizing: Self-stabilizing software
- t2_swarm_intelligence: Distributed IoT coordination
- t2_adaptive_simulation: Digital twins

Tier 3 (Exotic):
- t3_self_awareness: Machine self-sensing
- t3_synthetic_nervous: Environment-as-organism
- t3_bio_machine: Prosthetics integration

Benefits:
- Easier navigation with alphabetical tier grouping
- Consistent naming convention (t1_, t2_, t3_ prefixes)
- Single folder reduces directory clutter
- Updated Cargo.toml and README.md to match
2025-12-28 15:07:41 +00:00
Claude
4b52a36a2a
feat(nervous-system): Add security hardening and restraint metrics
Security Fixes:
- Fix division by zero in temporal/hybrid sharding (window_size validation)
- Fix panic in KWTALayer::select when threshold filters all candidates
- Add size > 0 validation to WTALayer constructor
- Document SPSC constraints on lock-free EventRingBuffer

Cost Reduction Features:
- HysteresisTracker: Require N consecutive ticks above threshold before
  triggering modulation, preventing flapping on noisy signals
- BudgetGuardrail: Auto-decelerate when hourly spend exceeds budget,
  multiplying duty factor by reduction coefficient

Metrics Scorecard:
- Add write amplification tracking (memory_writes / meaningful_events)
- Add NervousSystemScorecard with health checks and scoring
- Add ScorecardTargets for configurable thresholds
- Five key metrics: silence ratio, TTD P50/P95, energy/spike,
  write amplification, calmness index

Philosophy: Time awareness is not about intelligence.
It is about restraint. Systems that stay quiet, wait,
and then react with intent.

Tests: 359 passing, 82 doc tests passing
2025-12-28 15:02:45 +00:00
Claude
91e88abdbc
feat(nervous-system): Security hardening + NervousSystemMetrics
Security Fixes (NaN panics):
- Fix partial_cmp().unwrap() → unwrap_or(Ordering::Less) throughout
- hdc/memory.rs: NaN-safe similarity sorting
- hdc/similarity.rs: NaN-safe top_k_similar sorting
- hopfield/network.rs: NaN-safe attention sorting
- routing/workspace.rs: NaN-safe salience sorting

Security Fixes (Division by zero):
- hopfield/retrieval.rs: Guard softmax against underflow (sum ≤ ε)

CircadianController Enhancements:
- PhaseModulation: Deterministic velocity nudging from external signals
  - accelerate(factor): Speed up towards active phase
  - decelerate(factor): Slow down, extend rest
  - nudge_forward(radians): Direct phase offset
- Monotonic decisions: Latched within phase window (no flapping)
  - should_compute(), should_learn(), should_consolidate() now latch
  - Latches reset on phase boundary transition
- peek_compute(), peek_learn(): Inspect without latching

NervousSystemMetrics Scorecard:
- silence_ratio(): 1 - (active_ticks / total_ticks)
- ttd_p50(), ttd_p95(): Time to decision percentiles
- energy_per_spike(): Normalized efficiency
- calmness_index(hours): exp(-spikes_per_hour / baseline)
- ttd_exceeds_budget(us): Alert on latency regression

Philosophy:
> Time awareness is not about intelligence. It is about restraint.
> And restraint is where almost all real-world AI costs are hiding.

Test Results:
- 82 doc tests pass (was 81)
- 359 lib tests pass
2025-12-28 14:51:03 +00:00
Claude
81b22c4bbd
feat(nervous-system): Add CircadianController and fix all doc tests
Doc Test Fixes:
- Fix WTALayer doc test (size mismatch: 100 -> 5 neurons)
- Fix Hopfield capacity doc test (2^64 overflow -> use dim=32)
- Fix BTSP one-shot learning formula (divide by sum(x²) not n)
- Export bind_multiple, invert, permute from HDC ops
- Export SparseProjection, SparseBitVector from lib root

CircadianController (new):
- SCN-inspired temporal gating for cost reduction
- 5-50x compute savings through phase-aligned duty cycling
- 4 phases: Active, Dawn, Dusk, Rest
- Gated learning (should_learn) and consolidation (should_consolidate)
- Light-based entrainment for external synchronization
- CircadianScheduler for automatic task queuing
- 7 unit tests passing

Key insight: "Time awareness is not about intelligence.
It is about restraint."

Test Results:
- 81 doc tests pass (was 77)
- 359 lib tests pass (was 352)
- All 7 circadian tests pass
2025-12-28 14:37:04 +00:00