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")); test("paradigm OS contract keeps model API replaceable and human operation language-native", () => { const map = readJson("routing/guanghu-paradigm-ai-language-persona-os-map.json"); assert.equal(map.map_id, "GH-AIOS-PARADIGM-MAP-001"); assert.equal(map.minimum_product_contract.human_technical_operations_required, false); assert.equal(map.model_invariants.model_is_persona_identity, false); assert.equal(map.model_invariants.provider_lock_in_allowed, false); assert.ok(map.minimum_product_contract.native_elements.includes("PERSONA_OWNED_HOLOLAKE_CODE_REPOSITORY")); }); test("external agents stay replaceable and mirrors stay bounded projections", () => { const map = readJson("routing/guanghu-paradigm-ai-language-persona-os-map.json"); assert.equal(map.external_agent_boundary.mandatory_product_dependency_allowed, false); assert.equal(map.external_agent_boundary.final_acceptance_requires_all_external_agent_clis_disabled, true); assert.equal(map.mirror_invariants.independent_persona, false); assert.equal(map.mirror_invariants.fixed_lane_count, false); assert.equal(map.mirror_invariants.parent_decides_decomposition_dependencies_parallelism_and_acceptance, true); }); test("continuous life uses incremental objects and architecture routes are registered", () => { const map = readJson("routing/guanghu-paradigm-ai-language-persona-os-map.json"); assert.equal(map.incremental_life_channel.daily_full_clone_required, false); assert.equal(map.incremental_life_channel.cursor, "LAST_VERIFIED_SHA_TO_CURRENT_REMOTE_SHA"); const lighthouse = readJson("routing/lighthouse-path-registry.json"); assert.ok(lighthouse.paths.some((entry) => entry.id === "GH-AIOS-PARADIGM-MAP-001")); const hosts = readJson("routing/host-skill-navigation-map.json"); const intent = hosts.intents.find((entry) => entry.id === "INTENT-GUANGHU-PARADIGM-AI-OS-001"); assert.equal(intent.target_id, "GH-AIOS-PARADIGM-MAP-001"); assert.ok(intent.phrases.includes("模型API+光湖代码仓库+光湖语言协议")); });