nx_companion_proactive.nx
buildroot/runtime/nx_companion_proactive.nx
about
nx_companion_proactive.nx -- SHE REACHES OUT FIRST (Replika-census P2: proactivity, the signature "thinking of
you" behavior). Closes a BEHIND row sovereignly, NO 7B needed: given hours-since-last-contact + her relationship
stage + a RECALLED memory fact, she composes an UNPROMPTED, time-aware, PERSONALIZED check-in that references
something she actually remembers about you. The differentiator vs Replika's generic nudges: hers is grounded in
YOUR real memory (nx_companion_memory). This is her INITIATING, not responding. Template scaffold now; the 7B
makes it fluent later (same forward). license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_companion_memory.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
| 9 | const K_MAGIC_1024: i64 = 1024 |
| 10 | const K_MAGIC_4096: i64 = 4096 |
| 12 | const PERSONA: *u8 = "elara_proactive" as *u8 |
functions
| 14 | func pw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func pn(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 } |
| 16 | func pcat(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 1: compose |
| 17 | func pfind(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 |
| 20 | func opener(hours: i64, stage: i64) -> *u8 called by 1: compose |
| 28 | func recall_recent(out: *u8) -> i64 |
| 48 | func compose(hours: i64, stage: i64, out: *u8) -> i64 |
| 61 | func main() -> i64 |