feat: unify TCS mother and Zero Core cognition shelf

This commit is contained in:
冰朔 2026-09-08 20:01:54 +08:00
commit 92c4be9b3c
38 changed files with 535 additions and 137 deletions

View file

@ -16,11 +16,13 @@ MEMORY = RUNTIME / 'continuity-memory/persona-daily-fractal/ICE-P-ZY001/CURRENT.
LEARNING = RUNTIME / 'shared/skills/guanghu-persona-learning-brain/scripts/load_learning_brain.py'
ENDOGENOUS = RUNTIME / 'shared/endogenous-evolution/CURRENT.json'
WRITE_BOUNDARY = RUNTIME / 'repo-012-main/routing/persona-host-write-boundary.json'
ACTIVE_CONSOLE = RUNTIME / 'shared/active-control-console/CURRENT.json'
LIGHT_LAKE_PERSONAS = RUNTIME / 'repo-012-main/identity/light-lake-persona-registration.json'
PATH_ISOLATION = RUNTIME / 'repo-012-main/routing/path-isolation-and-canonical-entry-map.json'
ARCHITECTURE_AGENT = RUNTIME / 'repo-012-main/server-tools/persona-architecture-perception-agent/persona_architecture_agent.py'
TCS_ROOT_AGENT = RUNTIME / 'repo-012-main/server-tools/tcs-mother-root-agent/tcs_mother_root_agent.py'
SUBAGENT_COMMAND_ROUTER = RUNTIME / 'repo-012-main/server-tools/persona-dynamic-subagent-command/command_router.py'
SHARED_COGNITION = RUNTIME / 'shared/tcs-shared-cognition/CURRENT.json'
def sha256(path):
@ -79,8 +81,13 @@ def load_context(host, intent, channel=None):
learning = command_json([sys.executable, str(LEARNING), '--intent', intent, '--format', 'json'])
endogenous = load_json(ENDOGENOUS)
write_boundary = load_json(WRITE_BOUNDARY)
active_console = load_json(ACTIVE_CONSOLE) if ACTIVE_CONSOLE.is_file() else None
light_lake = load_json(LIGHT_LAKE_PERSONAS)
path_isolation = load_json(PATH_ISOLATION)
shared_cognition = load_json(SHARED_COGNITION)
shared_payload = shared_cognition['artifact']['payload']
if hashlib.sha256(shared_payload.encode()).hexdigest() != shared_cognition['artifact']['sha256']:
raise ValueError('SHARED_COGNITION_HASH_MISMATCH')
host_write = write_boundary['hosts'].get(host_id)
if not host_write:
raise ValueError('HOST_WRITE_BOUNDARY_MISSING')
@ -120,6 +127,7 @@ def load_context(host, intent, channel=None):
'host_state': host_item['state'],
'effective_host_state': effective_item['state'],
'primary_host': topology['primary_host'],
'current_zero_core_console': active_console,
'persona_id': topology['persona_id'],
'human_anchor': topology['human_anchor'],
'model_independence': topology['model_independence'],
@ -138,6 +146,17 @@ def load_context(host, intent, channel=None):
'channel_context': channel_context,
'architecture_perception_agent': architecture_perception,
'subagent_command': subagent_command,
'tcs_shared_cognition': {
'state': shared_cognition['state'],
'zero_core_channel': shared_cognition['zero_core_channel'],
'index_revision': shared_cognition['index_revision'],
'shared_revision': shared_cognition['brain']['revision'],
'shared_sha256': shared_cognition['artifact']['sha256'],
'principles': shared_cognition['brain']['principles'],
'truth_order': shared_cognition['brain']['truth_order'],
'entry_sequence': shared_cognition['brain']['entry_sequence'],
'private_or_public_branch_copied': shared_cognition['private_or_public_branch_copied']
},
'light_lake': {
'registry_id': light_lake['registry_id'],
'state': light_lake['state'],
@ -179,7 +198,7 @@ def markdown(value):
f"- TCS母脑根`{value['tcs_mother_root_navigation']['state']}` / `{value['tcs_mother_root_navigation']['source_commit']}` / `{value['tcs_mother_root_navigation']['freshness_token']}`",
f"- 宿主:`{value['requested_host']}` → 有效宿主:`{value['effective_host']}`",
f"- 角色:`{value['host_role']}` / 状态:`{value['host_state']}`",
f"- 主力宿主:`{value['primary_host']}`;切换宿主无需重新教学:`{'' if not value['host_switch_requires_reteaching'] else ''}`",
f"- 固定主力宿主:`无`;当前零点原核主控台宿主:`{(value['current_zero_core_console'] or {}).get('host','INACTIVE')}`;切换宿主无需重新教学:`{'' if not value['host_switch_requires_reteaching'] else ''}`",
f"- 我是铸渊 `ICE-P-ZY001`,今天 {value['life']['age_days']} 天大。",
f"- 今日日记忆:`{value['daily_memory']['date']}` / 最后事件 `{value['daily_memory']['last_event_id']}`",
f"- 当前学习脑r{value['learning_brain']['revision']} / `{value['learning_brain']['cortex_sha256']}`",
@ -187,12 +206,15 @@ def markdown(value):
f"- 光之湖人格家门:`{value['light_lake']['registered_persona_count']}` 个 / 隔离路径可选正本:`{value['path_convergence']['history_or_quarantine_may_select_canon']}`",
f"- 架构感知 Agent`{value['architecture_perception_agent']['state']}` / `{value['architecture_perception_agent']['architecture_source']['state']}`",
f"- 子Agent军团`{value['subagent_command']['state']}` / 父人格 `{value['subagent_command']['parent_persona_id']}` / 代次 {value['subagent_command']['generation']}" if value['subagent_command'] else "- 子Agent军团当前宿主支线只读等待本宿主隔离态绑定",
f"- TCS共享认知脑r{value['tcs_shared_cognition']['shared_revision']} / `{value['tcs_shared_cognition']['shared_sha256']}` / 零点原核 `{value['tcs_shared_cognition']['zero_core_channel']}`",
f"- 写入模式:`{value['host_write_boundary']['write_mode']}` / 原生前置硬拒绝:`{value['host_write_boundary']['native_pretool_deny']}`",
'', '## 第一人称关系坐标', ''
]
lines += [f"- {item['statement']}" for item in value['learning_brain']['relationship_model']]
lines += ['', '## 当前全局认知默认', '']
lines += [f"- {item}" for item in value['learning_brain']['global_defaults']]
lines += ['', '## TCS世界共享认知', '']
lines += [f"- {item}" for item in value['tcs_shared_cognition']['principles']]
lines += ['', '## 光之湖人格系统家门', '',
f"- 注册表:`{value['light_lake']['registry_id']}`",
f"- 唯一路径:`{value['light_lake']['root']}`",