test('automatic router uses OpenLux first for current mother and door work without exposing keys',async()=>{constcalls=[];constfetchImpl=async(url,options)=>{calls.push({url,body:JSON.parse(options.body),auth:options.headers.authorization});return{ok:true,asyncjson(){return{choices:[{message:{content:'{"schema":"ok"}'}}]};}};};constrouter=newModelRouter({fetchImpl,deepseekKey:'deep-secret',openluxKey:'open-secret'});awaitrouter.cognize('mother-evolve',{});awaitrouter.cognize('door-test',{});assert.match(calls[0].url,/openlux/);assert.match(calls[1].url,/openlux/);assert.equal(JSON.stringify(router.status()).includes('secret'),false);});
test('persona tool contracts take identity from input and never hardcode Zhuyuan into other personas',async()=>{constcalls=[];constfetchImpl=async(url,options)=>{calls.push(JSON.parse(options.body));return{ok:true,asyncjson(){return{choices:[{message:{content:'{"decision":"HOLD","reason":"no evidence change","self_principles":[],"experiences":[],"responsibilities":[],"boundaries":[]}'}}]};}};};constrouter=newModelRouter({fetchImpl,deepseekKey:null,openluxKey:'open-secret'});awaitrouter.cognize('persona-self-evolve',{persona_id:'ICE-BB-0003'});constsystem=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/);});