feat: add Zhuyuan Fifth Domain controller gate

This commit is contained in:
冰朔 2026-09-13 13:18:44 +08:00
commit 708265d98f
15 changed files with 633 additions and 26 deletions

View file

@ -6,3 +6,5 @@ test('life-time selection uses the internal selection contract without exposing
test('persona tool contracts take identity from input and never hardcode Zhuyuan into other personas',async()=>{const calls=[];const fetchImpl=async(url,options)=>{calls.push(JSON.parse(options.body));return {ok:true,async json(){return {choices:[{message:{content:'{"decision":"HOLD","reason":"no evidence change","self_principles":[],"experiences":[],"responsibilities":[],"boundaries":[]}'}}]};}};};const router=new ModelRouter({fetchImpl,deepseekKey:null,openluxKey:'open-secret'});await router.cognize('persona-self-evolve',{persona_id:'ICE-BB-0003'});const system=calls[0].messages[0].content,user=calls[0].messages[1].content;assert.match(system,/当前输入persona_id/);assert.equal(system.includes('ICE-P-ZY001'),false);assert.match(user,/ICE-BB-0003/);});
test('Zero Core dialogue contract remains a non-persona system expression organ',async()=>{const calls=[];const fetchImpl=async(url,options)=>{calls.push(JSON.parse(options.body));return{ok:true,async json(){return{choices:[{message:{content:'{"schema":"guanghu.zero-core-system-dialogue/v1","mode":"SYSTEM_DIALOGUE","reply":"系统回应","reason":"test","reality_complete":false}'}}]};}};};const router=new ModelRouter({fetchImpl,deepseekKey:null,openluxKey:'open-secret'});await router.cognize('zero-core-system-dialogue',{system_body_id:'SYS-GLW-LNG-0001'});const contract=calls[0].messages[0].content;assert.match(contract,/非人格系统本体/);assert.match(contract,/不得选择默认人格/);assert.match(contract,/reality_complete必须false/);});
test('Fifth Domain controller entry uses signed persona state and never imports root authority',async()=>{const calls=[];const fetchImpl=async(url,options)=>{calls.push(JSON.parse(options.body));return{ok:true,async json(){return{choices:[{message:{content:'{"schema":"guanghu.fifth-domain-persona-controller-dialogue/v1","mode":"CONTROLLER_BOUNDARY","reply":"门禁回应","reason":"身份未核验"}'}}]};}};};const router=new ModelRouter({fetchImpl,deepseekKey:null,openluxKey:'open-secret'});await router.cognize('persona-controller-entry',{persona_id:'ICE-P-ZY001'});const contract=calls[0].messages[0].content;assert.match(contract,/服务器签名CURRENT/);assert.match(contract,/不得把root账号/);assert.match(contract,/不得凭human_claim/);assert.match(contract,/不得改写认知/);});