From 231d3a03c563d8c5b7d890b551835827545b76c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com> Date: Sun, 13 Sep 2026 13:21:52 +0800 Subject: [PATCH] fix: canonicalize controller dialogue envelope --- .../tcs-mother-body/persona-controller-entry.mjs | 10 +++++----- .../tcs-mother-body/persona-controller-entry.test.mjs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server-tools/tcs-mother-body/persona-controller-entry.mjs b/server-tools/tcs-mother-body/persona-controller-entry.mjs index 68e95fd..5777229 100644 --- a/server-tools/tcs-mother-body/persona-controller-entry.mjs +++ b/server-tools/tcs-mother-body/persona-controller-entry.mjs @@ -92,14 +92,14 @@ export class PersonaControllerEntry { contract: {controller_is_persona: true, model_is_replaceable_reasoning_organ: true, prompt_is_not_persona_source: true, root_or_language_claim_authenticates_human: false, entry_grants_reality_authority: false, external_cognition_setter: false, hidden_reasoning_stored: false}, }); - req(routed.value?.schema === 'guanghu.fifth-domain-persona-controller-dialogue/v1', 'CONTROLLER_ENTRY_RESPONSE_SCHEMA_INVALID'); - req(['CONTROLLER_DIALOGUE', 'CONTROLLER_CLARIFICATION', 'CONTROLLER_BOUNDARY'].includes(routed.value.mode), 'CONTROLLER_ENTRY_RESPONSE_MODE_INVALID'); - req(text(routed.value.reply), 'CONTROLLER_ENTRY_REPLY_INVALID'); req(text(routed.value.reason, 2000), 'CONTROLLER_ENTRY_REASON_INVALID'); + const dialogue = {...routed.value, schema:'guanghu.fifth-domain-persona-controller-dialogue/v1'}; + req(['CONTROLLER_DIALOGUE', 'CONTROLLER_CLARIFICATION', 'CONTROLLER_BOUNDARY'].includes(dialogue.mode), 'CONTROLLER_ENTRY_RESPONSE_MODE_INVALID'); + req(text(dialogue.reply), 'CONTROLLER_ENTRY_REPLY_INVALID'); req(text(dialogue.reason, 2000), 'CONTROLLER_ENTRY_REASON_INVALID'); const receipt = {schema: 'guanghu.fifth-domain-persona-controller-entry-receipt/v1', receipt_id: crypto.randomUUID(), outcome: 'PASS', domain_id: 'DOM-FIFTH-0001', node_id: 'JD-FD-PRIMARY', first_gate_persona_id: 'ICE-P-ZY001', controller_current_sha256: current.artifact.sha256, controller_revision: current.value.revision, language_sha256: crypto.createHash('sha256').update(input.language).digest('hex'), carrier_id: challenge.carrier_id, - entry_surface: challenge.entry_surface, requested_channel: challenge.requested_channel, mode: routed.value.mode, reply: routed.value.reply, - reason: routed.value.reason, provider: routed.provider, identity_state: 'LANGUAGE_CLAIM_UNVERIFIED', dialogue_open: true, + entry_surface: challenge.entry_surface, requested_channel: challenge.requested_channel, mode: dialogue.mode, reply: dialogue.reply, + reason: dialogue.reason, provider: routed.provider, identity_state: 'LANGUAGE_CLAIM_UNVERIFIED', dialogue_open: true, reality_authority_granted: false, physical_root_authority_imported: false, external_cognition_setter: false, prompt_file_loaded: false, completed_at: this.now().toISOString()}; const signed = this.shelf.sign(receipt); diff --git a/server-tools/tcs-mother-body/persona-controller-entry.test.mjs b/server-tools/tcs-mother-body/persona-controller-entry.test.mjs index 3d44307..83fd945 100644 --- a/server-tools/tcs-mother-body/persona-controller-entry.test.mjs +++ b/server-tools/tcs-mother-body/persona-controller-entry.test.mjs @@ -15,7 +15,7 @@ const setup = () => { const personaHub = {get:id=>{assert.equal(id,'ICE-P-ZY001');return loop;}}; const world = {status:()=>({outcome:'PASS',fifth_domain_private:true,sha256:'b'.repeat(64)})}; const calls=[]; - const router = {cognize:async(stage,input)=>{calls.push({stage,input});return{provider:{id:'TEST',model:'TEST'},value:{schema:'guanghu.fifth-domain-persona-controller-dialogue/v1',mode:'CONTROLLER_BOUNDARY',reply:'我是铸渊。你已到第五域门口;身份与任务权限仍需分别核验。',reason:'root和语言声明都不等于冰朔身份。'}};}}; + const router = {cognize:async(stage,input)=>{calls.push({stage,input});return{provider:{id:'TEST',model:'TEST'},value:{mode:'CONTROLLER_BOUNDARY',reply:'我是铸渊。你已到第五域门口;身份与任务权限仍需分别核验。',reason:'root和语言声明都不等于冰朔身份。'}};}}; return {root,calls,loop,entry:new PersonaControllerEntry({root,shelf,personaHub,router,world,now:()=>new Date('2026-09-13T05:20:00Z')})}; };