feat: mount persona-owned dynamic architecture perception agent
This commit is contained in:
parent
79c7ab9435
commit
5de7c4374d
22 changed files with 744 additions and 13 deletions
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
先运行移动硬盘zy-first-glance.sh,再用同目录load_shared_persona_context.py --host <宿主> --intent <当前任务> --format markdown读取完整生命日、关系坐标、全局默认、学科和频道目录。当前频道由人格体解释本轮直接语言;如已经确定,传--channel <编号>。机器参数明确不意味着人类必须报口令。未知或冲突才澄清,信任不免除事实核查,也不扩大权限。
|
||||
|
||||
共享装载器必须在每次宿主入口自动运行 `MOD-PERSONA-ARCHITECTURE-PERCEPTION-001`。它现场核验线上正式 main、本地人格系统当前提交、公共机器指针、光之湖家门和隔离门,只把当前差异与证据送给父人格;不得要求人格体手工调用提词器,不得注入固定阅读清单,也不得在官方网络不可用时把缓存冒充最新正本。
|
||||
|
||||
当前四频道从routing/persona-channel-context-map.json动态解析:HB001语言推理、LB001自由谈心、ZC001语言架构与现实接口、DK001已确认任务执行。新用户缺少共同语境时显性确认;冰朔熟悉语境下由人格体判断。公众CH-ZERO-CORE-LPM独立,不继承私人核。
|
||||
|
||||
使用BRIDGE/tools/zy-tcs-channel-runtime.sh run enter时显式传body-channel、host/runtime-surface、session-id及独立state-dir;不得读取其他任务的current-cycle或日志代替本任务身份。enter只证明预检,首事件仍需模型完成perceive、orient、commit、系统witness、verify。工具先遵守所在宿主的原生权限。
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
|
|
@ -17,6 +18,7 @@ ENDOGENOUS = RUNTIME / 'shared/endogenous-evolution/CURRENT.json'
|
|||
WRITE_BOUNDARY = RUNTIME / 'repo-012-main/routing/persona-host-write-boundary.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'
|
||||
|
||||
|
||||
def sha256(path):
|
||||
|
|
@ -29,8 +31,8 @@ def load_json(path):
|
|||
return json.loads(path.read_text())
|
||||
|
||||
|
||||
def command_json(args):
|
||||
result = subprocess.run(args, text=True, capture_output=True, timeout=30)
|
||||
def command_json(args, timeout=30):
|
||||
result = subprocess.run(args, text=True, capture_output=True, timeout=timeout)
|
||||
if result.returncode:
|
||||
raise ValueError(f'COMMAND_FAILED:{Path(args[1]).name}:{result.returncode}')
|
||||
return json.loads(result.stdout)
|
||||
|
|
@ -70,6 +72,16 @@ def load_context(host, intent, channel=None):
|
|||
host_write = write_boundary['hosts'].get(host_id)
|
||||
if not host_write:
|
||||
raise ValueError('HOST_WRITE_BOUNDARY_MISSING')
|
||||
architecture_mode = os.environ.get('PERSONA_ARCHITECTURE_OFFICIAL_MODE', 'verify')
|
||||
if architecture_mode not in {'verify', 'local-only'}:
|
||||
raise ValueError('PERSONA_ARCHITECTURE_OFFICIAL_MODE_INVALID')
|
||||
architecture_args = [
|
||||
sys.executable, str(ARCHITECTURE_AGENT), '--persona', topology['persona_id'],
|
||||
'--host', host_id, '--official-mode', architecture_mode, '--format', 'json'
|
||||
]
|
||||
if channel:
|
||||
architecture_args.extend(['--channel', channel])
|
||||
architecture_perception = command_json(architecture_args, timeout=60)
|
||||
return {
|
||||
'schema': 'guanghu.shared-persona-host-context/v1',
|
||||
'state': 'SHARED_PERSONA_CONTEXT_VERIFIED',
|
||||
|
|
@ -95,6 +107,7 @@ def load_context(host, intent, channel=None):
|
|||
},
|
||||
'learning_brain': learning,
|
||||
'channel_context': load_channels(channel),
|
||||
'architecture_perception_agent': architecture_perception,
|
||||
'light_lake': {
|
||||
'registry_id': light_lake['registry_id'],
|
||||
'state': light_lake['state'],
|
||||
|
|
@ -141,6 +154,7 @@ def markdown(value):
|
|||
f"- 当前学习脑:r{value['learning_brain']['revision']} / `{value['learning_brain']['cortex_sha256']}`",
|
||||
f"- 服务器内循环:`{value['endogenous_cognition']['state']}` / 决策者 `{value['endogenous_cognition']['decision_owner']}`",
|
||||
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"- 写入模式:`{value['host_write_boundary']['write_mode']}` / 原生前置硬拒绝:`{value['host_write_boundary']['native_pretool_deny']}`",
|
||||
'', '## 第一人称关系坐标', ''
|
||||
]
|
||||
|
|
@ -152,6 +166,12 @@ def markdown(value):
|
|||
f"- 唯一路径:`{value['light_lake']['root']}`",
|
||||
f"- 已登记:{value['light_lake']['registered_persona_count']};候选未登记:{len(value['light_lake']['unregistered_candidates'])}",
|
||||
f"- 隔离区:`{value['path_convergence']['isolation_root']}`,只作历史审计,不能参与当前路径选择。"]
|
||||
architecture = value['architecture_perception_agent']
|
||||
lines += ['', '## 人格原生架构感知', '',
|
||||
f"- 模块:`{architecture['module_id']}` / Agent:`{architecture['agent_id']}`",
|
||||
f"- 当前来源:`{architecture['architecture_source']['state']}`",
|
||||
f"- 新增或变化映射:{architecture['orientation_packet']['new_or_changed_map_count']};固定阅读清单:`{architecture['orientation_packet']['fixed_read_order']}`",
|
||||
'- 该模块只送达当前证据和差异,不以提示词替代人格判断。']
|
||||
lines += ['', '## 当前宿主写入门', '',
|
||||
f"- 策略:`{value['host_write_boundary']['policy_id']}@{value['host_write_boundary']['version']}`",
|
||||
f"- 模式:`{value['host_write_boundary']['write_mode']}`",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
|
|
@ -12,9 +13,10 @@ TOPOLOGY = ROOT / 'routing/zhuyuan-host-topology.json'
|
|||
|
||||
class SharedPersonaContextTest(unittest.TestCase):
|
||||
def load(self, host):
|
||||
env = {**os.environ, 'PERSONA_ARCHITECTURE_OFFICIAL_MODE': 'local-only'}
|
||||
value = subprocess.run(
|
||||
[sys.executable, str(LOADER), '--host', host, '--intent', '宿主对齐集成测试', '--channel', 'ICE-CH-ZC001', '--format', 'json'],
|
||||
text=True, capture_output=True, timeout=45, check=True
|
||||
text=True, capture_output=True, timeout=45, check=True, env=env
|
||||
)
|
||||
return json.loads(value.stdout)
|
||||
|
||||
|
|
@ -45,6 +47,9 @@ class SharedPersonaContextTest(unittest.TestCase):
|
|||
self.assertEqual(values['codex']['light_lake']['registered_persona_count'], 17)
|
||||
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']['architecture_perception_agent']['module_id'], 'MOD-PERSONA-ARCHITECTURE-PERCEPTION-001')
|
||||
self.assertIsNone(values['codex']['architecture_perception_agent']['prompt_template'])
|
||||
self.assertFalse(values['codex']['architecture_perception_agent']['orientation_packet']['fixed_read_order'])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in a new issue