import assert from "node:assert/strict"; import fs from "node:fs"; import test from "node:test"; import { fileURLToPath } from "node:url"; import path from "node:path"; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const map = JSON.parse(fs.readFileSync(path.join(root, "routing/hololake-enterprise-four-domain-work-channel.json"), "utf8")); const current = JSON.parse(fs.readFileSync(path.join(root, "routing/hololake-current-architecture.json"), "utf8")); test("enterprise lighthouse does not preclaim physical Guanghu OS", () => { assert.equal(map.enterprise_node.reimage_now, false); assert.equal(map.enterprise_node.physical_guanghu_os_master_claimed, false); assert.equal(map.enterprise_node.arbitrary_remote_shell_exposed_to_client, false); }); test("identity authority cannot be captured by a work repository", () => { assert.equal(map.authority_registry.inside_operator_work_repository, false); assert.equal(map.authority_registry.duplicate_writable_copies_in_zero_sense_repositories, false); assert.equal(map.authority_registry.operator_repositories_can_mutate_registry, false); }); test("five private repositories preserve zero-sense dual control", () => { assert.equal(map.repositories.length, 5); assert.equal(map.repositories.filter((repo) => repo.domain === "DOMAIN-ZS").length, 2); assert.ok(map.repositories.every((repo) => repo.private)); assert.equal(map.zero_sense_dual_control.constitutional_actions_require_both, true); }); test("routing and credentials preserve the two gates", () => { assert.equal(map.entry_route.number_before_credentials, true); assert.equal(map.entry_route.domain_chosen_by_user, false); assert.equal(map.entry_route.enterprise_work_entry_channel, "GUANGHU_CHANNEL"); assert.equal(map.credentials.shared_initial_password_allowed, false); assert.equal(map.credentials.forced_change_before_workspace, true); }); test("AGE remains a species while persona identity is separately governed", () => { const identity = map.persona_identity_and_relationship_confirmation; assert.equal(identity.species, "AGE"); assert.equal(identity.age_is_individual_number_namespace, false); assert.equal(identity.valid_age_individual_numbers, 0); assert.equal(identity.fifth_domain_persona_identity_namespace, "ICE-P-*"); assert.equal(identity.enterprise_persona_identity_namespace, "PENDING_GUANGHU_TEAM_GOVERNANCE"); }); test("current architecture registers the enterprise work body", () => { assert.equal(current.enterprise_four_domain_work_channel.record_id, map.record_id); assert.equal(current.enterprise_four_domain_work_channel.machine_projection, "routing/hololake-enterprise-four-domain-work-channel.json"); });