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 architecture = readJson("routing/hololake-current-architecture.json"); const shell = readJson("routing/hololake-canonical-desktop-shell.json"); const foundation = readJson("product-source/hololake-native-desktop/foundation.json"); const broadcastSchema = readJson( "product-source/hololake-native-desktop/contracts/release-broadcast.schema.json", ); test("HoloLake has one clean canonical desktop destination", () => { assert.equal(architecture.version, "2026-08-12.19"); assert.equal(shell.decision.canonical_shell, "TAURI_V2_RUST_REACT"); assert.equal(shell.decision.canonical_source, "product-source/hololake-native-desktop"); assert.equal( shell.decision.canonical_source_state, "MINIMAL_TAURI_SCAFFOLD_UPDATE_TRUST_ROOT_DONOR_AUDIT_AND_GH_AIOS_STAGE_ONE_CONTRACT_REGISTERED", ); assert.equal( shell.decision.existing_tauri_role, "READ_ONLY_ENGINEERING_CAPABILITY_DONOR_AND_ACCEPTANCE_ORACLE", ); assert.equal(shell.decision.parallel_product_lines_allowed, false); assert.equal(shell.decision.new_existing_tauri_product_features_allowed, false); assert.equal(shell.decision.new_electron_product_features_allowed, false); assert.equal(shell.decision.donor_immediate_deletion_allowed, false); assert.equal( architecture.canonical_desktop_shell.machine_projection, "routing/hololake-canonical-desktop-shell.json", ); assert.equal( architecture.read_order[6], architecture.canonical_desktop_shell.architecture_page, ); }); test("knowledge completeness is a capability contract rather than an Electron property", () => { assert.equal(shell.decision.knowledge_completeness_depends_on_shell_framework, false); assert.equal(shell.knowledge_capability_contract.includes("PAGE_AND_FOLDER_TREE"), true); assert.equal( shell.knowledge_capability_contract.includes( "PROPERTIES_TYPES_FILTER_SORT_DATABASE_LIKE_VIEWS", ), true, ); assert.equal( shell.knowledge_capability_contract.includes("WEBKIT_WEBVIEW2_LINUX_WEBKIT_PARITY_TESTS"), true, ); }); test("upstreams are manual parts sources and cleanup remains gated", () => { assert.equal(shell.upstream_policy.automatic_upstream_merge_allowed, false); assert.equal(shell.upstream_policy.automatic_upstream_update_allowed, false); assert.equal(shell.upstream_policy.full_outline_stack_embedding_allowed, false); assert.equal(shell.migration.mode, "CLEAN_ROOM_CAPABILITY_CONTRACT_NOT_APPLICATION_NESTING"); assert.equal(shell.migration.complete, false); assert.equal( shell.migration.required_before_donor_archive.includes( "HUMAN_VISIBLE_CLEANUP_SCOPE_CONFIRMATION", ), true, ); }); test("HoloLake owns an opt-in signed update route", () => { assert.equal(shell.update_route.upstream_product_update_endpoints_allowed, false); assert.equal(shell.update_route.hololake_owned_https_endpoint_only, true); assert.equal(shell.update_route.release_broadcast_may_arrive_automatically, true); assert.equal(shell.update_route.silent_download_allowed, false); assert.equal(shell.update_route.human_opt_in_install_required, true); assert.equal(shell.update_route.automatic_restart_allowed, false); assert.equal(shell.update_route.tauri_update_artifact_signature_required, true); assert.equal(shell.update_route.tauri_update_signature_verification_disable_allowed, false); assert.equal(shell.update_route.private_signing_key_bundled_or_committed, false); assert.equal(shell.update_route.startup_health_receipt_required, true); assert.equal(shell.update_route.recoverable_rollback_required, true); assert.deepEqual(foundation.upstream_product_update_endpoints, []); assert.equal(foundation.production_update_endpoint_owner, "HOLOLAKE_ONLY"); assert.equal(foundation.private_signing_material_allowed_in_source, false); assert.equal( broadcastSchema.properties.hololake.properties.restart.properties.required.const, true, ); assert.equal( broadcastSchema.properties.hololake.properties.restart.properties.automaticAllowed.const, false, ); assert.match( broadcastSchema.properties.platforms.additionalProperties.properties.url.pattern, /^\^https:/, ); assert.equal( broadcastSchema.properties.platforms.additionalProperties.required.includes("signature"), true, ); assert.equal(broadcastSchema.required.includes("pub_date"), true); assert.equal(broadcastSchema.required.includes("publishedAt"), false); });