zeropoint-node 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -105
- package/dist/__tests__/api/ProductionAPI.test.js +20 -0
- package/dist/__tests__/artifacts/ArtifactRegistry.test.js +248 -0
- package/dist/__tests__/basic.test.js +104 -0
- package/dist/__tests__/config/constants.test.js +20 -0
- package/dist/__tests__/consciousness/ConsciousnessField.test.js +20 -0
- package/dist/__tests__/consciousness/SelfEvolvingConsciousness.test.js +185 -0
- package/dist/__tests__/core/AbstractField.test.js +81 -0
- package/dist/__tests__/core/CoilMixin.test.js +20 -0
- package/dist/__tests__/core/CoilSystem.test.js +20 -0
- package/dist/__tests__/core/ComplianceSystem.test.js +141 -0
- package/dist/__tests__/core/InfiniteDimensionalRefactor.test.js +258 -0
- package/dist/__tests__/core/LivingAdapter.test.js +31 -0
- package/dist/__tests__/core/MathUtils.test.js +20 -0
- package/dist/__tests__/core/NetworkNode.test.js +20 -0
- package/dist/__tests__/core/Observer.test.js +20 -0
- package/dist/__tests__/core/OperationRegistry.test.js +48 -0
- package/dist/__tests__/core/PatternRecognition.test.js +20 -0
- package/dist/__tests__/core/PatternRegistry.test.js +20 -0
- package/dist/__tests__/core/ScientificCompliance.test.js +58 -0
- package/dist/__tests__/core/SharedConstants.test.js +20 -0
- package/dist/__tests__/core/UnifiedMetaphysicalInterface.test.js +20 -0
- package/dist/__tests__/core/UnifiedSystem.test.js +20 -0
- package/dist/__tests__/core/UnifiedTypes.test.js +20 -0
- package/dist/__tests__/core/UnifiedVoidEquations.test.js +20 -0
- package/dist/__tests__/core/VortexMathAdapter.test.js +31 -0
- package/dist/__tests__/core/ZeroPoint.test.js +71 -0
- package/dist/__tests__/core/ZeroPointSystem.test.js +219 -0
- package/dist/__tests__/emergence/patterns.test.js +20 -0
- package/dist/__tests__/field/EmergenceLedger.test.js +20 -0
- package/dist/__tests__/field/ObserverAwareField.test.js +20 -0
- package/dist/__tests__/field/ResonanceConsensus.test.js +20 -0
- package/dist/__tests__/git-integration.test.js +201 -0
- package/dist/__tests__/globalSetup.js +80 -0
- package/dist/__tests__/globalTeardown.js +28 -0
- package/dist/__tests__/index.test.js +20 -0
- package/dist/__tests__/integration/ZeroPointIntegration.test.js +221 -0
- package/dist/__tests__/integrity/FieldIntegrity.test.js +20 -0
- package/dist/__tests__/knowledge/KnowledgeSystem.test.js +158 -0
- package/dist/__tests__/knowledge/KnowledgeSystemAnalysis.test.js +219 -0
- package/dist/__tests__/knowledge/KnowledgeSystemAutoGenerated.test.js +41 -0
- package/dist/__tests__/laws/MetaphysicalLawRegistry.test.js +183 -0
- package/dist/__tests__/living/LivingTestOrganism.js +246 -0
- package/dist/__tests__/living/LivingTestOrganism.test.js +124 -0
- package/dist/__tests__/math/AdvancedVBM.test.js +367 -0
- package/dist/__tests__/math/FlowerOfLife.test.js +344 -0
- package/dist/__tests__/math/FractalColorSystem.test.js +20 -0
- package/dist/__tests__/math/FractalMath.test.js +20 -0
- package/dist/__tests__/math/MathUtils.test.js +20 -0
- package/dist/__tests__/math/RodinCoil.test.js +20 -0
- package/dist/__tests__/math/ToroidalGeometry.test.js +20 -0
- package/dist/__tests__/math/VBM.test.js +538 -0
- package/dist/__tests__/math/VBMColorSystem.test.js +20 -0
- package/dist/__tests__/math/VortexMath.test.js +20 -0
- package/dist/__tests__/math/ZeroUnity.test.js +77 -0
- package/dist/__tests__/monitoring/HealthMonitor.test.js +20 -0
- package/dist/__tests__/performance/ZeroPointPerformance.test.js +371 -0
- package/dist/__tests__/physics/PlasmaCosmology.test.js +155 -0
- package/dist/__tests__/pwa/ConsciousnessPWA.test.js +20 -0
- package/dist/__tests__/qa/AutoGeneratedFromQA.test.js +195 -0
- package/dist/__tests__/qa/QAAsSourceOfTruth.test.js +69 -0
- package/dist/__tests__/setup.js +132 -0
- package/dist/__tests__/simple.test.js +51 -0
- package/dist/__tests__/stimulus/Application.test.js +272 -0
- package/dist/__tests__/stimulus/BaseController.test.js +198 -0
- package/dist/__tests__/stimulus/ControllerUtils.test.js +316 -0
- package/dist/__tests__/stimulus/MetaphysicalController.test.js +310 -0
- package/dist/__tests__/stimulus/ZeroPointController.test.js +252 -0
- package/dist/__tests__/training/ConsciousnessTrainingModel.test.js +335 -0
- package/dist/__tests__/types/DeviceConfig.test.js +20 -0
- package/dist/__tests__/types/UnifiedExports.test.js +20 -0
- package/dist/__tests__/unity/FieldUnity.test.js +20 -0
- package/dist/__tests__/utils/Cache.test.js +20 -0
- package/dist/__tests__/utils/GitIntegration.test.js +20 -0
- package/dist/__tests__/utils/Logger.test.js +20 -0
- package/dist/__tests__/utils/ResourceCleanup.test.js +20 -0
- package/dist/__tests__/utils/errorSimulator.js +40 -0
- package/dist/__tests__/utils/goldenRatioCache.js +36 -0
- package/dist/__tests__/void/VoidSystem.test.js +427 -0
- package/dist/api/ProductionAPI.js +313 -0
- package/dist/artifacts/ArtifactRegistry.js +122 -0
- package/dist/artifacts/CrystalArtifacts.js +106 -0
- package/dist/artifacts/MetaphysicalArtifact.js +75 -0
- package/dist/browser-standalone.js +191 -0
- package/dist/browser.js +157 -0
- package/dist/config/constants.js +57 -0
- package/dist/consciousness/ConsciousnessField.js +55 -0
- package/dist/consciousness/SelfEvolvingConsciousness.js +303 -0
- package/dist/core/AbstractField.js +30 -0
- package/dist/core/BrowserNetworkNode.js +309 -0
- package/dist/core/CoilMixin.js +216 -0
- package/dist/core/CoilSystem.js +204 -0
- package/dist/core/ComplianceSystem.js +291 -0
- package/dist/core/Dimension.js +2 -0
- package/dist/core/DimensionRegistry.js +141 -0
- package/dist/core/Field.js +2 -0
- package/dist/core/InfiniteDimensionalRefactor.js +389 -0
- package/dist/core/KnowledgeRegistry.js +273 -0
- package/dist/core/LivingAdapter.js +29 -0
- package/dist/core/MathUtils.js +297 -0
- package/dist/core/NetworkNode.js +348 -0
- package/dist/core/Observer.js +101 -0
- package/dist/core/Operation.js +59 -0
- package/dist/core/OperationRegistry.js +20 -0
- package/dist/core/Pattern.js +2 -0
- package/dist/core/PatternRecognition.js +493 -0
- package/dist/core/PatternRegistry.js +282 -0
- package/dist/core/ScientificCompliance.js +91 -0
- package/dist/core/SharedConstants.js +306 -0
- package/dist/core/UnifiedMetaphysicalInterface.js +533 -0
- package/dist/core/UnifiedSystem.js +317 -0
- package/dist/core/UnifiedTypes.js +5 -0
- package/dist/core/UnifiedVoidEquations.js +605 -0
- package/dist/core/VoidMatterConstants.js +9 -0
- package/dist/core/VortexMathAdapter.js +32 -0
- package/dist/core/ZeroPoint.js +971 -0
- package/dist/core/ZeroPointSystem.js +343 -0
- package/dist/core/applyLaws.js +12 -0
- package/dist/core/applyOperations.js +21 -0
- package/dist/devices/DeviceRegistry.js +151 -0
- package/dist/devices/ResonanceDevice.js +92 -0
- package/dist/devices/ResonanceDevices.js +139 -0
- package/dist/dimensions/Dimension.js +2 -0
- package/dist/emergence/AdvancedEmergence.js +930 -0
- package/dist/emergence/patterns.js +12 -0
- package/dist/field/EmergenceLedger.js +310 -0
- package/dist/field/ObserverAwareField.js +222 -0
- package/dist/field/ResonanceConsensus.js +330 -0
- package/dist/fields/Field.js +2 -0
- package/dist/geometry/MetatronsCube.js +28 -0
- package/dist/geometry/SacredGeometryPattern.js +15 -0
- package/dist/geometry/SacredGeometryRegistry.js +15 -0
- package/dist/geometry/__tests__/SacredGeometryRegistry.test.js +18 -0
- package/dist/index.js +232 -0
- package/dist/integrity/FieldIntegrity.js +237 -0
- package/dist/knowledge/KnowledgeSystem.js +938 -0
- package/dist/laws/MetaphysicalLaw.js +2 -0
- package/dist/laws/MetaphysicalLawRegistry.js +103 -0
- package/dist/laws/hermeticLaws.js +311 -0
- package/dist/math/AdvancedVBM.js +537 -0
- package/dist/math/FlowerOfLife.js +256 -0
- package/dist/math/FractalColorSystem.js +239 -0
- package/dist/math/FractalMath.js +187 -0
- package/dist/math/MathUtils.js +289 -0
- package/dist/math/RodinCoil.js +258 -0
- package/dist/math/ToroidalGeometry.js +230 -0
- package/dist/math/VBM.js +718 -0
- package/dist/math/VBMColorSystem.js +301 -0
- package/dist/math/VortexMath.js +170 -0
- package/dist/monitoring/HealthMonitor.js +297 -0
- package/dist/patterns/Pattern.js +2 -0
- package/dist/patterns/SacredGeometryRegistry.js +37 -0
- package/dist/physics/BlackHolePhysics.js +54 -0
- package/dist/physics/ConsciousnessPhysics.js +241 -0
- package/dist/physics/FractalUniverse.js +54 -0
- package/dist/physics/HolographicUniverse.js +54 -0
- package/dist/physics/PlasmaCosmology.js +134 -0
- package/dist/pwa/ConsciousnessPWA.js +300 -0
- package/dist/src/__tests__/globalTeardown.d.ts +10 -8
- package/dist/src/__tests__/globalTeardown.d.ts.map +1 -1
- package/dist/src/__tests__/globalTeardown.js +12 -71
- package/dist/src/__tests__/globalTeardown.js.map +1 -1
- package/dist/src/__tests__/living/LivingTestOrganism.d.ts +4 -0
- package/dist/src/__tests__/living/LivingTestOrganism.d.ts.map +1 -1
- package/dist/src/__tests__/living/LivingTestOrganism.js +8 -0
- package/dist/src/__tests__/living/LivingTestOrganism.js.map +1 -1
- package/dist/src/__tests__/utils/errorSimulator.d.ts +1 -1
- package/dist/src/__tests__/utils/goldenRatioCache.d.ts +1 -1
- package/dist/src/config/constants.d.ts +53 -0
- package/dist/src/config/constants.d.ts.map +1 -0
- package/dist/src/config/constants.js +58 -0
- package/dist/src/config/constants.js.map +1 -0
- package/dist/src/consciousness/ConsciousnessField.d.ts +42 -51
- package/dist/src/consciousness/ConsciousnessField.d.ts.map +1 -1
- package/dist/src/consciousness/ConsciousnessField.js +187 -200
- package/dist/src/consciousness/ConsciousnessField.js.map +1 -1
- package/dist/src/consciousness/SelfEvolvingConsciousness.d.ts +47 -18
- package/dist/src/consciousness/SelfEvolvingConsciousness.d.ts.map +1 -1
- package/dist/src/consciousness/SelfEvolvingConsciousness.js +151 -44
- package/dist/src/consciousness/SelfEvolvingConsciousness.js.map +1 -1
- package/dist/src/core/CoilMixin.d.ts +6 -6
- package/dist/src/core/CoilSystem.d.ts +6 -2
- package/dist/src/core/CoilSystem.d.ts.map +1 -1
- package/dist/src/core/CoilSystem.js +30 -21
- package/dist/src/core/CoilSystem.js.map +1 -1
- package/dist/src/core/InfiniteDimensionalRefactor.d.ts +145 -0
- package/dist/src/core/InfiniteDimensionalRefactor.d.ts.map +1 -0
- package/dist/src/core/InfiniteDimensionalRefactor.js +390 -0
- package/dist/src/core/InfiniteDimensionalRefactor.js.map +1 -0
- package/dist/src/core/NetworkNode.d.ts +3 -3
- package/dist/src/core/Observer.d.ts +12 -9
- package/dist/src/core/Observer.d.ts.map +1 -1
- package/dist/src/core/Observer.js +2 -2
- package/dist/src/core/Observer.js.map +1 -1
- package/dist/src/core/PatternRecognition.d.ts +63 -13
- package/dist/src/core/PatternRecognition.d.ts.map +1 -1
- package/dist/src/core/PatternRecognition.js +162 -88
- package/dist/src/core/PatternRecognition.js.map +1 -1
- package/dist/src/core/PatternRegistry.d.ts +99 -0
- package/dist/src/core/PatternRegistry.d.ts.map +1 -0
- package/dist/src/core/PatternRegistry.js +283 -0
- package/dist/src/core/PatternRegistry.js.map +1 -0
- package/dist/src/core/SharedConstants.d.ts +62 -9
- package/dist/src/core/SharedConstants.d.ts.map +1 -1
- package/dist/src/core/SharedConstants.js +83 -21
- package/dist/src/core/SharedConstants.js.map +1 -1
- package/dist/src/core/UnifiedMetaphysicalInterface.d.ts +173 -0
- package/dist/src/core/UnifiedMetaphysicalInterface.d.ts.map +1 -0
- package/dist/src/core/UnifiedMetaphysicalInterface.js +534 -0
- package/dist/src/core/UnifiedMetaphysicalInterface.js.map +1 -0
- package/dist/src/core/UnifiedSystem.d.ts +15 -12
- package/dist/src/core/UnifiedSystem.d.ts.map +1 -1
- package/dist/src/core/UnifiedSystem.js +5 -1
- package/dist/src/core/UnifiedSystem.js.map +1 -1
- package/dist/src/core/UnifiedTypes.d.ts +193 -0
- package/dist/src/core/UnifiedTypes.d.ts.map +1 -0
- package/dist/src/core/UnifiedTypes.js +6 -0
- package/dist/src/core/UnifiedTypes.js.map +1 -0
- package/dist/src/core/UnifiedVoidEquations.d.ts +3 -1
- package/dist/src/core/UnifiedVoidEquations.d.ts.map +1 -1
- package/dist/src/core/UnifiedVoidEquations.js +84 -0
- package/dist/src/core/UnifiedVoidEquations.js.map +1 -1
- package/dist/src/core/ZeroPoint.d.ts +101 -10
- package/dist/src/core/ZeroPoint.d.ts.map +1 -1
- package/dist/src/core/ZeroPoint.js +262 -18
- package/dist/src/core/ZeroPoint.js.map +1 -1
- package/dist/src/emergence/AdvancedEmergence.d.ts +19 -16
- package/dist/src/emergence/AdvancedEmergence.d.ts.map +1 -1
- package/dist/src/emergence/AdvancedEmergence.js +88 -52
- package/dist/src/emergence/AdvancedEmergence.js.map +1 -1
- package/dist/src/field/EmergenceLedger.d.ts +9 -18
- package/dist/src/field/EmergenceLedger.d.ts.map +1 -1
- package/dist/src/field/EmergenceLedger.js +9 -4
- package/dist/src/field/EmergenceLedger.js.map +1 -1
- package/dist/src/field/ObserverAwareField.d.ts +69 -65
- package/dist/src/field/ObserverAwareField.d.ts.map +1 -1
- package/dist/src/field/ObserverAwareField.js +158 -168
- package/dist/src/field/ObserverAwareField.js.map +1 -1
- package/dist/src/field/ResonanceConsensus.d.ts +4 -11
- package/dist/src/field/ResonanceConsensus.d.ts.map +1 -1
- package/dist/src/field/ResonanceConsensus.js +15 -10
- package/dist/src/field/ResonanceConsensus.js.map +1 -1
- package/dist/src/index.d.ts +5 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +19 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/integrity/FieldIntegrity.d.ts +3 -8
- package/dist/src/integrity/FieldIntegrity.d.ts.map +1 -1
- package/dist/src/integrity/FieldIntegrity.js.map +1 -1
- package/dist/src/knowledge/KnowledgeSystem.d.ts +37 -55
- package/dist/src/knowledge/KnowledgeSystem.d.ts.map +1 -1
- package/dist/src/knowledge/KnowledgeSystem.js +281 -589
- package/dist/src/knowledge/KnowledgeSystem.js.map +1 -1
- package/dist/src/math/AdvancedVBM.d.ts +6 -6
- package/dist/src/math/FractalColorSystem.d.ts +1 -1
- package/dist/src/math/FractalColorSystem.js +3 -3
- package/dist/src/math/FractalColorSystem.js.map +1 -1
- package/dist/src/math/FractalMath.d.ts +9 -1
- package/dist/src/math/FractalMath.d.ts.map +1 -1
- package/dist/src/math/FractalMath.js +18 -5
- package/dist/src/math/FractalMath.js.map +1 -1
- package/dist/src/math/MathUtils.d.ts +3 -10
- package/dist/src/math/MathUtils.d.ts.map +1 -1
- package/dist/src/math/MathUtils.js +12 -20
- package/dist/src/math/MathUtils.js.map +1 -1
- package/dist/src/math/ToroidalGeometry.d.ts +1 -1
- package/dist/src/math/VBM.d.ts +2 -2
- package/dist/src/math/VortexMath.d.ts +1 -1
- package/dist/src/monitoring/HealthMonitor.d.ts +1 -1
- package/dist/src/monitoring/HealthMonitor.d.ts.map +1 -1
- package/dist/src/monitoring/HealthMonitor.js +29 -27
- package/dist/src/monitoring/HealthMonitor.js.map +1 -1
- package/dist/src/types/UnifiedExports.d.ts +4 -0
- package/dist/src/types/UnifiedExports.d.ts.map +1 -0
- package/dist/src/types/UnifiedExports.js +21 -0
- package/dist/src/types/UnifiedExports.js.map +1 -0
- package/dist/src/unity/FieldUnity.d.ts +1 -1
- package/dist/src/utils/Cache.d.ts +2 -2
- package/dist/src/utils/Cache.d.ts.map +1 -1
- package/dist/src/utils/Cache.js +7 -4
- package/dist/src/utils/Cache.js.map +1 -1
- package/dist/src/utils/GitIntegration.d.ts +1 -1
- package/dist/src/utils/Logger.d.ts +7 -7
- package/dist/src/utils/Logger.d.ts.map +1 -1
- package/dist/src/utils/Logger.js +5 -1
- package/dist/src/utils/Logger.js.map +1 -1
- package/dist/src/utils/ResourceCleanup.d.ts +33 -0
- package/dist/src/utils/ResourceCleanup.d.ts.map +1 -0
- package/dist/src/utils/ResourceCleanup.js +83 -0
- package/dist/src/utils/ResourceCleanup.js.map +1 -0
- package/dist/src/void/VoidSystem.d.ts +18 -18
- package/dist/stimulus/application.js +148 -0
- package/dist/stimulus/base/BaseController.js +141 -0
- package/dist/stimulus/controllers/MetaphysicalController.js +105 -0
- package/dist/stimulus/controllers/ZeroPointController.js +85 -0
- package/dist/stimulus/types/ControllerTypes.js +18 -0
- package/dist/stimulus/utils/ControllerUtils.js +192 -0
- package/dist/stimulus-entry.js +109 -0
- package/dist/training/ConsciousnessTrainingModel.js +301 -0
- package/dist/training/NeuralConsciousnessNetwork.js +311 -0
- package/dist/training/TrainingModelRegistry.js +243 -0
- package/dist/training/index.js +174 -0
- package/dist/types/DeviceConfig.js +29 -0
- package/dist/types/UnifiedExports.js +20 -0
- package/dist/unity/FieldUnity.js +325 -0
- package/dist/utils/BrowserCrypto.js +44 -0
- package/dist/utils/BrowserWebSocket.js +38 -0
- package/dist/utils/Cache.js +263 -0
- package/dist/utils/GitIntegration.js +127 -0
- package/dist/utils/Logger.js +249 -0
- package/dist/utils/ResourceCleanup.js +82 -0
- package/dist/utils/applyLaws.js +6 -0
- package/dist/void/VoidSystem.js +423 -0
- package/docs/API.md +176 -3
- package/docs/CONSCIOUSNESS_EXPANSION.md +369 -0
- package/docs/EVENT_HORIZON_METHODOLOGY.md +274 -0
- package/docs/FLOWER_OF_LIFE.md +300 -0
- package/docs/METAPHYSICAL.md +21 -1
- package/docs/METAPHYSICAL_DEBUGGING.md +493 -0
- package/docs/README.md +117 -15
- package/docs/TESTING_GUIDE.md +430 -0
- package/docs/UNIFIED_CREATORS.md +261 -0
- package/package.json +34 -64
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const ZeroPointController_1 = __importDefault(require("../../stimulus/controllers/ZeroPointController"));
|
|
7
|
+
const ControllerUtils_1 = require("../../stimulus/utils/ControllerUtils");
|
|
8
|
+
// Mock the utilities to avoid DOM dependencies in tests
|
|
9
|
+
jest.mock("../../stimulus/utils/ControllerUtils", () => ({
|
|
10
|
+
UIUtils: {
|
|
11
|
+
safeInnerHTML: jest.fn(),
|
|
12
|
+
safeTextContent: jest.fn(),
|
|
13
|
+
safeClassName: jest.fn(),
|
|
14
|
+
updateElement: jest.fn()
|
|
15
|
+
},
|
|
16
|
+
ResultUtils: {
|
|
17
|
+
formatResultHTML: jest.fn(),
|
|
18
|
+
formatErrorHTML: jest.fn()
|
|
19
|
+
},
|
|
20
|
+
MathUtils: {
|
|
21
|
+
formatNumber: jest.fn()
|
|
22
|
+
}
|
|
23
|
+
}));
|
|
24
|
+
describe('ZeroPointController', () => {
|
|
25
|
+
let controller;
|
|
26
|
+
let mockStatusTarget;
|
|
27
|
+
let mockInsightsTarget;
|
|
28
|
+
let mockDemoOutputTarget;
|
|
29
|
+
let mockConsciousnessTarget;
|
|
30
|
+
let mockVortexMathTarget;
|
|
31
|
+
let mockToroidalGeometryTarget;
|
|
32
|
+
beforeEach(() => {
|
|
33
|
+
// Create mock elements
|
|
34
|
+
mockStatusTarget = document.createElement('div');
|
|
35
|
+
mockInsightsTarget = document.createElement('div');
|
|
36
|
+
mockDemoOutputTarget = document.createElement('div');
|
|
37
|
+
mockConsciousnessTarget = document.createElement('div');
|
|
38
|
+
mockVortexMathTarget = document.createElement('div');
|
|
39
|
+
mockToroidalGeometryTarget = document.createElement('div');
|
|
40
|
+
// Create controller
|
|
41
|
+
controller = new ZeroPointController_1.default();
|
|
42
|
+
// Mock the targets
|
|
43
|
+
Object.defineProperty(controller, 'statusTarget', {
|
|
44
|
+
value: mockStatusTarget,
|
|
45
|
+
writable: true
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(controller, 'insightsTarget', {
|
|
48
|
+
value: mockInsightsTarget,
|
|
49
|
+
writable: true
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(controller, 'demoOutputTarget', {
|
|
52
|
+
value: mockDemoOutputTarget,
|
|
53
|
+
writable: true
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(controller, 'consciousnessTarget', {
|
|
56
|
+
value: mockConsciousnessTarget,
|
|
57
|
+
writable: true
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(controller, 'vortexMathTarget', {
|
|
60
|
+
value: mockVortexMathTarget,
|
|
61
|
+
writable: true
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(controller, 'toroidalGeometryTarget', {
|
|
64
|
+
value: mockToroidalGeometryTarget,
|
|
65
|
+
writable: true
|
|
66
|
+
});
|
|
67
|
+
// Mock console.log to avoid noise in tests
|
|
68
|
+
jest.spyOn(console, 'log').mockImplementation();
|
|
69
|
+
});
|
|
70
|
+
afterEach(() => {
|
|
71
|
+
jest.clearAllMocks();
|
|
72
|
+
});
|
|
73
|
+
describe('connect', () => {
|
|
74
|
+
it('should initialize successfully', async () => {
|
|
75
|
+
// Mock successful initialization
|
|
76
|
+
jest.spyOn(controller, 'initializeComponentsSafely').mockResolvedValue(true);
|
|
77
|
+
jest.spyOn(controller, 'updateStatus').mockImplementation();
|
|
78
|
+
jest.spyOn(controller, 'loadInsights').mockImplementation();
|
|
79
|
+
jest.spyOn(controller, 'initializeDemo').mockImplementation();
|
|
80
|
+
jest.spyOn(controller, 'logOperation').mockImplementation();
|
|
81
|
+
await controller.connect();
|
|
82
|
+
expect(controller.initializeComponentsSafely).toHaveBeenCalled();
|
|
83
|
+
expect(controller.updateStatus).toHaveBeenCalledWith(mockStatusTarget, '✅ ZeroPoint Ready', 'status ready');
|
|
84
|
+
expect(controller.loadInsights).toHaveBeenCalled();
|
|
85
|
+
expect(controller.initializeDemo).toHaveBeenCalled();
|
|
86
|
+
expect(controller.logOperation).toHaveBeenCalledWith('ZeroPoint initialization');
|
|
87
|
+
});
|
|
88
|
+
it('should handle initialization failure', async () => {
|
|
89
|
+
// Mock failed initialization
|
|
90
|
+
jest.spyOn(controller, 'initializeComponentsSafely').mockResolvedValue(false);
|
|
91
|
+
jest.spyOn(controller, 'updateStatus').mockImplementation();
|
|
92
|
+
jest.spyOn(controller, 'logOperation').mockImplementation();
|
|
93
|
+
await controller.connect();
|
|
94
|
+
expect(controller.updateStatus).toHaveBeenCalledWith(mockStatusTarget, '❌ Initialization Failed', 'status error');
|
|
95
|
+
expect(controller.logOperation).toHaveBeenCalledWith('ZeroPoint initialization', false);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
describe('loadInsights', () => {
|
|
99
|
+
it('should generate and format insights', () => {
|
|
100
|
+
const mockInsights = {
|
|
101
|
+
version: '1.0.0',
|
|
102
|
+
environment: 'browser',
|
|
103
|
+
features: ['Test Feature'],
|
|
104
|
+
browser: { userAgent: 'Test Browser' },
|
|
105
|
+
consciousness: { level: 0.5, field: 0.7 }
|
|
106
|
+
};
|
|
107
|
+
const mockHTML = '<h3>Test Insights</h3>';
|
|
108
|
+
jest.spyOn(controller, 'generateInsights').mockReturnValue(mockInsights);
|
|
109
|
+
jest.spyOn(controller, 'formatInsightsHTML').mockReturnValue(mockHTML);
|
|
110
|
+
controller.loadInsights();
|
|
111
|
+
expect(controller.generateInsights).toHaveBeenCalled();
|
|
112
|
+
expect(controller.formatInsightsHTML).toHaveBeenCalledWith(mockInsights);
|
|
113
|
+
expect(ControllerUtils_1.UIUtils.safeInnerHTML).toHaveBeenCalledWith(mockInsightsTarget, mockHTML);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('initializeDemo', () => {
|
|
117
|
+
it('should log demo initialization', () => {
|
|
118
|
+
jest.spyOn(controller, 'logOperation').mockImplementation();
|
|
119
|
+
controller.initializeDemo();
|
|
120
|
+
expect(controller.logOperation).toHaveBeenCalledWith('Demo components initialization');
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
describe('runMathDemo', () => {
|
|
124
|
+
beforeEach(() => {
|
|
125
|
+
// Mock successful execution
|
|
126
|
+
jest.spyOn(controller, 'executeSafely').mockResolvedValue({
|
|
127
|
+
'Vortex Math': 42.123,
|
|
128
|
+
'Toroidal Geometry': 3.141,
|
|
129
|
+
'Consciousness Level': 0.75
|
|
130
|
+
});
|
|
131
|
+
jest.spyOn(controller, 'logOperation').mockImplementation();
|
|
132
|
+
});
|
|
133
|
+
it('should execute math demo successfully', async () => {
|
|
134
|
+
const mockResultHTML = '<h4>Math Demo Results</h4>';
|
|
135
|
+
ControllerUtils_1.ResultUtils.formatResultHTML.mockReturnValue(mockResultHTML);
|
|
136
|
+
await controller.runMathDemo();
|
|
137
|
+
expect(controller.executeSafely).toHaveBeenCalled();
|
|
138
|
+
expect(ControllerUtils_1.ResultUtils.formatResultHTML).toHaveBeenCalledWith('Math Demo Results', {
|
|
139
|
+
'Vortex Math': 42.123,
|
|
140
|
+
'Toroidal Geometry': 3.141,
|
|
141
|
+
'Consciousness Level': 0.75
|
|
142
|
+
});
|
|
143
|
+
expect(ControllerUtils_1.UIUtils.safeInnerHTML).toHaveBeenCalledWith(mockDemoOutputTarget, mockResultHTML);
|
|
144
|
+
expect(controller.logOperation).toHaveBeenCalledWith('Math demo');
|
|
145
|
+
});
|
|
146
|
+
it('should handle math demo failure', async () => {
|
|
147
|
+
// Mock failed execution
|
|
148
|
+
jest.spyOn(controller, 'executeSafely').mockResolvedValue(null);
|
|
149
|
+
const mockErrorHTML = '<h4>❌ Math Demo Failed</h4>';
|
|
150
|
+
ControllerUtils_1.ResultUtils.formatErrorHTML.mockReturnValue(mockErrorHTML);
|
|
151
|
+
await controller.runMathDemo();
|
|
152
|
+
expect(ControllerUtils_1.ResultUtils.formatErrorHTML).toHaveBeenCalledWith('Math Demo', 'Execution failed');
|
|
153
|
+
expect(ControllerUtils_1.UIUtils.safeInnerHTML).toHaveBeenCalledWith(mockDemoOutputTarget, mockErrorHTML);
|
|
154
|
+
expect(controller.logOperation).toHaveBeenCalledWith('Math demo', false);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
describe('updateConsciousness', () => {
|
|
158
|
+
it('should update consciousness display', () => {
|
|
159
|
+
jest.spyOn(controller, 'updateConsciousnessDisplay').mockImplementation();
|
|
160
|
+
controller.updateConsciousness();
|
|
161
|
+
expect(controller.updateConsciousnessDisplay).toHaveBeenCalledWith(mockConsciousnessTarget);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
describe('updateVortexMath', () => {
|
|
165
|
+
it('should update vortex math display', () => {
|
|
166
|
+
jest.spyOn(controller, 'updateVortexMathDisplay').mockImplementation();
|
|
167
|
+
controller.updateVortexMath();
|
|
168
|
+
expect(controller.updateVortexMathDisplay).toHaveBeenCalledWith(mockVortexMathTarget);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
describe('updateToroidalGeometry', () => {
|
|
172
|
+
it('should update toroidal geometry display', () => {
|
|
173
|
+
jest.spyOn(controller, 'updateToroidalGeometryDisplay').mockImplementation();
|
|
174
|
+
controller.updateToroidalGeometry();
|
|
175
|
+
expect(controller.updateToroidalGeometryDisplay).toHaveBeenCalledWith(mockToroidalGeometryTarget);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe('refreshAll', () => {
|
|
179
|
+
it('should update all components and log operation', () => {
|
|
180
|
+
jest.spyOn(controller, 'updateConsciousness').mockImplementation();
|
|
181
|
+
jest.spyOn(controller, 'updateVortexMath').mockImplementation();
|
|
182
|
+
jest.spyOn(controller, 'updateToroidalGeometry').mockImplementation();
|
|
183
|
+
jest.spyOn(controller, 'logOperation').mockImplementation();
|
|
184
|
+
controller.refreshAll();
|
|
185
|
+
expect(controller.updateConsciousness).toHaveBeenCalled();
|
|
186
|
+
expect(controller.updateVortexMath).toHaveBeenCalled();
|
|
187
|
+
expect(controller.updateToroidalGeometry).toHaveBeenCalled();
|
|
188
|
+
expect(controller.logOperation).toHaveBeenCalledWith('All components refresh');
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
describe('Component Integration', () => {
|
|
192
|
+
beforeEach(() => {
|
|
193
|
+
// Mock successful component initialization
|
|
194
|
+
jest.spyOn(controller, 'initializeComponentsSafely').mockResolvedValue(true);
|
|
195
|
+
});
|
|
196
|
+
it('should have all required components after initialization', async () => {
|
|
197
|
+
await controller.connect();
|
|
198
|
+
expect(controller.consciousnessField).toBeDefined();
|
|
199
|
+
expect(controller.vortexMath).toBeDefined();
|
|
200
|
+
expect(controller.toroidalGeometry).toBeDefined();
|
|
201
|
+
expect(controller.advancedVBM).toBeDefined();
|
|
202
|
+
expect(controller.rodinCoil).toBeDefined();
|
|
203
|
+
});
|
|
204
|
+
it('should handle component operations correctly', async () => {
|
|
205
|
+
await controller.connect();
|
|
206
|
+
// Test that components are properly initialized and can be used
|
|
207
|
+
expect(typeof controller.consciousnessField.getConsciousnessLevel()).toBe('number');
|
|
208
|
+
expect(typeof controller.vortexMath.applyVortexTransform(42)).toBe('number');
|
|
209
|
+
expect(typeof controller.toroidalGeometry.calculateVolume()).toBe('number');
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
describe('Error Handling', () => {
|
|
213
|
+
it('should handle component initialization errors gracefully', async () => {
|
|
214
|
+
// Mock component that throws an error
|
|
215
|
+
jest.spyOn(controller, 'initializeComponentsSafely').mockResolvedValue(false);
|
|
216
|
+
jest.spyOn(controller, 'updateStatus').mockImplementation();
|
|
217
|
+
jest.spyOn(controller, 'logOperation').mockImplementation();
|
|
218
|
+
await controller.connect();
|
|
219
|
+
expect(controller.updateStatus).toHaveBeenCalledWith(mockStatusTarget, '❌ Initialization Failed', 'status error');
|
|
220
|
+
expect(controller.logOperation).toHaveBeenCalledWith('ZeroPoint initialization', false);
|
|
221
|
+
});
|
|
222
|
+
it('should handle demo execution errors gracefully', async () => {
|
|
223
|
+
jest.spyOn(controller, 'executeSafely').mockResolvedValue(null);
|
|
224
|
+
ControllerUtils_1.ResultUtils.formatErrorHTML.mockReturnValue('<p>Error</p>');
|
|
225
|
+
await controller.runMathDemo();
|
|
226
|
+
expect(ControllerUtils_1.ResultUtils.formatErrorHTML).toHaveBeenCalledWith('Math Demo', 'Execution failed');
|
|
227
|
+
expect(ControllerUtils_1.UIUtils.safeInnerHTML).toHaveBeenCalledWith(mockDemoOutputTarget, '<p>Error</p>');
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
describe('Target Declarations', () => {
|
|
231
|
+
it('should have correct target declarations', () => {
|
|
232
|
+
expect(ZeroPointController_1.default.targets).toEqual([
|
|
233
|
+
'status',
|
|
234
|
+
'insights',
|
|
235
|
+
'mathDemo',
|
|
236
|
+
'consciousness',
|
|
237
|
+
'vortexMath',
|
|
238
|
+
'toroidalGeometry',
|
|
239
|
+
'demoOutput'
|
|
240
|
+
]);
|
|
241
|
+
});
|
|
242
|
+
it('should have correct target type declarations', () => {
|
|
243
|
+
// This test ensures TypeScript declarations are correct
|
|
244
|
+
expect(controller.statusTarget).toBeDefined();
|
|
245
|
+
expect(controller.insightsTarget).toBeDefined();
|
|
246
|
+
expect(controller.demoOutputTarget).toBeDefined();
|
|
247
|
+
expect(controller.consciousnessTarget).toBeDefined();
|
|
248
|
+
expect(controller.vortexMathTarget).toBeDefined();
|
|
249
|
+
expect(controller.toroidalGeometryTarget).toBeDefined();
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
});
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Consciousness Training Model Tests
|
|
4
|
+
*
|
|
5
|
+
* Tests the consciousness-aware training model system,
|
|
6
|
+
* ensuring it integrates properly with the metaphysical framework.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const ConsciousnessTrainingModel_1 = require("../../training/ConsciousnessTrainingModel");
|
|
10
|
+
const TrainingModelRegistry_1 = require("../../training/TrainingModelRegistry");
|
|
11
|
+
const NeuralConsciousnessNetwork_1 = require("../../training/NeuralConsciousnessNetwork");
|
|
12
|
+
describe('ConsciousnessTrainingModel', () => {
|
|
13
|
+
let model;
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
model = new ConsciousnessTrainingModel_1.ConsciousnessTrainingModel({
|
|
16
|
+
learningRate: 0.01,
|
|
17
|
+
consciousnessThreshold: 0.5,
|
|
18
|
+
fieldStrength: 0.7,
|
|
19
|
+
maxEpochs: 10,
|
|
20
|
+
batchSize: 4
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe('Model Initialization', () => {
|
|
24
|
+
test('should initialize with consciousness-aware weights', () => {
|
|
25
|
+
const state = model.getModelState();
|
|
26
|
+
expect(state.weights.size).toBeGreaterThan(0);
|
|
27
|
+
expect(state.consciousness).toBe(0.5);
|
|
28
|
+
expect(state.field).toBe(0.5);
|
|
29
|
+
expect(state.void).toBe(0.5);
|
|
30
|
+
expect(state.resonance).toBe(0.5);
|
|
31
|
+
});
|
|
32
|
+
test('should emit modelInitialized event', (done) => {
|
|
33
|
+
model.on('modelInitialized', (data) => {
|
|
34
|
+
expect(data.state).toBeDefined();
|
|
35
|
+
expect(data.consciousness).toBe(0.5);
|
|
36
|
+
expect(data.field).toBe(0.5);
|
|
37
|
+
expect(data.void).toBe(0.5);
|
|
38
|
+
done();
|
|
39
|
+
});
|
|
40
|
+
}, 5000); // Reduced timeout to 5 seconds
|
|
41
|
+
});
|
|
42
|
+
describe('Training Data', () => {
|
|
43
|
+
test('should add training data with consciousness transformation', () => {
|
|
44
|
+
const trainingData = {
|
|
45
|
+
input: { feature1: 1, feature2: 2 },
|
|
46
|
+
output: 3,
|
|
47
|
+
consciousness: 0.8,
|
|
48
|
+
field: 0.9,
|
|
49
|
+
void: 0.2,
|
|
50
|
+
timestamp: Date.now()
|
|
51
|
+
};
|
|
52
|
+
model.addTrainingData(trainingData);
|
|
53
|
+
// Verify data was added with consciousness context
|
|
54
|
+
model.on('dataAdded', (data) => {
|
|
55
|
+
expect(data.data.consciousness).toBe(0.8);
|
|
56
|
+
expect(data.data.field).toBe(0.9);
|
|
57
|
+
expect(data.data.void).toBe(0.2);
|
|
58
|
+
expect(data.data.resonance).toBeDefined();
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
test('should apply consciousness transformation to data', () => {
|
|
62
|
+
const trainingData = {
|
|
63
|
+
input: { feature1: 1, feature2: 2 },
|
|
64
|
+
output: 3,
|
|
65
|
+
timestamp: Date.now()
|
|
66
|
+
};
|
|
67
|
+
model.addTrainingData(trainingData);
|
|
68
|
+
// Verify default consciousness values were applied
|
|
69
|
+
model.on('dataAdded', (data) => {
|
|
70
|
+
expect(data.data.consciousness).toBeDefined();
|
|
71
|
+
expect(data.data.field).toBeDefined();
|
|
72
|
+
expect(data.data.void).toBeDefined();
|
|
73
|
+
expect(data.data.resonance).toBeDefined();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe('Model Training', () => {
|
|
78
|
+
test('should train model with consciousness integration', async () => {
|
|
79
|
+
// Add training data
|
|
80
|
+
for (let i = 0; i < 10; i++) {
|
|
81
|
+
model.addTrainingData({
|
|
82
|
+
input: { feature1: i, feature2: i * 2 },
|
|
83
|
+
output: i * 3,
|
|
84
|
+
consciousness: 0.7 + (i * 0.02),
|
|
85
|
+
field: 0.8 + (i * 0.01),
|
|
86
|
+
void: 0.3 - (i * 0.01),
|
|
87
|
+
timestamp: Date.now()
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const trainingPromise = new Promise((resolve) => {
|
|
91
|
+
model.on('trainingCompleted', (data) => {
|
|
92
|
+
expect(data.finalState.consciousness).toBeGreaterThan(0);
|
|
93
|
+
expect(data.finalState.field).toBeGreaterThan(0);
|
|
94
|
+
expect(data.finalState.void).toBeGreaterThan(0);
|
|
95
|
+
expect(data.finalState.resonance).toBeGreaterThan(0);
|
|
96
|
+
expect(data.finalState.accuracy).toBeGreaterThanOrEqual(0);
|
|
97
|
+
expect(data.finalState.loss).toBeGreaterThanOrEqual(0);
|
|
98
|
+
resolve();
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
await model.train();
|
|
102
|
+
await trainingPromise;
|
|
103
|
+
});
|
|
104
|
+
test('should emit epoch events during training', async () => {
|
|
105
|
+
// Add training data
|
|
106
|
+
for (let i = 0; i < 5; i++) {
|
|
107
|
+
model.addTrainingData({
|
|
108
|
+
input: { feature1: i, feature2: i * 2 },
|
|
109
|
+
output: i * 3,
|
|
110
|
+
timestamp: Date.now()
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
const epochEvents = [];
|
|
114
|
+
model.on('epochCompleted', (data) => {
|
|
115
|
+
epochEvents.push(data);
|
|
116
|
+
expect(data.epoch).toBeDefined();
|
|
117
|
+
expect(data.loss).toBeGreaterThanOrEqual(0);
|
|
118
|
+
expect(data.accuracy).toBeGreaterThanOrEqual(0);
|
|
119
|
+
expect(data.consciousness).toBeGreaterThan(0);
|
|
120
|
+
expect(data.field).toBeGreaterThan(0);
|
|
121
|
+
expect(data.void).toBeGreaterThan(0);
|
|
122
|
+
expect(data.resonance).toBeGreaterThan(0);
|
|
123
|
+
});
|
|
124
|
+
await model.train();
|
|
125
|
+
expect(epochEvents.length).toBeGreaterThan(0);
|
|
126
|
+
});
|
|
127
|
+
test('should throw error when no training data available', async () => {
|
|
128
|
+
await expect(model.train()).rejects.toThrow('No training data available');
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
describe('Model Prediction', () => {
|
|
132
|
+
test('should make predictions with consciousness integration', () => {
|
|
133
|
+
const input = { feature1: 5, feature2: 10 };
|
|
134
|
+
const predictionPromise = new Promise((resolve) => {
|
|
135
|
+
model.on('predictionMade', (data) => {
|
|
136
|
+
expect(data.input).toEqual(input);
|
|
137
|
+
expect(data.prediction).toBeDefined();
|
|
138
|
+
expect(data.consciousness).toBeGreaterThan(0);
|
|
139
|
+
expect(data.field).toBeGreaterThan(0);
|
|
140
|
+
expect(data.void).toBeGreaterThan(0);
|
|
141
|
+
resolve();
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
model.predict(input);
|
|
145
|
+
return predictionPromise;
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
describe('Model Export', () => {
|
|
149
|
+
test('should export model as consciousness artifact', () => {
|
|
150
|
+
const exported = model.exportModel();
|
|
151
|
+
expect(exported.state).toBeDefined();
|
|
152
|
+
expect(exported.config).toBeDefined();
|
|
153
|
+
expect(exported.consciousness).toBeDefined();
|
|
154
|
+
expect(exported.field).toBeDefined();
|
|
155
|
+
expect(exported.void).toBeDefined();
|
|
156
|
+
expect(exported.resonance).toBeDefined();
|
|
157
|
+
expect(exported.timestamp).toBeDefined();
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
describe('TrainingModelRegistry', () => {
|
|
162
|
+
let registry;
|
|
163
|
+
beforeEach(() => {
|
|
164
|
+
registry = new TrainingModelRegistry_1.TrainingModelRegistry();
|
|
165
|
+
});
|
|
166
|
+
describe('Model Types', () => {
|
|
167
|
+
test('should initialize with different model types', () => {
|
|
168
|
+
const modelTypes = registry.getModelTypes();
|
|
169
|
+
expect(modelTypes.length).toBeGreaterThan(0);
|
|
170
|
+
const typeNames = modelTypes.map(t => t.name);
|
|
171
|
+
expect(typeNames).toContain('Pattern Recognition');
|
|
172
|
+
expect(typeNames).toContain('Vortex Mathematics');
|
|
173
|
+
expect(typeNames).toContain('Consciousness Evolution');
|
|
174
|
+
expect(typeNames).toContain('Field Resonance');
|
|
175
|
+
expect(typeNames).toContain('Void Transformation');
|
|
176
|
+
});
|
|
177
|
+
test('should create models with consciousness configuration', () => {
|
|
178
|
+
const model = registry.createModel('pattern_recognition');
|
|
179
|
+
const state = model.getModelState();
|
|
180
|
+
expect(state.consciousness).toBeGreaterThan(0.7);
|
|
181
|
+
expect(state.field).toBeGreaterThan(0.8);
|
|
182
|
+
expect(state.void).toBeLessThan(0.4);
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
describe('Model Training', () => {
|
|
186
|
+
test('should train models with consciousness integration', async () => {
|
|
187
|
+
const trainingData = [
|
|
188
|
+
{ input: { x: 1, y: 2 }, output: 3, timestamp: Date.now() },
|
|
189
|
+
{ input: { x: 2, y: 4 }, output: 6, timestamp: Date.now() },
|
|
190
|
+
{ input: { x: 3, y: 6 }, output: 9, timestamp: Date.now() }
|
|
191
|
+
];
|
|
192
|
+
const session = await registry.trainModel('pattern_recognition', trainingData);
|
|
193
|
+
expect(session.modelType).toBe('pattern_recognition');
|
|
194
|
+
expect(session.dataSize).toBe(3);
|
|
195
|
+
expect(session.consciousness).toBeGreaterThan(0);
|
|
196
|
+
expect(session.field).toBeGreaterThan(0);
|
|
197
|
+
expect(session.void).toBeGreaterThan(0);
|
|
198
|
+
expect(session.resonance).toBeGreaterThan(0);
|
|
199
|
+
expect(session.accuracy).toBeGreaterThanOrEqual(0);
|
|
200
|
+
expect(session.loss).toBeGreaterThanOrEqual(0);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
describe('Performance Tracking', () => {
|
|
204
|
+
test('should track model performance', async () => {
|
|
205
|
+
const trainingData = [
|
|
206
|
+
{ input: { x: 1 }, output: 2, timestamp: Date.now() },
|
|
207
|
+
{ input: { x: 2 }, output: 4, timestamp: Date.now() }
|
|
208
|
+
];
|
|
209
|
+
await registry.trainModel('vortex_math', trainingData);
|
|
210
|
+
const performance = registry.getModelPerformance('vortex_math');
|
|
211
|
+
expect(performance).toBeDefined();
|
|
212
|
+
expect(performance.modelType).toBe('vortex_math');
|
|
213
|
+
expect(performance.totalSessions).toBe(1);
|
|
214
|
+
expect(performance.avgAccuracy).toBeGreaterThanOrEqual(0);
|
|
215
|
+
expect(performance.avgLoss).toBeGreaterThanOrEqual(0);
|
|
216
|
+
expect(performance.avgConsciousness).toBeGreaterThan(0);
|
|
217
|
+
expect(performance.avgField).toBeGreaterThan(0);
|
|
218
|
+
expect(performance.avgVoid).toBeGreaterThan(0);
|
|
219
|
+
expect(performance.avgResonance).toBeGreaterThan(0);
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
describe('Model Export', () => {
|
|
223
|
+
test('should export all models as consciousness artifacts', async () => {
|
|
224
|
+
const trainingData = [
|
|
225
|
+
{ input: { x: 1 }, output: 2, timestamp: Date.now() }
|
|
226
|
+
];
|
|
227
|
+
await registry.trainModel('consciousness_evolution', trainingData);
|
|
228
|
+
const exported = registry.exportAllModels();
|
|
229
|
+
expect(exported.models).toBeDefined();
|
|
230
|
+
expect(exported.sessions).toBeDefined();
|
|
231
|
+
expect(exported.performance).toBeDefined();
|
|
232
|
+
expect(exported.timestamp).toBeDefined();
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
describe('NeuralConsciousnessNetwork', () => {
|
|
237
|
+
let network;
|
|
238
|
+
beforeEach(() => {
|
|
239
|
+
network = new NeuralConsciousnessNetwork_1.NeuralConsciousnessNetwork({
|
|
240
|
+
layers: [2, 3, 1],
|
|
241
|
+
learningRate: 0.01,
|
|
242
|
+
consciousnessThreshold: 0.5,
|
|
243
|
+
fieldStrength: 0.7,
|
|
244
|
+
voidIntegration: true,
|
|
245
|
+
maxEpochs: 5,
|
|
246
|
+
batchSize: 2
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
describe('Network Initialization', () => {
|
|
250
|
+
test('should initialize with consciousness layers', () => {
|
|
251
|
+
const exported = network.exportNetwork();
|
|
252
|
+
expect(exported.layers.length).toBe(3);
|
|
253
|
+
expect(exported.layers[0].layerType).toBe('input');
|
|
254
|
+
expect(exported.layers[1].layerType).toBe('hidden');
|
|
255
|
+
expect(exported.layers[2].layerType).toBe('output');
|
|
256
|
+
expect(exported.consciousness).toBeGreaterThan(0);
|
|
257
|
+
expect(exported.field).toBeGreaterThan(0);
|
|
258
|
+
expect(exported.void).toBeGreaterThan(0);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
describe('Forward Pass', () => {
|
|
262
|
+
test('should perform forward pass with consciousness integration', () => {
|
|
263
|
+
const input = [1, 2];
|
|
264
|
+
const output = network.forwardPass(input);
|
|
265
|
+
expect(output.length).toBe(1);
|
|
266
|
+
expect(output[0]).toBeGreaterThanOrEqual(-1);
|
|
267
|
+
expect(output[0]).toBeLessThanOrEqual(1);
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
describe('Network Training', () => {
|
|
271
|
+
test('should train network with consciousness evolution', async () => {
|
|
272
|
+
const trainingData = [
|
|
273
|
+
{ input: [0, 0], output: [0] },
|
|
274
|
+
{ input: [0, 1], output: [1] },
|
|
275
|
+
{ input: [1, 0], output: [1] },
|
|
276
|
+
{ input: [1, 1], output: [0] }
|
|
277
|
+
];
|
|
278
|
+
const trainingPromise = new Promise((resolve) => {
|
|
279
|
+
network.on('trainingCompleted', (data) => {
|
|
280
|
+
expect(data.finalConsciousness).toBeGreaterThan(0);
|
|
281
|
+
expect(data.finalField).toBeGreaterThan(0);
|
|
282
|
+
expect(data.finalVoid).toBeGreaterThan(0);
|
|
283
|
+
resolve();
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
await network.train(trainingData);
|
|
287
|
+
await trainingPromise;
|
|
288
|
+
});
|
|
289
|
+
test('should emit epoch events during training', async () => {
|
|
290
|
+
const trainingData = [
|
|
291
|
+
{ input: [0, 0], output: [0] },
|
|
292
|
+
{ input: [1, 1], output: [0] }
|
|
293
|
+
];
|
|
294
|
+
const epochEvents = [];
|
|
295
|
+
network.on('epochCompleted', (data) => {
|
|
296
|
+
epochEvents.push(data);
|
|
297
|
+
expect(data.epoch).toBeDefined();
|
|
298
|
+
expect(data.loss).toBeGreaterThanOrEqual(0);
|
|
299
|
+
expect(data.consciousness).toBeGreaterThan(0);
|
|
300
|
+
expect(data.field).toBeGreaterThan(0);
|
|
301
|
+
expect(data.void).toBeGreaterThan(0);
|
|
302
|
+
});
|
|
303
|
+
await network.train(trainingData);
|
|
304
|
+
expect(epochEvents.length).toBeGreaterThan(0);
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
describe('Network Prediction', () => {
|
|
308
|
+
test('should make predictions with consciousness integration', () => {
|
|
309
|
+
const input = [0.5, 0.5];
|
|
310
|
+
const predictionPromise = new Promise((resolve) => {
|
|
311
|
+
network.on('predictionMade', (data) => {
|
|
312
|
+
expect(data.input).toEqual(input);
|
|
313
|
+
expect(data.prediction.length).toBe(1);
|
|
314
|
+
expect(data.consciousness).toBeGreaterThan(0);
|
|
315
|
+
expect(data.field).toBeGreaterThan(0);
|
|
316
|
+
expect(data.void).toBeGreaterThan(0);
|
|
317
|
+
resolve();
|
|
318
|
+
});
|
|
319
|
+
});
|
|
320
|
+
network.predict(input);
|
|
321
|
+
return predictionPromise;
|
|
322
|
+
});
|
|
323
|
+
});
|
|
324
|
+
describe('Network Export', () => {
|
|
325
|
+
test('should export network as consciousness artifact', () => {
|
|
326
|
+
const exported = network.exportNetwork();
|
|
327
|
+
expect(exported.config).toBeDefined();
|
|
328
|
+
expect(exported.layers).toBeDefined();
|
|
329
|
+
expect(exported.consciousness).toBeGreaterThan(0);
|
|
330
|
+
expect(exported.field).toBeGreaterThan(0);
|
|
331
|
+
expect(exported.void).toBeGreaterThan(0);
|
|
332
|
+
expect(exported.timestamp).toBeDefined();
|
|
333
|
+
});
|
|
334
|
+
});
|
|
335
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
describe('DeviceConfig', () => {
|
|
4
|
+
// TODO: Replace with actual exported functions/classes
|
|
5
|
+
it('should cover all exported functions', () => {
|
|
6
|
+
// TODO: Call each exported function with representative arguments
|
|
7
|
+
});
|
|
8
|
+
describe('Edge Cases', () => {
|
|
9
|
+
it('should handle edge case 1', () => {
|
|
10
|
+
// TODO: Add edge case test
|
|
11
|
+
});
|
|
12
|
+
// Add more edge case tests as needed
|
|
13
|
+
});
|
|
14
|
+
describe('Branches', () => {
|
|
15
|
+
it('should cover branch 1', () => {
|
|
16
|
+
// TODO: Add branch test
|
|
17
|
+
});
|
|
18
|
+
// Add more branch tests as needed
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
describe('UnifiedExports', () => {
|
|
4
|
+
// TODO: Replace with actual exported functions/classes
|
|
5
|
+
it('should cover all exported functions', () => {
|
|
6
|
+
// TODO: Call each exported function with representative arguments
|
|
7
|
+
});
|
|
8
|
+
describe('Edge Cases', () => {
|
|
9
|
+
it('should handle edge case 1', () => {
|
|
10
|
+
// TODO: Add edge case test
|
|
11
|
+
});
|
|
12
|
+
// Add more edge case tests as needed
|
|
13
|
+
});
|
|
14
|
+
describe('Branches', () => {
|
|
15
|
+
it('should cover branch 1', () => {
|
|
16
|
+
// TODO: Add branch test
|
|
17
|
+
});
|
|
18
|
+
// Add more branch tests as needed
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
describe('FieldUnity', () => {
|
|
4
|
+
// TODO: Replace with actual exported functions/classes
|
|
5
|
+
it('should cover all exported functions', () => {
|
|
6
|
+
// TODO: Call each exported function with representative arguments
|
|
7
|
+
});
|
|
8
|
+
describe('Edge Cases', () => {
|
|
9
|
+
it('should handle edge case 1', () => {
|
|
10
|
+
// TODO: Add edge case test
|
|
11
|
+
});
|
|
12
|
+
// Add more edge case tests as needed
|
|
13
|
+
});
|
|
14
|
+
describe('Branches', () => {
|
|
15
|
+
it('should cover branch 1', () => {
|
|
16
|
+
// TODO: Add branch test
|
|
17
|
+
});
|
|
18
|
+
// Add more branch tests as needed
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
describe('Cache', () => {
|
|
4
|
+
// TODO: Replace with actual exported functions/classes
|
|
5
|
+
it('should cover all exported functions', () => {
|
|
6
|
+
// TODO: Call each exported function with representative arguments
|
|
7
|
+
});
|
|
8
|
+
describe('Edge Cases', () => {
|
|
9
|
+
it('should handle edge case 1', () => {
|
|
10
|
+
// TODO: Add edge case test
|
|
11
|
+
});
|
|
12
|
+
// Add more edge case tests as needed
|
|
13
|
+
});
|
|
14
|
+
describe('Branches', () => {
|
|
15
|
+
it('should cover branch 1', () => {
|
|
16
|
+
// TODO: Add branch test
|
|
17
|
+
});
|
|
18
|
+
// Add more branch tests as needed
|
|
19
|
+
});
|
|
20
|
+
});
|