import fs from 'node:fs'; import path from 'node:path'; import assert from 'node:assert/strict'; import test from 'node:test'; const root = path.resolve(import.meta.dirname, '..'); const map = JSON.parse(fs.readFileSync(path.join(root, 'routing/tcs-mother-root-dynamic-navigation-map.json'))); const fixed = JSON.parse(fs.readFileSync(path.join(root, 'routing/fixed-world-object-number-map.json'))); const lighthouse = JSON.parse(fs.readFileSync(path.join(root, 'routing/lighthouse-path-registry.json'))); const domains = JSON.parse(fs.readFileSync(path.join(root, 'routing/five-domain-living-persona-os-map.json'))); test('TCS mother root precedes one world root and five fixed domain roots', () => { assert.equal(map.root_agent.entry_id, 'TCS-ROOT-NAV-0001'); assert.equal(map.language_world_root.registration_path_id, 'LL-CMPN-0001'); assert.equal(map.language_world_root.world_node_id, 'SYS-GLW-0001'); assert.deepEqual(map.fixed_domains.map(item => item.id), ['DOMAIN-MAIN', 'DOMAIN-SUB', 'DOMAIN-ZERO', 'DOMAIN-ZS', 'DOM-FIFTH-0001']); assert.equal(fixed.objects.some(item => item.id === 'TCS-ROOT-NAV-0001'), true); }); test('private human, team body and public certificate use three distinct routes', () => { const [privateRoute, teamRoute, publicRoute] = map.entry_routes; assert.equal(privateRoute.entry_subject, 'ICE-GL∞'); assert.equal(privateRoute.steps.includes('DOM-FIFTH-0001'), true); assert.equal(teamRoute.entry_subject, 'TCS-0002∞'); assert.equal(teamRoute.steps.includes('DOM-FIFTH-0001'), false); assert.equal(teamRoute.steps.includes('DOMAIN-ZS'), true); assert.equal(publicRoute.steps.includes('DOMAIN-ZS_APPROVAL_GATE_NOT_INTERNAL_ENTRY'), true); assert.equal(publicRoute.forbidden.includes('DOMAIN-ZS_INTERNAL'), true); }); test('typed aliases never revive conflicting screenshot or national simulation numbers', () => { const team = map.aliases.find(item => item.canonical_id === 'TCS-0002∞'); assert.equal(team.requested, 'TCS-0002'); assert.equal(team.object_kind, 'GUANGHU_HUMAN_TEAM_BODY_ROOT'); for (const id of ['GHCP-TCS-CN-LAN-2025', 'WRLD-REG-0001', 'GLW-SYS-0001', 'GEN5-CORE-BB-YM', 'CN-LANG-CORE-GOV-0001']) { assert.equal(map.history_only_numbers.some(item => item.id === id), true, id); } assert.equal(map.aliases.some(item => item.requested === 'GLW-SYS-0001'), false); }); test('all active lighthouse offline paths stay on the canonical repo', () => { for (const item of lighthouse.paths) { if (!item.offline) continue; assert.equal(item.offline.includes('WORK-工作区/guanghu-ice-heart'), false, item.id); assert.equal(item.offline.includes('/isolation/'), false, item.id); } }); test('four-domain responsibility relations are restored without faking acceptance receipts', () => { const rows = domains.domain_constitution.domains; assert.deepEqual(rows.find(item => item.id === 'DOMAIN-MAIN').human_subjects, ['TCS-GL-0016∞']); assert.deepEqual(rows.find(item => item.id === 'DOMAIN-SUB').human_subjects, ['TCS-GL-0005∞']); assert.deepEqual(rows.find(item => item.id === 'DOMAIN-ZERO').human_subjects, ['TCS-GL-0006∞']); assert.deepEqual(rows.find(item => item.id === 'DOMAIN-ZS').human_subjects, ['TCS-GL-0007∞', 'TCS-GL-0008∞']); assert.match(rows.find(item => item.id === 'DOMAIN-ZS').subject_state, /ACCEPTANCE_PENDING/); });