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

@ -7,10 +7,10 @@
* 3. Production quality (no errors, proper returns)
*
* APIs tested:
* - brain.add(), brain.get(), brain.update(), brain.delete()
* - brain.add(), brain.get(), brain.update(), brain.remove()
* - brain.find(), brain.similar()
* - brain.relate(), brain.getRelations(), brain.unrelate()
* - brain.addMany(), brain.updateMany(), brain.deleteMany(), brain.relateMany()
* - brain.relate(), brain.related(), brain.unrelate()
* - brain.addMany(), brain.updateMany(), brain.removeMany(), brain.relateMany()
* - vfs.* (init, mkdir, writeFile, readdir, readFile, stat, exists)
* - neural.* (similar, neighbors, outliers)
* - import.* (would test if CSV/Excel/PDF available)
@ -113,12 +113,12 @@ describe('Comprehensive All-APIs Test', () => {
console.log(`✅ brain.similar() found ${similar.length} similar entities (no VFS)`)
})
it('brain.delete() - should delete entity', async () => {
await brain.delete(entityId)
it('brain.remove() - should delete entity', async () => {
await brain.remove(entityId)
const deleted = await brain.get(entityId)
expect(deleted).toBeNull()
console.log(`✅ brain.delete() deleted entity`)
console.log(`✅ brain.remove() deleted entity`)
})
})
@ -148,20 +148,20 @@ describe('Comprehensive All-APIs Test', () => {
console.log(`✅ brain.relate() created relation: ${relationId}`)
})
it('brain.getRelations() - should retrieve relationships', async () => {
const relations = await brain.getRelations({
it('brain.related() - should retrieve relationships', async () => {
const relations = await brain.related({
from: entity1Id
})
expect(relations.length).toBeGreaterThan(0)
expect(relations.some(r => r.id === relationId)).toBe(true)
console.log(`✅ brain.getRelations() found ${relations.length} relations`)
console.log(`✅ brain.related() found ${relations.length} relations`)
})
it('brain.unrelate() - should delete relationship', async () => {
await brain.unrelate(relationId)
const relations = await brain.getRelations({
const relations = await brain.related({
from: entity1Id
})
@ -203,7 +203,7 @@ describe('Comprehensive All-APIs Test', () => {
console.log(`✅ brain.relateMany() created ${relationIds.length} relations`)
})
it('brain.deleteMany() - should delete multiple entities', async () => {
it('brain.removeMany() - should delete multiple entities', async () => {
const ids = await brain.addMany({
items: [
{ data: 'Delete 1', type: NounType.Document },
@ -211,12 +211,12 @@ describe('Comprehensive All-APIs Test', () => {
]
})
const result = await brain.deleteMany({
const result = await brain.removeMany({
ids: ids.successful
})
expect(result.successful.length).toBe(2)
console.log(`✅ brain.deleteMany() deleted ${result.successful.length} entities`)
console.log(`✅ brain.removeMany() deleted ${result.successful.length} entities`)
})
})