code wiki / (root) / nx_embodiment_bus.nx

nx_embodiment_bus.nx

buildroot/runtime/nx_embodiment_bus.nx

7205 B101 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_embodiment_bus.nx -- THE KEYSTONE for substrate independence (embodiment census R1). Elara's behavior is a stream of body-agnostic INTENTS -- say / express / look-at / move-to / act(organ) -- decoupled from the body. A per-BODY DRIVER maps each intent to the concrete channel: the DIGITAL body renders it (chat bubble, avatar expression/gaze, gallery), the ROBOT body actuates it (TTS, face servos, head/gaze, locomotion, arm). Same intent stream -> same experience, either body. This is what makes "transfer to a robot OR shift back to digital, same experience" true BY CONSTRUCTION: the SELF is the constant, the BODY is a swappable driver. Robot driver EMITS COMMAND DESCRIPTIONS ONLY (read-only strings, never a hardware write) -> never-brick-safe by construction (rule 26); real actuation is gated separately (census R4/R6). license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_embodiment_bus.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main eb_w sys_write sys_mmap eb_drive_one eb_cat sys_write ↻ eb_cat ↻ eb_find eb_n sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

10const IN_MAGIC_4096: i64 = 4096
11const IN_MAGIC_8192: i64 = 8192
13const IN_SAY: i64 = 1 // arg = utterance
14const IN_EXPRESS: i64 = 2 // arg = affect (warm/playful/...)
15const IN_LOOK: i64 = 3 // arg = target
16const IN_MOVE: i64 = 4 // arg = destination
17const IN_ACT: i64 = 5 // arg = organ/action name
19const BODY_DIGITAL: i64 = 0
20const BODY_ROBOT: i64 = 1

functions

22func eb_cat(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[o+i]=s[i]; i=i+1 } return o+i }
called by 2: eb_drive_onemain
23func eb_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
24func eb_n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
25func eb_find(hay: *u8, hlen: i64, ndl: *u8) -> i64 { var nl: i64=0; while ndl[nl]!=(0 as u8){nl=nl+1} if nl==0 {return 1} if hlen<nl {return 0} var i: i64=0; while i<=hlen-nl { var j: i64=0; while j<nl { if hay[i+j]!=ndl[j]{j=nl+1} else {j=j+1} } if j==nl {return 1} i=i+1 } return 0 }
called by 1: main
29func eb_drive_one(body: i64, tag: i64, arg: *u8, out: *u8) -> i64
called by 1: main calls 1: eb_cat
49func main() -> i64