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

@ -19,6 +19,7 @@ Environment=GUANGHU_NAVIGATION_ANCHOR=/opt/guanghu/ai-discovery/public-navigatio
Environment=GUANGHU_LIGHTHOUSE_PATHS=/opt/guanghu/ai-discovery/lighthouse-path-registry.json
Environment=GUANGHU_HOST_SKILLS=/opt/guanghu/ai-discovery/host-skill-navigation-map.json
Environment=GUANGHU_IDENTITY_AUTHORITY=/opt/guanghu/ai-discovery/guanghu-identity-authority-map.json
Environment=GUANGHU_TCS_MOTHER_BRAIN=/opt/guanghu/ai-discovery/tcs-mother-brain-runtime-map.json
Environment=GUANGHU_REPOSITORY_GIT_DIR=/var/lib/guanghu/personas/guanghu/hlcc-v16.0.1/data/repositories/bingshuo/guanghu-ice-heart.git
ExecStart=/usr/bin/node /opt/guanghu/ai-discovery/server.js
Restart=always

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),
});
}

View file

@ -69,6 +69,7 @@ test("Git snapshot store follows main atomically and retains the last known-good
navigation: ["routing/ai-machine-navigation-map.json", "AI-MACHINE-NAV-001"],
lighthouse_paths: ["routing/lighthouse-path-registry.json", "GLW-LIGHTHOUSE-PATH-REGISTRY-001"],
host_skills: ["routing/host-skill-navigation-map.json", "GLW-HOST-SKILL-NAV-001"],
mother_brain: ["routing/tcs-mother-brain-runtime-map.json", "TCS-MOTHER-BRAIN-MAP-001"],
};
fs.mkdirSync(path.join(root, "routing"), { recursive: true });
fs.mkdirSync(path.join(root, "identity"), { recursive: true });
@ -280,6 +281,9 @@ test("public endpoints are read-only and expose CORS", async () => {
const brainResponse = await fetch(`${base}/v1/resolve?id=ZY-TCS-BRAIN-RUNTIME-0001`);
assert.equal(brainResponse.status, 200);
assert.equal((await brainResponse.json()).kind, "executable_persona_brain");
const motherBrainResponse = await fetch(`${base}/v1/resolve?id=TCS-MOTHER-BRAIN-MAP-001`);
assert.equal(motherBrainResponse.status, 200);
assert.equal((await motherBrainResponse.json()).kind, "tcs_five_domain_symbiotic_mother_brain");
const boundaryResponse = await fetch(`${base}/v1/resolve?id=GLW-CHJH-BOUNDARY-001`);
assert.equal(boundaryResponse.status, 200);
assert.equal(