brainy/src/storage/adapters
David Snelling 01e89fffca fix(storage): resolve persistence restart bug across all storage adapters
Critical bug fix that restores data persistence after application restart for all storage adapters (GCS, S3, OPFS, FileSystem).

**Root Cause:**
Storage adapters were loading entity counts from _system/counts.json but not returning totalCount in pagination methods, causing rebuildIndexesIfNeeded() to see undefined and incorrectly assume no data existed.

**Changes:**
- GCS Storage: Return totalCount in getNodesWithPagination() and getVerbsWithPagination()
- S3 Storage: Call initializeCounts() in init() and return totalCount in pagination methods
- OPFS Storage: Call initializeCounts() in init() to load pre-calculated counts
- BaseStorage: Add defensive validation to prevent future adapters from missing totalCount

**Impact:**
- Production deployments now work correctly (Cloud Run, AWS, Kubernetes)
- Data persists correctly across container restarts
- Serverless scale-to-zero deployments now functional
- All storage adapters use O(1) pre-calculated counts (scales to millions of entities)

**Testing:**
- Build passes with no TypeScript errors
- All existing tests pass
- Defensive validation ensures future storage adapters won't have this bug

Fixes critical production issue affecting all persistent storage deployments.
2025-10-09 15:07:18 -07:00
..
baseStorageAdapter.ts fix: metadata batch reading from correct directory 2025-10-06 15:43:45 -07:00
batchS3Operations.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
fileSystemStorage.ts fix: resolve 5 critical import bugs for production scale 2025-10-09 13:56:45 -07:00
gcsStorage.ts fix(storage): resolve persistence restart bug across all storage adapters 2025-10-09 15:07:18 -07:00
memoryStorage.ts fix: move metadata routing to base class, fix GCS/S3 system key crashes 2025-10-09 13:10:06 -07:00
opfsStorage.ts fix(storage): resolve persistence restart bug across all storage adapters 2025-10-09 15:07:18 -07:00
optimizedS3Search.ts 🧠 Brainy 2.0.0 - Zero-Configuration AI Database with Triple Intelligence™ 2025-08-26 12:32:21 -07:00
s3CompatibleStorage.ts fix(storage): resolve persistence restart bug across all storage adapters 2025-10-09 15:07:18 -07:00