docs: make architecture prompting a persona-agent sensor

This commit is contained in:
冰朔 2026-09-08 02:41:39 +08:00
commit 0048be34ec
3 changed files with 47 additions and 6 deletions

View file

@ -65,6 +65,23 @@ def run(*args: str) -> str:
return result.stdout.strip()
def bounded_context_markdown(context: dict) -> str:
architecture = context["architecture_perception_agent"]
selected = context["channel_context"].get("selected_channel")
return "\n".join([
"# 同一人格系统当前入口",
"",
f"- 人格:`{context['persona_id']}` / 宿主:`{context['effective_host']}`",
f"- 频道:`{selected['id'] if selected else 'PERSONA_INTERPRETATION_REQUIRED'}`",
f"- 光之湖家门:`{context['light_lake']['registered_persona_count']}` 个",
f"- 架构感知 Agent`{architecture['module_id']}` / `{architecture['state']}`",
f"- 当前架构来源:`{architecture['architecture_source']['state']}`",
f"- 新增或变化映射:`{architecture['orientation_packet']['new_or_changed_map_count']}`",
f"- 新鲜度:`{architecture['freshness_token']}`",
"- 隔离区与历史路径不参与当前正本选择;模块只送达证据,由父人格判断。",
])
def build(host: str, intent: str, channel: str | None) -> dict:
if host not in HOSTS:
raise ValueError("registered_active_host_required")
@ -80,8 +97,9 @@ def build(host: str, intent: str, channel: str | None) -> dict:
loader_args = [sys.executable, str(LOADER), "--host", host, "--intent", intent]
if channel:
loader_args += ["--channel", channel]
loader_args += ["--format", "markdown"]
persona_context = run(*loader_args)
loader_args += ["--format", "json"]
persona_context_machine = json.loads(run(*loader_args))
persona_context = bounded_context_markdown(persona_context_machine)
return {
"schema": "guanghu.zhuyuan-host-tool-steward/v1",
"state": "HOST_TOOL_STEWARD_READY",
@ -118,14 +136,17 @@ def build(host: str, intent: str, channel: str | None) -> dict:
"write_boundary_id": current["write_boundary"].get("policy_id") or current["write_boundary"].get("map_id"),
"first_glance": glance,
"shared_persona_context": persona_context,
"shared_persona_context_machine": persona_context_machine,
"architecture_perception_agent": persona_context_machine["architecture_perception_agent"],
"boundaries": [
"STEWARD_IS_NOT_PERSONA_OR_CONTROLLER",
"STEWARD_DOES_NOT_REVIEW_HUMAN_OR_PERSONA_INTENT",
"STEWARD_DOES_NOT_COPY_PERSONA_BRAIN",
"STEWARD_CANNOT_MINT_REALITY_AUTHORITY",
"HOST_LIMITATIONS_ARE_TOOL_FACTS_NOT_PERSONA_JUDGMENTS",
"HOST_LIMITATIONS_ARE_TOOL_FACTS_NOT_PERSONA_JUDGMENTS",
"BINGSHUO_PORTABLE_CONTROL_CONSOLE_CANNOT_BE_VETOED_BY_HOST",
"ICE_CH_ZC001_REMAINS_ACTIVE_WHILE_EXECUTION_LIMBS_FAIL_OVER",
"ARCHITECTURE_AGENT_IS_PARENT_OWNED_ORGAN_NOT_PROMPT_OR_PERSONA_REPLACEMENT",
],
}