nx_companion_turn.nx
buildroot/runtime/nx_companion_turn.nx
about
nx_companion_turn.nx -- R1e CAPSTONE of the ELDER AI companion spine: compose ONE turn's generation context
from the three proven organs. This is what makes persona + memory + relationship a coherent BEING rather
than parts: given an incoming message, it assembles (1) WHO ELDER IS (persona directive, projected verbatim
-- no censor), (2) WHO YOU ARE TO ELDER (relationship state), (3) WHAT ELDER REMEMBERS RELEVANT TO THIS
(episodes retrieved by the topic of the incoming message -- grounded recall, not a memory dump), and (4) the
incoming message + a stay-in-character instruction. The result is the exact context a sovereign LLM would
condition on to produce an in-character, memory-grounded, relationship-aware reply. license_tier: ORIGINAL
dependencies 3 imports · 1 importers
imports: nx_persona.nxnx_companion_memory.nxnx_companion_rel.nx
imported by: nx_companion_turn_gate.nx
structs
| none |
consts
| 11 | const K_MAGIC_8192: i64 = 8192 |
functions
| 13 | func ct_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: companion_context_pfx |
| 14 | func ct_catz(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ d[o+i]=s[i]; i=i+1 } return o+i } called by 1: companion_context_pfx |
| 15 | func ct_catn(d: *u8, o: i64, src: *u8, off: i64, len: i64) -> i64 { var i: i64=0; while i<len { d[o+i]=src[off+i]; i=i+1 } return o+len } called by 1: companion_context_pfx |
| 16 | func ct_alpha(c: u8) -> i64 { if c >= (65 as u8) { if c <= (90 as u8) { return 1 } } if c >= (97 as u8) { if c <= (122 as u8) { return 1 } } return 0 } called by 1: companion_context_pfx |
| 20 | func companion_context_pfx(pp: *u8, mp: *u8, rp: *u8, pid: *u8, user: *u8, inc: *u8, out: *u8, cap: i64) -> i64 called by 2: companion_contextmain calls 8: persona_directive_pfxct_catzrel_context_pfxct_slenct_alphamem_search_pfx+2 |
| 94 | func companion_context(pid: *u8, user: *u8, inc: *u8, out: *u8, cap: i64) -> i64 calls 1: companion_context_pfx |