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
JavaScript
// 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