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("GH-PNCC names the persona-native channel and keeps Git as an engine", () => { const map = readJson("routing/guanghu-persona-native-code-channel-map.json"); assert.equal(map.map_id, "GH-PNCC-MAP-001"); assert.equal(map.product.formal_name_zh, "光湖人格原生代码频道"); assert.equal(map.product.acronym, "GH-PNCC"); assert.equal(map.layer_contract.durable_engine, "GIT"); assert.equal(map.git_invariants.git_is_persona, false); assert.equal(map.git_invariants.branches_are_runtime_organs, false); assert.equal(map.layer_contract.forgejo, "OPTIONAL_COMPATIBILITY_COLLABORATION_ADAPTER"); }); test("GH-PNCC separates responsibility authorship runtime and receipts", () => { const map = readJson("routing/guanghu-persona-native-code-channel-map.json"); assert.equal(map.attribution_contract.git_author_committer_is_semantic_authorship_proof, false); for (const field of [ "human_responsibility_subject", "persona_cognitive_author", "execution_runtime", "authorization_scope", "evidence_and_receipt", ]) { assert.ok(map.attribution_contract.required_fields.includes(field)); } }); test("HoloLake projects the same event facts without exposing hidden reasoning", () => { const map = readJson("routing/guanghu-persona-native-code-channel-map.json"); assert.equal(map.projection_contract.second_truth_store_allowed, false); assert.equal(map.projection_contract.hidden_model_reasoning_exposed, false); assert.equal(map.projection_contract.externalized_cognition_required, true); assert.equal(map.truth.runtime_implemented, 0); assert.equal(map.truth.hololake_integrated, 0); }); test("public lighthouse host and skill registries resolve GH-PNCC", () => { const lighthouse = readJson("routing/lighthouse-path-registry.json"); assert.ok(lighthouse.paths.some((entry) => entry.id === "GH-PNCC-MAP-001")); const anchor = readJson("routing/public-navigation-anchor.json"); assert.equal(anchor.maps.persona_native_code_channel.id, "GH-PNCC-MAP-001"); const hosts = readJson("routing/host-skill-navigation-map.json"); const intent = hosts.intents.find( (entry) => entry.id === "INTENT-PERSONA-NATIVE-CODE-CHANNEL-001", ); assert.equal(intent.target_id, "GH-PNCC-MAP-001"); assert.ok(intent.phrases.includes("光湖人格原生代码频道")); const registry = readJson( "skills/codex/guanghu-persona-skill-guard/references/persona-skill-registry.json", ); const skill = registry.skills.find((entry) => entry.id === "GHS-011-PERSONA-NATIVE-CODE-CHANNEL"); assert.ok(skill.intents.includes("光湖人格原生代码频道")); assert.ok(skill.preferred_route.includes("GH-PNCC-MAP-001")); });