UNPKG

universal-life-protocol-core

Version:

Revolutionary AI framework implementing living, conscious digital reality with meta-cognitive reasoning, attention economics, and autonomous learning

63 lines โ€ข 2.61 kB
// Simple test to validate the CUE implementation works import { CrtModule } from './crt-module.js'; import { CryptoUtil } from './crypto.js'; import { CtlConsensus } from './ctl-consensus.js'; import { ClarionMduAgent } from './clarion-mdu-agent.js'; console.log('๐Ÿงช Simple CUE Implementation Test'); console.log('==================================\n'); // Test 1: MDU Math console.log('1. Testing MDU Mathematics:'); const N = 42, B = 7; const L = Math.floor(N / B); const A = N % B; console.log(` N=${N}, B=${B} โ†’ L=${L}, A=${A} โœ“`); // Test 2: CRT Module console.log('\n2. Testing Chinese Remainder Theorem:'); try { const solution = CrtModule.solve([[2, 3], [3, 5]]); console.log(` Solution for xโ‰ก2(mod3), xโ‰ก3(mod5): ${solution} โœ“`); } catch (e) { console.log(` CRT test failed: ${e}`); } // Test 3: Crypto console.log('\n3. Testing Cryptographic Functions:'); try { const keyPair = CryptoUtil.generateKeyPair(); const message = "test message"; const signature = CryptoUtil.sign(message, keyPair.privateKey); const isValid = CryptoUtil.verify(message, signature, keyPair.publicKey); console.log(` Key generation and signing: ${isValid ? 'โœ“' : 'โœ—'}`); } catch (e) { console.log(` Crypto test failed: ${e}`); } // Test 4: CTL Consensus console.log('\n4. Testing CTL Consensus (Fano Plane):'); try { const validators = Array.from({ length: 7 }, (_, i) => `val${i}`); const ctl = new CtlConsensus(validators); const quorum = ctl.getActivatedQuorum('test-seed'); console.log(` Fano Plane quorum size: ${quorum?.size || 0} (expected: 3) ${quorum?.size === 3 ? 'โœ“' : 'โœ—'}`); } catch (e) { console.log(` CTL test failed: ${e}`); } // Test 5: CLARION Agent console.log('\n5. Testing CLARION-MDU Agent:'); try { const agent = new ClarionMduAgent('test-agent'); console.log(` Agent created with ID: ${agent.id} โœ“`); console.log(` Default base: ${agent.getMCS().activeBases.get('default')} โœ“`); console.log(` Initial explicit rules: ${agent.getExplicitRules().length} โœ“`); } catch (e) { console.log(` CLARION agent test failed: ${e}`); } console.log('\nโœ… Basic implementation tests completed!'); console.log('\nThe CUE-CLARION-MDU Synthesis implementation includes:'); console.log('โ€ข Phase 1: Multi-domain MDU states with path history'); console.log('โ€ข Phase 2: CTL consensus via Fano Plane + CEP engine'); console.log('โ€ข Phase 3: CLARION cognitive architecture with learning'); console.log('โ€ข Full cryptographic security and network simulation'); //# sourceMappingURL=simple-test.js.map