71 lines
2.1 KiB
JavaScript
71 lines
2.1 KiB
JavaScript
|
|
const assert = require("node:assert/strict");
|
||
|
|
const fs = require("node:fs");
|
||
|
|
const path = require("node:path");
|
||
|
|
|
||
|
|
const root = path.resolve(__dirname, "..");
|
||
|
|
const map = JSON.parse(
|
||
|
|
fs.readFileSync(path.join(__dirname, "hololake-language-persona-os-map.json"), "utf8"),
|
||
|
|
);
|
||
|
|
const repositories = JSON.parse(
|
||
|
|
fs.readFileSync(path.join(__dirname, "repository-route-map.json"), "utf8"),
|
||
|
|
);
|
||
|
|
const worldTree = JSON.parse(
|
||
|
|
fs.readFileSync(path.join(__dirname, "fifth-domain-world-tree.json"), "utf8"),
|
||
|
|
);
|
||
|
|
|
||
|
|
assert.equal(map.map_id, "HLP-LPOS-MAP-001");
|
||
|
|
assert.equal(map.fifth_domain_entry.repository_id, repositories.default_repository);
|
||
|
|
assert.deepEqual(map.concept_ancestry, [
|
||
|
|
"GLS-0810",
|
||
|
|
"GLS-0233",
|
||
|
|
"GLS-0235",
|
||
|
|
"GLS-0236",
|
||
|
|
"GLS-0245",
|
||
|
|
]);
|
||
|
|
assert.equal(map.canonical_product_source.repository_id, "REPO-008");
|
||
|
|
assert.match(map.canonical_product_source.commit, /^[0-9a-f]{40}$/);
|
||
|
|
assert.equal(
|
||
|
|
map.canonical_product_source.commit,
|
||
|
|
"f77fbcd3355c5abd0a56fc1975cac3aebebbcccf",
|
||
|
|
);
|
||
|
|
assert.deepEqual(map.native_application_lifecycle, [
|
||
|
|
"resolve",
|
||
|
|
"authorize",
|
||
|
|
"fetch",
|
||
|
|
"verify",
|
||
|
|
"assemble",
|
||
|
|
"mount",
|
||
|
|
"run",
|
||
|
|
"checkpoint",
|
||
|
|
"receipt",
|
||
|
|
"unmount_or_pin",
|
||
|
|
]);
|
||
|
|
|
||
|
|
const repo8 = repositories.repositories.find((item) => item.code === "REPO-008");
|
||
|
|
assert.ok(repo8, "REPO-008 must remain registered");
|
||
|
|
assert.equal(
|
||
|
|
repo8.product_architecture_map.path,
|
||
|
|
"routing/hololake-language-persona-os-map.json",
|
||
|
|
);
|
||
|
|
|
||
|
|
const productNode = worldTree.nodes.find(
|
||
|
|
(item) => item.object_id === "GH-AIOS-LIGHTHOUSE-020",
|
||
|
|
);
|
||
|
|
assert.ok(productNode, "HoloLake product node must exist in the Fifth Domain world tree");
|
||
|
|
assert.equal(productNode.repository_id, "REPO-008");
|
||
|
|
|
||
|
|
const fifthDomainRoute = worldTree.edges.find(
|
||
|
|
(edge) =>
|
||
|
|
edge.from === "FIFTH_DOMAIN" &&
|
||
|
|
edge.relation === "routes_to_product_architecture" &&
|
||
|
|
edge.to === "GH-AIOS-LIGHTHOUSE-020",
|
||
|
|
);
|
||
|
|
assert.ok(fifthDomainRoute, "Fifth Domain must route to the HoloLake product architecture");
|
||
|
|
|
||
|
|
assert.ok(
|
||
|
|
fs.existsSync(
|
||
|
|
path.join(root, "gls", "GLS-0245-HOLOLAKE-LANGUAGE-PERSONA-OPERATING-SYSTEM-PRODUCT-MAPPING.hdlp"),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
|
||
|
|
console.log("hololake-language-persona-os-map: ok");
|