refactor(8.0)!: remove distributed clustering subsystem — inert/orphaned, scale is single-process + native provider

The distributed-clustering subsystem never ran in production: it was inert,
orphaned dead code (faked consensus, stub replication, no live wiring, and it
did not interoperate with the 8.0 Db API). Brainy 8.0 is a single-process
library. Scale is single-process + the optional native provider
(@soulcraft/cortex, on-disk DiskANN to 10B+ vectors) + per-tenant pools +
horizontal read scaling (many reader processes, one writer).

Removed:
- src/distributed/ entirely (coordinator, shardManager, cacheSync,
  readWriteSeparation, queryPlanner, healthMonitor, configManager,
  hashPartitioner, shardMigration, domainDetector, storageDiscovery, http/network
  transports). ReaderMode/HybridMode relocated to src/storage/operationalModes.ts
  (slimmed to the live surface).
- src/types/distributedTypes.ts; config.distributed field + JSDoc;
  coreTypes distributedConfig; memoryStorage distributedConfig persistence.
- DistributedRole enum + src/config/distributedPresets.ts and the orphaned
  src/config/extensibleConfig.ts (config/augmentation registry built on removed
  cloud adapters + distributed presets), plus their src/index.ts re-exports.
- 13 BRAINY_* cluster env vars; the storage setDistributedComponents hook;
  enableDistributedSearch (dead config flag); the metadata partition field;
  the distributed_ reserved key prefix.
- Orphaned src/storage/readOnlyOptimizations.ts (zero importers).
- Tests targeting the subsystem: distributed-demo, distributed-cluster helper,
  distributed-transactions, sharding-transactions.
- Docs: EXTENDING_STORAGE.md (deleted); scrubbed distributed/cluster/Raft/
  shard-manager/multi-node prose from v3-features, enterprise-for-everyone,
  augmentations-actual, complete-feature-list, vfs/README, vfs/ROADMAP,
  vfs/VFS_CORE, capacity-planning, transactions, MIGRATION-V3-TO-V4,
  storage-architecture; reframed scale prose to the 8.0 model.

Kept: src/storage/sharding.ts (local-disk 256-bucket directory sharding via
getShardIdFromUuid — used live by baseStorage, unrelated to clustering);
the multi-process mode: 'reader' | 'writer' roles; semantic/HNSW clustering.

RELEASES.md: added a removed-surfaces row documenting the cut and the 8.0
scale model.
This commit is contained in:
David Snelling 2026-06-15 10:37:39 -07:00
parent f8e0079d3f
commit 00d3203d68
51 changed files with 153 additions and 9889 deletions

View file

@ -73,10 +73,10 @@ import { MemoryStorageAugmentation } from 'brainy'
```
### 11. Server Search Augmentation ✅
Distributed search capabilities.
Server-side search delegation over a conduit.
```typescript
import { ServerSearchConduitAugmentation } from 'brainy'
// Distributed query execution
// Forwards queries to a remote Brainy server
```
### 12. Neural Import Augmentation ✅
@ -100,7 +100,7 @@ await neuralImport.detectRelationships(entities)
await neuralImport.generateInsights(data)
```
### Distributed Operation Modes (Fully Implemented!)
### Operation Modes (Fully Implemented!)
```typescript
// Read-only mode with optimized caching
const readerMode = new ReaderMode()
@ -239,15 +239,10 @@ const cacheConfig = await getCacheAutoConfig()
## 🎨 How to Use Hidden Features
### Enable Distributed Modes
### Enable Reader / Writer Modes
```typescript
const brain = new Brainy({
mode: 'reader', // or 'writer' or 'hybrid'
distributed: {
role: 'reader',
cacheStrategy: 'aggressive',
prefetch: true
}
mode: 'reader' // or 'writer' or 'hybrid'
})
```
@ -285,7 +280,7 @@ const freshStats = await brain.getStatistics({
## 📝 What Needs Documentation
These features EXIST but need better docs:
1. Distributed operation modes
1. Reader / writer operation modes
2. Neural import full API
3. 3-level cache configuration
4. Performance monitoring API
@ -297,7 +292,7 @@ These features EXIST but need better docs:
## 💡 The Truth
Brainy is MORE powerful than its own documentation suggests! Most "missing" features are actually implemented but hidden or not properly exposed. The codebase contains sophisticated systems for:
- Distributed operations
- Reader / writer operation modes
- AI-powered import
- Advanced caching
- Performance monitoring