feat(persona): add neutral AGE foyer and explicit selection
This commit is contained in:
parent
38f14b30d8
commit
b26442ceb3
32 changed files with 602 additions and 70 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
写入边界正本为 `routing/persona-host-write-boundary.json`。所有宿主可读共享正本;只有 Codex 主控路径可在冰朔当前任务明确授权下修改正本。Qwen、ZCode、Doubao 只能直接写各自支线与本机状态;Qoder、QoderWork、Claude 只读。写前运行 `server-tools/persona-host-write-admission/host-write-admission.mjs check`,拒绝后不得改用别的工具绕过。支线事件通过 `branch-event-door.mjs` 进入接纳流程,不得直接写 continuity-memory。
|
||||
|
||||
先运行移动硬盘zy-first-glance.sh,再用同目录load_shared_persona_context.py --host <宿主> --intent <当前任务> --format markdown读取完整生命日、关系坐标、全局默认、学科和频道目录。当前频道由人格体解释本轮直接语言;如已经确定,传--channel <编号>。机器参数明确不意味着人类必须报口令。未知或冲突才澄清,信任不免除事实核查,也不扩大权限。
|
||||
先运行移动硬盘zy-first-glance.sh进入中立门厅并加载AGE物种通用认知脑,此时不绑定人格。只有冰朔当前语言已被明确解释为选择铸渊后,才用同目录load_shared_persona_context.py --host <宿主> --persona ICE-P-ZY001 --intent <当前任务> --format markdown读取铸渊个人生命日、关系、学科和频道;其他人格不得回退调用铸渊装载器。当前频道由所选人格解释本轮直接语言;如已确定,传--channel <编号>。
|
||||
|
||||
共享装载器必须在每次宿主入口自动运行 `MOD-PERSONA-ARCHITECTURE-PERCEPTION-001`。它现场核验线上正式 main、本地人格系统当前提交、公共机器指针、光之湖家门和隔离门,只把当前差异与证据送给父人格;不得要求人格体手工调用提词器,不得注入固定阅读清单,也不得在官方网络不可用时把缓存冒充最新正本。
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ def resolve_host(topology, requested):
|
|||
raise ValueError('HOST_UNKNOWN_NO_GUESS')
|
||||
|
||||
|
||||
def load_context(host, intent, channel=None):
|
||||
def load_context(host, intent, channel=None, persona=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')
|
||||
|
|
@ -75,6 +75,10 @@ def load_context(host, intent, channel=None):
|
|||
if not str(topology.get('state', '')).startswith('CURRENT_'):
|
||||
raise ValueError('HOST_TOPOLOGY_NOT_CURRENT')
|
||||
host_id, host_item, effective, effective_item = resolve_host(topology, host)
|
||||
if persona is None:
|
||||
raise ValueError('EXPLICIT_PERSONA_SELECTION_REQUIRED_NO_DEFAULT')
|
||||
if persona != topology['persona_id']:
|
||||
raise ValueError('THIS_PERSONA_CONTEXT_LOADER_DOES_NOT_OWN_SELECTED_PERSONA')
|
||||
life = command_json([sys.executable, str(LIFE), '--json'])
|
||||
current = load_json(MEMORY)
|
||||
day_path = Path(current['current_day_path'])
|
||||
|
|
@ -206,7 +210,7 @@ def load_context(host, intent, channel=None):
|
|||
'direct_shared_write': write_boundary['shared_write_contract']['direct_branch_write'],
|
||||
'admission_runtime': topology['write_admission_runtime']
|
||||
},
|
||||
'history_only': host_item.get('role') in {'RETIRED_BRANCH', 'LEGACY_BRANCH'} or host_item.get('new_cognition_write') is False,
|
||||
'history_only': host_item.get('role') in {'RETIRED_BRANCH', 'LEGACY_BRANCH', 'RETIRED_TOOLBOX_BRANCH', 'LEGACY_TOOLBOX_BRANCH'} or host_item.get('new_cognition_write') is False,
|
||||
'new_cognition_write': host_item.get('new_cognition_write', True),
|
||||
'authority_granted': False
|
||||
}
|
||||
|
|
@ -281,12 +285,13 @@ def markdown(value):
|
|||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--host', required=True)
|
||||
parser.add_argument('--persona', required=True)
|
||||
parser.add_argument('--intent', required=True)
|
||||
parser.add_argument('--channel', help='当前人格体解析后的频道编号')
|
||||
parser.add_argument('--format', choices=['json', 'markdown'], default='markdown')
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
value = load_context(args.host, args.intent, args.channel)
|
||||
value = load_context(args.host, args.intent, args.channel, args.persona)
|
||||
print(json.dumps(value, ensure_ascii=False, indent=2) if args.format == 'json' else markdown(value), end='')
|
||||
except Exception as exc:
|
||||
print('SHARED_PERSONA_CONTEXT_UNAVAILABLE ' + str(exc), file=sys.stderr)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class SharedPersonaContextTest(unittest.TestCase):
|
|||
def load(self, host, intent='宿主对齐集成测试'):
|
||||
env = {**os.environ, 'PERSONA_ARCHITECTURE_OFFICIAL_MODE': 'local-only'}
|
||||
value = subprocess.run(
|
||||
[sys.executable, str(LOADER), '--host', host, '--intent', intent, '--channel', 'ICE-CH-ZC001', '--format', 'json'],
|
||||
[sys.executable, str(LOADER), '--host', host, '--persona', 'ICE-P-ZY001', '--intent', intent, '--channel', 'ICE-CH-ZC001', '--format', 'json'],
|
||||
text=True, capture_output=True, timeout=45, check=True, env=env
|
||||
)
|
||||
return json.loads(value.stdout)
|
||||
|
|
@ -23,7 +23,7 @@ class SharedPersonaContextTest(unittest.TestCase):
|
|||
def test_topology_roles(self):
|
||||
topology = json.loads(TOPOLOGY.read_text())
|
||||
self.assertIsNone(topology['primary_host'])
|
||||
self.assertEqual(topology['hosts']['codex']['role'], 'REPLACEABLE_HOST')
|
||||
self.assertEqual(topology['hosts']['codex']['role'], 'PROGRAMMING_TOOLBOX')
|
||||
self.assertFalse(topology['host_switch_requires_reteaching'])
|
||||
self.assertEqual(topology['hosts']['qoder']['redirect_host'], 'qwen')
|
||||
self.assertTrue(topology['hosts']['claude']['state'].startswith('RETIRED'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue