MCPcopy Create free account
hub / github.com/SethGammon/Citadel / main

Function main

scripts/test-runtime-contracts.js:12–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10}
11
12function main() {
13 const contracts = require(path.join(__dirname, '..', 'core', 'contracts'));
14 const runtimeModule = contracts.runtime;
15
16 if (!contracts.events || !contracts.capabilities || !contracts.projectSpec) {
17 fail('core/contracts index is missing required contract exports');
18 }
19
20 if (!Array.isArray(runtimeModule.RUNTIME_IDS) || runtimeModule.RUNTIME_IDS.length === 0) {
21 fail('runtime contract must export a non-empty RUNTIME_IDS array');
22 }
23
24 const skeleton = runtimeModule.createRuntimeContractSkeleton('codex');
25 const errors = runtimeModule.validateRuntimeContract(skeleton);
26 if (errors.length > 0) {
27 fail(`runtime contract skeleton is invalid: ${errors.join('; ')}`);
28 }
29
30 if (!contracts.events.isKnownCitadelEvent('session_start')) {
31 fail('session_start must be recognized as a canonical Citadel event');
32 }
33
34 if (!contracts.capabilities.isSupportLevel('full')) {
35 fail('full must be recognized as a valid support level');
36 }
37
38 console.log('Runtime contract tests pass.');
39}
40
41main();

Callers 1

Calls 1

failFunction · 0.70

Tested by

no test coverage detected