Root cause: lazyLoadCounts() was reading from stats.nounCount (SERVICE-keyed)
instead of the sparse index (TYPE-keyed), and had a race condition (not awaited).
Changes:
- Fix lazyLoadCounts() to compute counts from 'noun' sparse index
- Move lazyLoadCounts() call from constructor to init() (properly awaited)
- Add getNounCountsByType()/getVerbCountsByType() getters to BaseStorage
- Add regression tests (7 tests)
Fixes Workshop bug where counts.byType({ excludeVFS: true }) returned {}
even when 48 entities existed in the database.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| augmentations | ||
| brainy | ||
| graph | ||
| import | ||
| neural | ||
| storage/cow | ||
| types | ||
| utils | ||
| versioning | ||
| vfs | ||
| brainy-core.unit.test.ts | ||
| brainy-get-optimization.test.ts | ||
| create-entities-default.test.ts | ||
| fieldTypeInference.test.ts | ||
| type-filtering.unit.test.ts | ||
| type-matching.unit.test.ts | ||
| workshop-vfs-diagnostic.test.ts | ||