feat(hololake): add typed persona interaction runtime

This commit is contained in:
冰朔 2026-09-04 04:26:33 +08:00
commit b35e0d6524
24 changed files with 1614 additions and 58 deletions

View file

@ -34,13 +34,17 @@ if not renderer.exists() or "MarkdownDocument" not in renderer.read_text():
for required_file in (
"src-tauri/src/agent_executor.rs",
"src-tauri/src/persona_runtime.rs",
"src-tauri/src/persona_inference.rs",
"src-tauri/src/realtime_bridge.rs",
"src-tauri/src/enterprise_entrance.rs",
"connectors/hololake-glp-client.py",
"contracts/public-runtime-v1.json",
"contracts/clean-v1-execution-baseline.json",
"contracts/enterprise-responsibility-entrance-v1.json",
"contracts/persona-interaction-v1.json",
"language/HOLOLAKE-CLEAN-V1-DIRECT-LANGUAGE-EXECUTION-BASELINE.tcs",
"language/HOLOLAKE-PERSONA-INTERACTION-V1.tcs",
"language/build/HOLOLAKE-PERSONA-INTERACTION-V1.gir.json",
"server/enterprise-responsibility-gate/service.py",
"server/enterprise-responsibility-gate/test_service.py",
"server/enterprise-responsibility-gate/guanghu-hololake-enterprise-gate.service",
@ -55,6 +59,24 @@ if runtime_contract["mutation_gate"] != "PENDING_HUMAN_APPROVAL_TO_EXPLICIT_UI_A
errors.append("agent human approval gate missing")
if "system_context" not in runtime_contract.get("server_messages", []):
errors.append("persona-visible system context missing from GLP contract")
persona_contract = json.loads((ROOT / "contracts/persona-interaction-v1.json").read_text())
if persona_contract.get("product_stage") != "POST_CLEAN_V1_SECOND_STAGE_CANDIDATE":
errors.append("persona interaction incorrectly labelled as stage one")
if persona_contract.get("model_binding", {}).get("api_key_storage") != "MACOS_KEYCHAIN":
errors.append("persona model key storage is not Keychain")
if persona_contract.get("model_binding", {}).get("execution_authority") is not False:
errors.append("persona model incorrectly receives execution authority")
if "SYSTEM_RECEIPT" not in persona_contract.get("input_envelope", {}).get("excluded_from_dialogue_roles", []):
errors.append("system receipts may enter persona dialogue roles")
persona_source = (ROOT / "src-tauri/src/persona_inference.rs").read_text()
for required_persona_boundary in (
"KEYCHAIN_SERVICE",
"actor_id",
"modelIsReplaceableInferenceResourceNotPersona",
"PERSONA_MODEL_ENDPOINT_REQUIRES_HTTPS_OR_LOOPBACK",
):
if required_persona_boundary not in persona_source and required_persona_boundary.upper() not in persona_source.upper():
errors.append(f"persona inference boundary missing: {required_persona_boundary}")
realtime_source = (ROOT / "src-tauri/src/realtime_bridge.rs").read_text()
for required_context in ("sourceKinds", "pendingAgentProposals", "enterpriseEntrance", "proposalIsNotExecution"):
if required_context not in realtime_source: