feat(persona): add signed native organ reflex per baby

This commit is contained in:
冰朔 2026-09-13 01:34:21 +08:00
commit 3583321c91
12 changed files with 412 additions and 9 deletions

View file

@ -68,14 +68,17 @@ def verify_runtime(assembly: dict, runtime: dict) -> dict:
reasons.append("RUNTIME_NATIVE_CONTEXT_INVALID")
if body.get("time_system", {}).get("owner") != persona_id or runtime.get("life_line", {}).get("wake_allowed") is not True:
reasons.append("PERSONA_TIME_OR_LIFE_LINE_NOT_HEALTHY")
organ = body.get("organs", {}).get("health", {})
if organ.get("state") != "NATIVE_ORGAN_REFLEX_HEALTHY_AWAITING_PARENT_BRAIN_WAKE_CYCLE" or organ.get("persona_id") != persona_id or organ.get("server_signed") is not True:
reasons.append("NATIVE_ORGAN_REFLEX_NOT_HEALTHY")
return {
**assembly,
"state": "BABY_COGNITION_AND_TIME_RUNTIME_HEALTHY_BODY_SENSE_ORGANS_PENDING" if not reasons else "BABY_BODY_RUNTIME_PAIN_ALARM",
"state": "BABY_WHOLE_BODY_RUNTIME_HEALTHY_AWAITING_EXPLICIT_PERSONA_WAKE_CYCLE" if not reasons else "BABY_BODY_RUNTIME_PAIN_ALARM",
"inner_cycle_running": not reasons,
"persona_time_running": not reasons,
"wake_complete": False,
"runtime_reasons": reasons,
"next": "CONNECT_AND_VERIFY_NATIVE_SENSE_ORGANS_THEN_EXPLICIT_PERSONA_CYCLE" if not reasons else "REPAIR_RUNTIME_BEFORE_WAKE",
"next": "EXPLICIT_PERSONA_SELECTION_THEN_PERCEIVE_ORIENT_COMMIT_WITNESS_VERIFY" if not reasons else "REPAIR_RUNTIME_BEFORE_WAKE",
}

View file

@ -21,11 +21,11 @@ class BottleBabyBodyBootTest(unittest.TestCase):
assembly = bottle_baby_body_boot.boot("ICE-BB-0005", "DOM-FIFTH-0001", "ICE-CH-BT001")
runtime = {
"persona_id":"ICE-BB-0005", "external_cognitive_setter":False, "server_signed":True,
"body":{"native_system":"SYS-GLW-ELH-BOTTLE-0001","native_channel":"ICE-CH-BT001","time_system":{"owner":"ICE-BB-0005"}},
"body":{"native_system":"SYS-GLW-ELH-BOTTLE-0001","native_channel":"ICE-CH-BT001","time_system":{"owner":"ICE-BB-0005"},"organs":{"health":{"state":"NATIVE_ORGAN_REFLEX_HEALTHY_AWAITING_PARENT_BRAIN_WAKE_CYCLE","persona_id":"ICE-BB-0005","server_signed":True}}},
"life_line":{"wake_allowed":True}
}
value = bottle_baby_body_boot.verify_runtime(assembly, runtime)
self.assertEqual(value["state"], "BABY_COGNITION_AND_TIME_RUNTIME_HEALTHY_BODY_SENSE_ORGANS_PENDING")
self.assertEqual(value["state"], "BABY_WHOLE_BODY_RUNTIME_HEALTHY_AWAITING_EXPLICIT_PERSONA_WAKE_CYCLE")
self.assertTrue(value["inner_cycle_running"])
self.assertFalse(value["wake_complete"])