Commit Graph

3 Commits

Author SHA1 Message Date
Dragan Spiridonov eebb76731e feat: implement RuVector Phase 5 Milestones 3-4 — Scale, Optimization & Advanced Learning (ADR-087)
Milestone 3 — Scale & Optimization (R7-R10):
- R7: Meta-learning enhancements (DecayingBeta, PlateauDetector with CUSUM,
  ParetoFront, CuriosityBonus) wired into DomainTransferEngine
- R8: PageRank pattern importance solver with citation graph pipeline
  (PatternCitationGraph bootstraps from 129 existing patterns, blended
  scoring in pattern-promotion.ts)
- R9: Spectral graph sparsifier (degree-based leverage heuristic) wired
  into mincut-wrapper.ts as optional preprocessing
- R10: Reservoir replay buffer with coherence-gated admission and CUSUM
  drift detection, wired into ExperienceReplay (write + read paths)

Milestone 4 — Advanced Learning (R11-R12):
- R11: E-prop online learning (12 bytes/synapse, eligibility traces,
  feedback alignment) — RL algorithm #10, extends BaseRLAlgorithm
- R12: Granger causality for test failure prediction (VAR + F-test with
  full statistical math) wired into defect-intelligence coordinator with
  persistent history accumulation

Infrastructure:
- 8 feature flags (all default true per opt-out policy), convenience
  functions, env var support, CLI descriptions
- RLAlgorithmType union: 9 → 10 members (added 'eprop')
- ADR-087 status: Proposed → Active (M1-4 complete)
- 234 new tests across 8 test files, all passing
- Performance benchmarks for PageRank, sparsification, reservoir admission
- 0 regressions in existing test suite

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 17:41:06 +00:00
Dragan Spiridonov 19ba1a8fb7 feat: implement RuVector Phase 5 Milestone 2 — Graph Learning (ADR-087)
Implements R4 (GraphMAE), R5 (Modern Hopfield), R6 (Cold-Tier GNN) with
full integration wiring into pattern-store and code-intelligence domains.

R4 GraphMAE Self-Supervised Learning:
- SPSA optimizer for gradient-free training of masked graph autoencoders
- Decoder head reconstructs features from embeddings (SCE loss, γ=2)
- Per-epoch lossHistory for convergence analysis
- Wired into coordinator-gnn.ts:generateGraphMAEEmbeddings()
- 21 tests including 1K-node scale test

R5 Modern Hopfield Networks:
- Exponential-capacity exact pattern recall (Ramsauer 2020)
- L2-normalized patterns for consistent softmax attention
- Dimension-aware singleton, zero-vector rejection
- Wired into pattern-store.ts store()/search() as exact-recall tier
- 28 tests including 10K capacity and <2ms benchmark

R6 Cold-Tier GNN Training:
- LRU-cached mini-batch trainer with memory cap enforcement
- FileBackedGraph for real disk-backed larger-than-RAM graphs
- Unbiased Fisher-Yates shuffle (rejection sampling)
- Wired into coordinator-gnn.ts:trainWithColdTier()
- 25 tests including FileBackedGraph round-trip and mode equivalence

Shared:
- Extracted Xorshift128 PRNG to src/shared/utils/xorshift128.ts
- 3 feature flags (default false) with documented activation criteria
- Barrel exports for all types, classes, and factories

74 new tests, 0 type errors, 0 regressions across 1030 existing tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:02:34 +00:00
Dragan Spiridonov fa28ce6bfa feat: implement RuVector Phase 5 Milestone 1 — Pattern Intelligence (ADR-087)
Adds 4 new capabilities with production wiring, 148 tests, and performance baselines:

- R1: HDC Pattern Fingerprinting — 10K-bit binary hypervectors with O(1) XOR binding,
  wired into PatternStore search as Hamming-distance pre-filter
- R2: CUSUM Drift Detection — two-sided statistical change-point detection across all
  4 coherence gate types (retrieve/write/learn/act), auto-enabled via feature flag
- R3: Delta Event Sourcing — pattern version history with rollback via SQLite
  pattern_deltas table, wired into PatternStore store/recordUsage paths
- EWC++ Activation — three-loop protocol (instantAdapt→recordOutcome→backgroundConsolidate)
  wired in quality-assessment, test-generation, and contract-testing coordinators
  with double-flag guard (useSONAThreeLoop && useEwcPlusPlusRegularization)

Extracts coherence-gate.ts (930 lines) into 4 modules under 500-line limit.
All feature flags default true (opt-out) per amended ADR-087 policy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 11:43:11 +00:00