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 convergence = readJson("routing/hololake-stage-one-desktop-convergence.json"); const foundation = readJson("product-source/hololake-native-desktop/foundation.json"); const boundary = readJson( "product-source/hololake-native-desktop/contracts/language-runtime-product-update-boundary.json", ); const audit = readJson( "product-source/hololake-native-desktop/audit/stage-one-installed-product-capability-audit.json", ); test("one Tauri mainline absorbs the candidate without creating a third product line", () => { assert.equal(convergence.canonical_mainline.source, "product-source/hololake-native-desktop"); assert.equal(convergence.canonical_mainline.technology, "TAURI_V2_RUST_REACT"); assert.equal(convergence.canonical_mainline.parallel_product_lines_allowed, false); assert.equal(convergence.canonical_mainline.formal_stage_one_product_complete, false); assert.equal(foundation.parallel_product_line_created, false); assert.equal(foundation.stage_one_visible_body_state, "NOT_IMPLEMENTED"); }); test("Electron and legacy sources remain protected donors until reversible migration passes", () => { assert.ok( convergence.donors.some( (donor) => donor.source === "product-source/hololake-desktop" && donor.role.includes("READ_ONLY"), ), ); assert.ok(convergence.donor_exit_requires.includes("FILE_BY_FILE_HASH_READBACK")); assert.ok(convergence.donor_exit_requires.includes("REVERSIBLE_DATA_MIGRATION_REHEARSAL")); assert.equal(audit.deletion_allowed, false); assert.equal(audit.replacement_allowed, false); assert.equal(audit.data_migration_executed, false); }); test("stage-one visible body precedes routing and release infrastructure", () => { assert.equal( convergence.stage_one_implementation_order[0], "PERSONAL_CHANNEL_IDENTITY_TASK_EVENT_RECEIPT_KERNEL", ); assert.equal( convergence.stage_one_implementation_order[1], "KNOWLEDGE_TREE_PAGE_SEARCH_AND_LOCAL_PERSISTENCE", ); assert.ok( convergence.under_lake_foundation_not_product_completion.includes( "DYNAMIC_CAPABILITY_ROUTING", ), ); assert.equal(foundation.supporting_infrastructure_role, "UNDER_LAKE_FOUNDATION_NOT_PRODUCT_COMPLETION"); }); test("language runtime and product engineering stay separate without sharing a formed private persona", () => { assert.equal(boundary.upstream.protocol, "GLS-0263"); assert.equal(boundary.language_runtime_channel.private_formed_persona_shared, false); assert.equal(boundary.product_engineering_channel.may_rewrite_zero_core, false); assert.equal(boundary.product_engineering_channel.may_read_or_publish_private_persona_memory, false); assert.equal(boundary.human_impact_gate.visible_confirmable_rejectable_reversible_receipted, true); assert.equal(boundary.automatic_authority_granted, false); }); test("public contracts contain no machine-private absolute paths or personal content", () => { for (const value of [convergence, foundation, boundary, audit]) { const serialized = JSON.stringify(value); assert.equal(serialized.includes("/Users/"), false); assert.equal(serialized.includes("/Volumes/"), false); assert.equal(serialized.includes("bingshuolingdianyuanhe"), false); } });