refactor: remove augmentation system and semantic type matching
Remove the entire augmentation pipeline infrastructure (52 files, ~15,000 lines) and the semantic type matching system. These were unused middleware layers adding complexity without value. What was removed: - src/augmentations/ directory (all augmentation implementations) - src/augmentationManager.ts (pipeline orchestrator) - src/types/augmentations.ts, src/types/pipelineTypes.ts - src/shared/default-augmentations.ts - Semantic type suggestion (BrainyTypes.suggestNoun/suggestVerb) - src/utils/typeMatching/ (embedding-based type matcher) What was preserved by relocating: - Import handlers (CSV, PDF, Excel) -> src/importers/handlers/ - NeuralImportAugmentation -> src/cortex/neuralImportAugmentation.ts - Type matching utilities -> heuristic inference in consumers What was simplified: - brainy.ts: operations call storage directly (no execute() wrapper) - IntegrationBase: standalone class (no BaseAugmentation parent) - BrainyTypes: validation-only (nouns, verbs, isValid*, get*) - Pipeline: direct execution (no augmentation interception) - index.ts: removed TypeSuggestion, suggestType exports - package.json: removed stale types/augmentations export Build passes, 1176 tests pass, 0 failures.
This commit is contained in:
parent
ac7a1f772c
commit
d1db3510be
97 changed files with 349 additions and 19705 deletions
|
|
@ -49,11 +49,8 @@ try {
|
|||
test('Memory storage configured', brain.storage && brain.storage.storageType === 'memory')
|
||||
|
||||
console.log('\n📊 API Architecture Validation:')
|
||||
|
||||
// Test 5: Augmentation system structure
|
||||
test('Augmentations system exists', brain.augmentations !== undefined)
|
||||
|
||||
// Test 6: Core properties exist
|
||||
|
||||
// Test 5: Core properties exist
|
||||
test('Index system exists', brain.index !== undefined)
|
||||
test('Storage system exists', brain.storage !== undefined)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,89 +0,0 @@
|
|||
/**
|
||||
* Test script to verify storage augmentation system works
|
||||
*/
|
||||
|
||||
import { Brainy } from '../../dist/index.js'
|
||||
import {
|
||||
MemoryStorageAugmentation,
|
||||
FileSystemStorageAugmentation
|
||||
} from './dist/augmentations/storageAugmentations.js'
|
||||
|
||||
console.log('🧪 Testing Storage Augmentation System')
|
||||
console.log('=' .repeat(50))
|
||||
|
||||
async function test1_ZeroConfig() {
|
||||
console.log('\n1. Zero-Config Test')
|
||||
const brain = new Brainy()
|
||||
await brain.init()
|
||||
|
||||
await brain.add('test', { content: 'Zero-config test' })
|
||||
const results = await brain.search('test', { limit: 1 })
|
||||
|
||||
console.log('✅ Zero-config works:', results.length > 0)
|
||||
await brain.destroy()
|
||||
}
|
||||
|
||||
async function test2_ConfigBased() {
|
||||
console.log('\n2. Config-Based Storage Test')
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
forceMemoryStorage: true
|
||||
}
|
||||
})
|
||||
await brain.init()
|
||||
|
||||
await brain.add('config test', { content: 'Config-based test' })
|
||||
const results = await brain.search('config', { limit: 1 })
|
||||
|
||||
console.log('✅ Config-based works:', results.length > 0)
|
||||
await brain.destroy()
|
||||
}
|
||||
|
||||
async function test3_AugmentationOverride() {
|
||||
console.log('\n3. Augmentation Override Test')
|
||||
const brain = new Brainy()
|
||||
|
||||
// Register storage augmentation BEFORE init
|
||||
brain.augmentations.register(new MemoryStorageAugmentation('test-memory'))
|
||||
|
||||
await brain.init()
|
||||
|
||||
await brain.add('augmentation test', { content: 'Augmentation override test' })
|
||||
const results = await brain.search('augmentation', { limit: 1 })
|
||||
|
||||
console.log('✅ Augmentation override works:', results.length > 0)
|
||||
await brain.destroy()
|
||||
}
|
||||
|
||||
async function test4_BackwardCompatibility() {
|
||||
console.log('\n4. Backward Compatibility Test')
|
||||
|
||||
// Old style with rootDirectory config
|
||||
const brain = new Brainy({
|
||||
storage: {
|
||||
rootDirectory: './test-data',
|
||||
forceFileSystemStorage: true
|
||||
}
|
||||
})
|
||||
|
||||
await brain.init()
|
||||
console.log('✅ Backward compatible config works')
|
||||
await brain.destroy()
|
||||
}
|
||||
|
||||
async function runAllTests() {
|
||||
try {
|
||||
await test1_ZeroConfig()
|
||||
await test2_ConfigBased()
|
||||
await test3_AugmentationOverride()
|
||||
await test4_BackwardCompatibility()
|
||||
|
||||
console.log('\n' + '='.repeat(50))
|
||||
console.log('✅ ALL STORAGE AUGMENTATION TESTS PASSED!')
|
||||
} catch (error) {
|
||||
console.error('❌ Test failed:', error)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
runAllTests()
|
||||
Loading…
Add table
Add a link
Reference in a new issue