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

@ -114,7 +114,7 @@ describe('Read-After-Write Consistency (v5.7.2 Bug Fix)', () => {
expect(typeof relationId).toBe('string')
// Verify relationship exists and is correct
const relations = await brain.getRelations(sourceId)
const relations = await brain.related(sourceId)
expect(relations).toHaveLength(1)
expect(relations[0].to).toBe(targetId)
expect(relations[0].type).toBe(VerbType.Contains)
@ -170,7 +170,7 @@ describe('Read-After-Write Consistency (v5.7.2 Bug Fix)', () => {
console.log(`Created 100 relationships in ${Date.now() - relStartTime}ms`)
// Verify all relationships created successfully
const relations = await brain.getRelations(documentId)
const relations = await brain.related(documentId)
expect(relations.length).toBe(100)
// Verify each entity is still queryable
@ -202,7 +202,7 @@ describe('Read-After-Write Consistency (v5.7.2 Bug Fix)', () => {
expect(entity?.metadata?.updated).toBe(true)
})
it('should verify entity is deleted after brain.delete()', async () => {
it('should verify entity is deleted after brain.remove()', async () => {
// Create entity
const entityId = await brain.add({
data: 'Entity to be deleted',
@ -214,7 +214,7 @@ describe('Read-After-Write Consistency (v5.7.2 Bug Fix)', () => {
expect(beforeDelete).not.toBeNull()
// Delete
await brain.delete(entityId)
await brain.remove(entityId)
// Verify it's deleted (should return null)
const afterDelete = await brain.get(entityId)
@ -260,13 +260,13 @@ describe('Read-After-Write Consistency (v5.7.2 Bug Fix)', () => {
await brain.relate({ from: concept2Id, to: concept3Id, type: VerbType.RelatedTo })
// Verify all relationships exist
const docRelations = await brain.getRelations(documentId)
const docRelations = await brain.related(documentId)
expect(docRelations.length).toBe(3)
const concept1Relations = await brain.getRelations(concept1Id)
const concept1Relations = await brain.related(concept1Id)
expect(concept1Relations.length).toBeGreaterThan(0)
const concept2Relations = await brain.getRelations(concept2Id)
const concept2Relations = await brain.related(concept2Id)
expect(concept2Relations.length).toBeGreaterThan(0)
})
@ -325,7 +325,7 @@ describe('Read-After-Write Consistency (v5.7.2 Bug Fix)', () => {
}
// Step 5: Verify relationships exist
const relations = await brain.getRelations(documentId)
const relations = await brain.related(documentId)
expect(relations.length).toBe(10)
})
})