CHECKPOINT: Brainy 2.0 API refactor - pre-fixes state
Current state: - Unified augmentation system to BrainyAugmentation interface - Changed methods to specific noun/verb naming (addNoun, getNoun, etc) - Made old methods private - Combined getNouns into single unified method - Neural API exists and is complete - Triple Intelligence uses correct Brainy operators (not MongoDB) Issues identified: - Documentation incorrectly shows MongoDB operators (code is correct) - Need to ensure all features are properly exposed - Need to verify nothing was lost in simplification This commit serves as a rollback point before applying fixes.
This commit is contained in:
commit
26c7d61185
279 changed files with 177945 additions and 0 deletions
55
test-env-flag.ts
Normal file
55
test-env-flag.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/env tsx
|
||||
|
||||
import { HybridModelManager } from './src/utils/hybridModelManager.js'
|
||||
|
||||
async function testEnvironmentFlag() {
|
||||
console.log('Testing BRAINY_ALLOW_REMOTE_MODELS=false flag...')
|
||||
|
||||
// Test with flag set to false
|
||||
process.env.BRAINY_ALLOW_REMOTE_MODELS = 'false'
|
||||
console.log(`Set BRAINY_ALLOW_REMOTE_MODELS=${process.env.BRAINY_ALLOW_REMOTE_MODELS}`)
|
||||
|
||||
try {
|
||||
const manager = new HybridModelManager()
|
||||
const model = await manager.getPrimaryModel()
|
||||
|
||||
console.log('✅ Model options:')
|
||||
console.log(` localFilesOnly: ${model.options?.localFilesOnly}`)
|
||||
console.log(` model: ${model.options?.model}`)
|
||||
console.log(` cacheDir: ${model.options?.cacheDir}`)
|
||||
|
||||
if (model.options?.localFilesOnly === true) {
|
||||
console.log('✅ SUCCESS: BRAINY_ALLOW_REMOTE_MODELS=false is working correctly!')
|
||||
} else {
|
||||
console.log('❌ FAILURE: localFilesOnly should be true when BRAINY_ALLOW_REMOTE_MODELS=false')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Error testing flag:', error.message)
|
||||
}
|
||||
|
||||
console.log('\n' + '='.repeat(50))
|
||||
|
||||
// Test with flag set to true
|
||||
process.env.BRAINY_ALLOW_REMOTE_MODELS = 'true'
|
||||
console.log(`Set BRAINY_ALLOW_REMOTE_MODELS=${process.env.BRAINY_ALLOW_REMOTE_MODELS}`)
|
||||
|
||||
try {
|
||||
const manager = new HybridModelManager()
|
||||
const model = await manager.getPrimaryModel()
|
||||
|
||||
console.log('✅ Model options:')
|
||||
console.log(` localFilesOnly: ${model.options?.localFilesOnly}`)
|
||||
|
||||
if (model.options?.localFilesOnly === false) {
|
||||
console.log('✅ SUCCESS: BRAINY_ALLOW_REMOTE_MODELS=true is working correctly!')
|
||||
} else {
|
||||
console.log('❌ FAILURE: localFilesOnly should be false when BRAINY_ALLOW_REMOTE_MODELS=true')
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Error testing flag:', error.message)
|
||||
}
|
||||
}
|
||||
|
||||
testEnvironmentFlag().catch(console.error)
|
||||
Loading…
Add table
Add a link
Reference in a new issue