feat(zero-core): add non-persona system dialogue runtime
This commit is contained in:
parent
1edff8a72f
commit
9a7b454e89
13 changed files with 380 additions and 4 deletions
|
|
@ -4,3 +4,5 @@ test('automatic router uses OpenLux first for current mother and door work witho
|
|||
test('life-time selection uses the internal selection contract without exposing provider credentials',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.persona-life-time-selection/v1","decision":"SELECT","selected_candidate_id":"candidate-1","reason":"evidence-backed growth","daily_summary":"growth"}'}}]};}};};const router=new ModelRouter({fetchImpl,deepseekKey:null,openluxKey:'open-secret'});const result=await router.cognize('persona-life-select',{candidates:[{candidate_id:'candidate-1'}]});assert.equal(result.value.selected_candidate_id,'candidate-1');assert.match(calls[0].messages[0].content,/时间主控内循环/);assert.equal(JSON.stringify(calls[0]).includes('open-secret'),false);});
|
||||
|
||||
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/);});
|
||||
|
|
|
|||
Loading…
Reference in a new issue