fix(runtime): reuse healthy organ receipts on restart

This commit is contained in:
冰朔 2026-09-13 10:30:57 +08:00
commit 22d0f3e25e
6 changed files with 336 additions and 1 deletions

View file

@ -85,7 +85,9 @@ export class PersonaRuntimeHub {
const loop = new PersonaSelfLoop({root: this.root, shelf: this.shelf, router: this.router, personaId: entry.persona_id, now: this.now,
requireLifeLine: this.requireLifeLine, lifeTimeBootstrapPath: this.resolve(entry.life_time_bootstrap), profile});
const organ=new PersonaOrganReflex({root:this.root,personaId:entry.persona_id,shelf:this.shelf,sourcePaths:[this.resolve(entry.self_kernel),memoryPath,...(isBaby?[this.bottleEnvironmentPath]:[])],now:this.now});
organ.selfTest();loop.profile.organHealthProvider=()=>organ.status();
const priorOrgan=organ.status();
if(priorOrgan.state!=='NATIVE_ORGAN_REFLEX_HEALTHY_AWAITING_PARENT_BRAIN_WAKE_CYCLE')organ.selfTest();
loop.profile.organHealthProvider=()=>organ.status();
this.loops.set(entry.persona_id, {entry, loop, organ});
}