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>
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>