chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase

This commit is contained in:
David Snelling 2026-06-11 14:51:00 -07:00
parent 970e08c466
commit 1f7e365a4e
237 changed files with 1951 additions and 49413 deletions

View file

@ -120,7 +120,7 @@ describe('EntityIdMapper stability (foundation for 2.4.0)', () => {
const deletedInt = beforeInts[2]
const maxBefore = Math.max(...beforeInts)
await brain.delete(deletedId)
await brain.remove(deletedId)
expect(getInt(deletedId)).toBeUndefined()
const newId = await addEntity('f', 6)

View file

@ -255,14 +255,9 @@ describe('MetadataIndexManager - Phase 1b: Type-Aware Features', { timeout: 120_
})
it('should preload sparse indices for top fields of top types', async () => {
const managerAny = manager as any
// Warm cache
await manager.warmCacheForTopTypes(2)
// Check that sparse indices were loaded (by checking UnifiedCache)
// This is implementation-dependent, so we just verify no errors occurred
expect(true).toBe(true) // If we got here, warming succeeded
// Warming must complete cleanly against populated storage; the cache
// contents are an implementation detail, the contract is clean resolution.
await expect(manager.warmCacheForTopTypes(2)).resolves.toBeUndefined()
})
it('should handle empty database gracefully', async () => {

View file

@ -71,12 +71,14 @@ describe('Mutex Safety Tests', () => {
})
it('should not deadlock with nested different keys', async () => {
let innerRan = false
await mutex.runExclusive('key1', async () => {
await mutex.runExclusive('key2', async () => {
// Should not deadlock
expect(true).toBe(true)
innerRan = true
})
})
// Reaching here at all proves no deadlock; assert the inner body ran.
expect(innerRan).toBe(true)
})
it('should handle errors in exclusive function', async () => {
@ -89,9 +91,11 @@ describe('Mutex Safety Tests', () => {
).rejects.toThrow('Test error')
// Lock should be released, so we can acquire it again
let reacquired = false
await mutex.runExclusive('error-test', async () => {
expect(true).toBe(true)
reacquired = true
})
expect(reacquired).toBe(true)
})
it('should handle high concurrency without resource exhaustion', async () => {