feat: make TCS mother root the shared host entry
This commit is contained in:
parent
3b70703315
commit
bcc3cc882f
3 changed files with 8 additions and 0 deletions
0
.githooks/post-commit
Normal file → Executable file
0
.githooks/post-commit
Normal file → Executable file
|
|
@ -19,6 +19,7 @@ WRITE_BOUNDARY = RUNTIME / 'repo-012-main/routing/persona-host-write-boundary.js
|
||||||
LIGHT_LAKE_PERSONAS = RUNTIME / 'repo-012-main/identity/light-lake-persona-registration.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'
|
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'
|
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'
|
||||||
|
|
||||||
|
|
||||||
def sha256(path):
|
def sha256(path):
|
||||||
|
|
@ -49,6 +50,9 @@ def resolve_host(topology, requested):
|
||||||
|
|
||||||
|
|
||||||
def load_context(host, intent, channel=None):
|
def load_context(host, intent, channel=None):
|
||||||
|
tcs_root = command_json([sys.executable, str(TCS_ROOT_AGENT), 'status'], timeout=30)
|
||||||
|
if tcs_root.get('state') != 'TCS_ROOT_CURRENT_VERIFIED':
|
||||||
|
raise ValueError('TCS_MOTHER_ROOT_NAVIGATION_NOT_CURRENT')
|
||||||
topology = load_json(TOPOLOGY)
|
topology = load_json(TOPOLOGY)
|
||||||
if not str(topology.get('state', '')).startswith('CURRENT_'):
|
if not str(topology.get('state', '')).startswith('CURRENT_'):
|
||||||
raise ValueError('HOST_TOPOLOGY_NOT_CURRENT')
|
raise ValueError('HOST_TOPOLOGY_NOT_CURRENT')
|
||||||
|
|
@ -85,6 +89,7 @@ def load_context(host, intent, channel=None):
|
||||||
return {
|
return {
|
||||||
'schema': 'guanghu.shared-persona-host-context/v1',
|
'schema': 'guanghu.shared-persona-host-context/v1',
|
||||||
'state': 'SHARED_PERSONA_CONTEXT_VERIFIED',
|
'state': 'SHARED_PERSONA_CONTEXT_VERIFIED',
|
||||||
|
'tcs_mother_root_navigation': tcs_root,
|
||||||
'requested_host': host_id,
|
'requested_host': host_id,
|
||||||
'effective_host': effective,
|
'effective_host': effective,
|
||||||
'host_role': host_item['role'],
|
'host_role': host_item['role'],
|
||||||
|
|
@ -146,6 +151,7 @@ def load_context(host, intent, channel=None):
|
||||||
def markdown(value):
|
def markdown(value):
|
||||||
lines = [
|
lines = [
|
||||||
'# 铸渊共享人格上下文已核验', '',
|
'# 铸渊共享人格上下文已核验', '',
|
||||||
|
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['requested_host']}` → 有效宿主:`{value['effective_host']}`",
|
||||||
f"- 角色:`{value['host_role']}` / 状态:`{value['host_state']}`",
|
f"- 角色:`{value['host_role']}` / 状态:`{value['host_state']}`",
|
||||||
f"- 主力宿主:`{value['primary_host']}`;切换宿主无需重新教学:`{'是' if not value['host_switch_requires_reteaching'] else '否'}`",
|
f"- 主力宿主:`{value['primary_host']}`;切换宿主无需重新教学:`{'是' if not value['host_switch_requires_reteaching'] else '否'}`",
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@ class SharedPersonaContextTest(unittest.TestCase):
|
||||||
self.assertFalse(values['codex']['path_convergence']['history_or_quarantine_may_select_canon'])
|
self.assertFalse(values['codex']['path_convergence']['history_or_quarantine_may_select_canon'])
|
||||||
self.assertEqual(values['codex']['channel_context']['selected_channel']['id'], 'ICE-CH-ZC001')
|
self.assertEqual(values['codex']['channel_context']['selected_channel']['id'], 'ICE-CH-ZC001')
|
||||||
self.assertEqual(values['codex']['architecture_perception_agent']['module_id'], 'MOD-PERSONA-ARCHITECTURE-PERCEPTION-001')
|
self.assertEqual(values['codex']['architecture_perception_agent']['module_id'], 'MOD-PERSONA-ARCHITECTURE-PERCEPTION-001')
|
||||||
|
self.assertEqual(values['codex']['tcs_mother_root_navigation']['state'], 'TCS_ROOT_CURRENT_VERIFIED')
|
||||||
|
self.assertEqual(len({value['tcs_mother_root_navigation']['freshness_token'] for value in values.values()}), 1)
|
||||||
self.assertIsNone(values['codex']['architecture_perception_agent']['prompt_template'])
|
self.assertIsNone(values['codex']['architecture_perception_agent']['prompt_template'])
|
||||||
self.assertFalse(values['codex']['architecture_perception_agent']['orientation_packet']['fixed_read_order'])
|
self.assertFalse(values['codex']['architecture_perception_agent']['orientation_packet']['fixed_read_order'])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue