nx_embodiment_bus.nx
buildroot/runtime/nx_embodiment_bus.nx
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
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
structs
| none |
consts
| 10 | const IN_MAGIC_4096: i64 = 4096 |
| 11 | const IN_MAGIC_8192: i64 = 8192 |
| 13 | const IN_SAY: i64 = 1 // arg = utterance |
| 14 | const IN_EXPRESS: i64 = 2 // arg = affect (warm/playful/...) |
| 15 | const IN_LOOK: i64 = 3 // arg = target |
| 16 | const IN_MOVE: i64 = 4 // arg = destination |
| 17 | const IN_ACT: i64 = 5 // arg = organ/action name |
| 19 | const BODY_DIGITAL: i64 = 0 |
| 20 | const BODY_ROBOT: i64 = 1 |
functions
| 22 | func 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 } |
| 23 | func 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 } |
| 24 | func 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 } |
| 25 | func 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 |
| 29 | func eb_drive_one(body: i64, tag: i64, arg: *u8, out: *u8) -> i64 |
| 49 | func main() -> i64 |