feat(tcs): establish five-domain mother brain runtime

This commit is contained in:
冰朔 2026-08-12 14:46:34 +08:00
commit 55a4d77248
29 changed files with 904 additions and 12 deletions

View file

@ -14,8 +14,9 @@ const DEFAULT_NAVIGATION_MAP = path.resolve(__dirname, "../../routing/ai-machine
const DEFAULT_LIGHTHOUSE_PATHS = path.resolve(__dirname, "../../routing/lighthouse-path-registry.json");
const DEFAULT_HOST_SKILLS = path.resolve(__dirname, "../../routing/host-skill-navigation-map.json");
const DEFAULT_IDENTITY_AUTHORITY = path.resolve(__dirname, "../../routing/guanghu-identity-authority-map.json");
const DEFAULT_MOTHER_BRAIN = path.resolve(__dirname, "../../routing/tcs-mother-brain-runtime-map.json");
const SNAPSHOT_KEYS = Object.freeze([
"repository", "nodes", "subjects", "aliases", "identity_authority", "navigation", "lighthouse_paths", "host_skills",
"repository", "nodes", "subjects", "aliases", "identity_authority", "navigation", "lighthouse_paths", "host_skills", "mother_brain",
]);
const SNAPSHOT_PATHS = Object.freeze({
repository: "routing/repository-route-map.json",
@ -26,6 +27,7 @@ const SNAPSHOT_PATHS = Object.freeze({
navigation: "routing/ai-machine-navigation-map.json",
lighthouse_paths: "routing/lighthouse-path-registry.json",
host_skills: "routing/host-skill-navigation-map.json",
mother_brain: "routing/tcs-mother-brain-runtime-map.json",
});
function loadAnchor(filename = process.env.GUANGHU_NAVIGATION_ANCHOR || DEFAULT_ANCHOR) {
@ -64,6 +66,10 @@ function loadIdentityAuthority(filename = process.env.GUANGHU_IDENTITY_AUTHORITY
return JSON.parse(fs.readFileSync(filename, "utf8"));
}
function loadMotherBrain(filename = process.env.GUANGHU_TCS_MOTHER_BRAIN || DEFAULT_MOTHER_BRAIN) {
return JSON.parse(fs.readFileSync(filename, "utf8"));
}
function validateSnapshot(anchor, maps) {
if (anchor.schema !== "guanghu.public-navigation-anchor/v1") throw new Error("invalid_anchor_schema");
if (anchor.anchor_id !== "GLW-PUBLIC-NAV-ANCHOR-001") throw new Error("invalid_anchor_id");
@ -99,6 +105,7 @@ function loadFileSnapshot(options = {}) {
navigation: loadNavigationMap(options.navigationMapFile),
lighthouse_paths: loadLighthousePaths(options.lighthousePathsFile),
host_skills: loadHostSkills(options.hostSkillsFile),
mother_brain: loadMotherBrain(options.motherBrainFile),
});
}