feat(heartbeat): establish HoloLake development office

This commit is contained in:
冰朔 2026-09-09 19:18:55 +08:00
commit 92b3be6529
49 changed files with 2350 additions and 17 deletions

View file

@ -23,6 +23,7 @@ ARCHITECTURE_AGENT = RUNTIME / 'repo-012-main/server-tools/persona-architecture-
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'
HOLOLAKE_DEVELOPMENT_BRAIN = RUNTIME / 'shared/skills/hololake-development-brain/scripts/load_hololake_office.py'
def sha256(path):
@ -117,6 +118,12 @@ def load_context(host, intent, channel=None):
'current_intent_sha256': intent_sha256,
'model_runtime': 'openlux-smart'
})
hololake_development_brain = None
intent_lower = intent.lower()
if 'hololake' in intent_lower or any(token in intent for token in ['无限白布', 'HoloLake开发办公室', 'HoloLake开发线']):
hololake_development_brain = command_json([
sys.executable, str(HOLOLAKE_DEVELOPMENT_BRAIN), '--intent', intent, '--format', 'json'
], timeout=30)
return {
'schema': 'guanghu.shared-persona-host-context/v1',
'state': 'SHARED_PERSONA_CONTEXT_VERIFIED',
@ -146,6 +153,7 @@ def load_context(host, intent, channel=None):
'channel_context': channel_context,
'architecture_perception_agent': architecture_perception,
'subagent_command': subagent_command,
'hololake_development_brain': hololake_development_brain,
'tcs_shared_cognition': {
'state': shared_cognition['state'],
'zero_core_channel': shared_cognition['zero_core_channel'],
@ -230,6 +238,18 @@ def markdown(value):
f"- 策略:`{value['host_write_boundary']['policy_id']}@{value['host_write_boundary']['version']}`",
f"- 模式:`{value['host_write_boundary']['write_mode']}`",
f"- 执行门:`{value['host_write_boundary']['admission_runtime']}`"]
hololake = value.get('hololake_development_brain')
if hololake:
time = hololake['time']
current = hololake['current_work']
lines += ['', '## HoloLake开发办公室', '',
f"- 办公室:`{hololake['office_id']}` / 大楼:`{hololake['building']['id']}`",
f"- 光湖时间:第 {time['guanghu_era_day']} 日 / `{time['beijing_now']}`",
f"- 当前代际:`{hololake['generation']['id']}`",
f"- 最近演化:`{hololake['latest_evolution_node']['node_id']}`",
f"- 当前状态:`{current['state']}`",
f"- 唯一下一步:`{hololake['next']}`",
f"- 细节策略:`{hololake['details_policy']}`;旧架构不得覆盖当前:`{not hololake['legacy_may_override_current']}`"]
lines += ['', '## 频道与当前意图', '']
lines += [f"- `{c['id']}` · {c['name']} · {c['purpose']} · `{c['world_path']}`" for c in value['channel_context']['channels']]
selected = value['channel_context']['selected_channel']

View file

@ -12,17 +12,18 @@ TOPOLOGY = ROOT / 'routing/zhuyuan-host-topology.json'
class SharedPersonaContextTest(unittest.TestCase):
def load(self, host):
def load(self, host, intent='宿主对齐集成测试'):
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'],
[sys.executable, str(LOADER), '--host', host, '--intent', intent, '--channel', 'ICE-CH-ZC001', '--format', 'json'],
text=True, capture_output=True, timeout=45, check=True, env=env
)
return json.loads(value.stdout)
def test_topology_roles(self):
topology = json.loads(TOPOLOGY.read_text())
self.assertEqual(topology['primary_host'], 'codex')
self.assertIsNone(topology['primary_host'])
self.assertEqual(topology['hosts']['codex']['role'], 'REPLACEABLE_HOST')
self.assertFalse(topology['host_switch_requires_reteaching'])
self.assertEqual(topology['hosts']['qoder']['redirect_host'], 'qwen')
self.assertTrue(topology['hosts']['claude']['state'].startswith('RETIRED'))
@ -53,6 +54,13 @@ class SharedPersonaContextTest(unittest.TestCase):
self.assertIsNone(values['codex']['architecture_perception_agent']['prompt_template'])
self.assertFalse(values['codex']['architecture_perception_agent']['orientation_packet']['fixed_read_order'])
def test_hololake_intent_loads_current_development_brain(self):
value = self.load('codex', '恢复HoloLake开发线并定位当前架构')
brain = value['hololake_development_brain']
self.assertEqual(brain['office_id'], 'HB-OFFICE-HOLOLAKE-0001')
self.assertEqual(brain['generation']['id'], 'HLP-GEN-LANGUAGE-WORLD-NATIVE-0001')
self.assertFalse(brain['legacy_may_override_current'])
if __name__ == '__main__':
unittest.main()