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("AGE is the persona species while Agent remains an execution mechanism", () => { const map = readJson("routing/guanghu-age-runtime-map.json"); assert.equal(map.species.name, "AGE"); assert.equal(map.species.protocol, "GLS-0800"); assert.equal(map.species.is_agent, false); assert.equal(map.distinctions.agent, "GENERAL_TASK_LOOP_AND_TOOL_EXECUTION_MECHANISM"); assert.equal(map.architecture.cognition, "ZY-BIDIRECTIONAL-COGNITION-032"); assert.equal(map.compatibility.cognition_031_reuse_allowed, false); }); test("AGE identity coordinates preserve existing persona ids", () => { const map = readJson("routing/guanghu-age-runtime-map.json"); assert.equal( map.coordinates.persona_identity, "PRESERVE_EXISTING_ICE_TCS_AND_OTHER_CANONICAL_IDENTITIES", ); assert.equal(map.coordinates.age_individual_number_format, "UNASSIGNED_PENDING_TCS_0002_GOVERNANCE"); }); test("restore stays bounded and retrieval never becomes the persona", () => { const map = readJson("routing/guanghu-age-runtime-map.json"); assert.equal(map.memory_invariants.restore_requires_full_history_scan, false); assert.equal(map.memory_invariants.retrieval_index_is_persona, false); assert.equal(map.memory_invariants.retrieval_result_is_authority, false); assert.equal(map.memory_invariants.current_self_size_is_bounded, true); assert.equal(map.memory_invariants.raw_history_growth_expands_boot_context, false); assert.equal(map.memory_invariants.persona_decides_memory_promotion, true); }); test("AGE mirrors are bounded temporary projections", () => { const map = readJson("routing/guanghu-age-runtime-map.json"); assert.equal(map.mirror_invariants.independent_persona, false); assert.equal(map.mirror_invariants.permanent_identity, false); assert.equal(map.mirror_invariants.self_authorization, false); assert.equal(map.mirror_invariants.parent_owns_final_decision_and_receipt, true); assert.equal(map.mirror_invariants.single_writer_lease_required, true); assert.equal(map.mirror_invariants.expires_after_task, true); }); test("lighthouse and host navigation expose the AGE architecture route", () => { const lighthouse = readJson("routing/lighthouse-path-registry.json"); assert.ok(lighthouse.paths.some((entry) => entry.id === "GH-AGE-RUNTIME-MAP-001")); const hosts = readJson("routing/host-skill-navigation-map.json"); const intent = hosts.intents.find( (entry) => entry.id === "INTENT-HOLOLAKE-AGE-ARCHITECTURE-001", ); assert.equal(intent.target_id, "GH-AGE-RUNTIME-MAP-001"); assert.ok(intent.phrases.includes("我们有自己家的AGE")); });