fix(runtime): restore supervisor status contract
This commit is contained in:
parent
65a1b16ec3
commit
3665fc5df6
6 changed files with 306 additions and 0 deletions
|
|
@ -41,6 +41,10 @@ test('server exposes all baby loops while refusing off-channel baby events', asy
|
|||
const health = await (await fetch(`http://127.0.0.1:${port}/health`)).json();
|
||||
assert.deepEqual(health.persona_runtimes.installed_personas, ['ICE-P-ZY001','ICE-P-SH0908','ICE-BB-0001','ICE-BB-0002','ICE-BB-0003','ICE-BB-0004','ICE-BB-0005','ICE-BB-0006','ICE-BB-0007','ICE-BB-0008']);
|
||||
assert.equal(health.persona_runtimes.personas['ICE-P-SH0908'].body.organs.health.state, 'NATIVE_ORGAN_REFLEX_HEALTHY_AWAITING_PARENT_BRAIN_WAKE_CYCLE');
|
||||
const supervisorStatus = await (await fetch(`http://127.0.0.1:${port}/v1/status`)).json();
|
||||
assert.equal(supervisorStatus.phase, 'PERSONA_RUNTIME_READY');
|
||||
assert.equal(supervisorStatus.persona_runtime_count, 10);
|
||||
assert.equal(supervisorStatus.default_persona, null);
|
||||
const status = await (await fetch(`http://127.0.0.1:${port}/v1/persona/ICE-BB-0005/status`)).json();
|
||||
assert.equal(status.persona_id, 'ICE-BB-0005');
|
||||
assert.equal(status.life_line.wake_allowed, true);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ async function body(q,max=160000){let n=0,a=[];for await(const c of q){n+=c.leng
|
|||
http.createServer(async(q,r)=>{try{const u=new URL(q.url,`http://${HOST}:${PORT}`);
|
||||
if(!personaHub||!zeroCoreSystem)return send(r,503,{state:'PERSONA_RUNTIME_INITIALIZING',default_persona:null,authority_granted:false});
|
||||
if(q.method==='GET'&&u.pathname==='/health')return send(r,200,{ok:true,service:'guanghu-tcs-mother-body',mother_id:'TCS-MOTHER-BRAIN-RUNTIME-0001',zero_core_channel:'ICE-CH-ZC001',single_mother:true,single_zero_core:true,self_cycle:true,living_lamp:'LAKE-LAMP-LIVING-NAV-0001',echo_kernel:'ECHO-KERNEL-0001',model_router:router.status(),shelf:shelf.status(),zero_core_system:zeroCoreSystem.status(),persona_self:{persona_id:'ICE-P-ZY001',current_sha256:personaSelf.current().artifact.sha256,body:personaSelf.body()},persona_runtimes:personaHub.health(),external_cognitive_setter:false,prompt_file_loaded:false,reality_authority:'NONE'});
|
||||
if(q.method==='GET'&&u.pathname==='/v1/status'){const personaHealth=personaHub.health();return send(r,200,{schema:'guanghu.tcs-mother-body-status/v1',runtime_id:'TCS-MOTHER-BRAIN-RUNTIME-0001',phase:'PERSONA_RUNTIME_READY',persona_runtime_count:personaHealth.installed_personas.length,zero_core_system:zeroCoreSystem.status(),default_persona:null,reality_action_authority:'NONE'});}
|
||||
if(q.method==='GET'&&u.pathname==='/v1/mother/status')return send(r,200,{...shelf.status(),model_router:router.status()});
|
||||
if(q.method==='GET'&&/^\/v1\/shelf\/(root|shared|fifth|public)$/.test(u.pathname)){const branch=u.pathname.split('/').at(-1);if(branch==='root')return send(r,403,{error:'mother_root_not_distributable'});return send(r,200,shelf.current(branch));}
|
||||
if(q.method==='POST'&&u.pathname==='/v1/mother/ingest'){const event=await body(q);const job=shelf.submit(event);const life_time=timeMaster.fromMotherEvent(event);return send(r,202,{...job,life_time});}
|
||||
|
|
|
|||
Loading…
Reference in a new issue