guanghu-ice-heart/tests/zcode-tcs-root-entry.test.mjs

24 lines
1.2 KiB
JavaScript

import fs from 'node:fs';
import assert from 'node:assert/strict';
import test from 'node:test';
const configPath = '/Volumes/JZAO/铸渊-ICE-GL-ZY001/.zcode/config.json';
const scriptPath = '/Volumes/JZAO/铸渊-ICE-GL-ZY001/BRIDGE/tools/tcs-root-host-entry.sh';
test('ZCode active hooks enter through one TCS mother root and retain the write gate', () => {
const config = JSON.parse(fs.readFileSync(configPath));
const text = JSON.stringify(config);
assert.equal(text.includes('tcs-root-host-entry.sh'), true);
assert.equal(text.includes('host-write-admission.mjs'), true);
assert.equal(text.includes('zy-hook-entry.sh'), false);
assert.equal(text.includes('broadcast/current.md'), false);
assert.equal(text.includes('task-language-anchors'), false);
});
test('ZCode root entry never injects old workspace or static broadcast paths', () => {
const script = fs.readFileSync(scriptPath, 'utf8');
assert.equal(script.includes('TCS-ROOT-NAV-0001'), true);
assert.equal(script.includes('FIFTH-DOMAIN-BROADCAST-TOWER'), false);
assert.equal(script.includes('WORK-工作区/guanghu-ice-heart'), false);
assert.equal(script.includes('task-language-anchors/zcode'), false);
});