hololake-system-architecture/routing/hololake-personal-node-work-lake.test.mjs

44 lines
2.3 KiB
JavaScript

import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const readJson = (relative) => JSON.parse(fs.readFileSync(path.join(root, relative), "utf8"));
const map = readJson("routing/hololake-personal-node-work-lake.json");
const current = readJson("routing/hololake-current-architecture.json");
test("personal node keeps the work lake private and platform hosting at zero", () => {
assert.equal(map.default_stage_one_node, "USER_LOCAL_COMPUTER_TERMINAL");
assert.equal(map.platform_user_runtime_hosting, false);
assert.equal(map.enterprise_registry.stores_private_work_lake, false);
assert.equal(map.enterprise_registry.stores_code_memory_tasks_or_terminal_output, false);
});
test("SQLite, Git, HLDP, files, and terminal remain separate organs", () => {
assert.equal(map.work_lake_organs.control_plane, "EMBEDDED_SQLITE");
assert.match(map.work_lake_organs.code_and_history, /STANDARD_GIT/);
assert.equal(map.work_lake_organs.persona_semantics, "HLDP");
assert.equal(map.work_lake_organs.execution, "HOLOLAKE_SUPERVISED_TERMINAL");
});
test("mobile is the same persona system remote body and relay cannot read payload", () => {
assert.equal(map.mobile.role, "REMOTE_BODY_ENTRY_OF_THE_SAME_PERSONA_SYSTEM");
assert.equal(map.mobile.remote_desktop_clone, false);
assert.equal(map.mobile.relay_may_read_private_payload, false);
assert.equal(map.mobile.offline_node_may_execute, false);
});
test("number, account login, and node possession are separate", () => {
assert.equal(map.enterprise_registry.human_number_is_credential, false);
assert.equal(map.enterprise_registry.account_authentication_proves_node_possession, false);
assert.equal(map.enterprise_registry.node_private_key_leaves_user_node, false);
assert.equal(map.enterprise_registry.real_time_verifier_can_be_git_or_spreadsheet, false);
});
test("current architecture loads this contract before old product surfaces", () => {
assert.equal(current.personal_node_work_lake.record_id, map.record_id);
assert.equal(current.personal_node_work_lake.machine_projection, "routing/hololake-personal-node-work-lake.json");
assert.ok(current.read_order.indexOf(map.architecture_page) >= 0);
});