nx_persona.nx
buildroot/runtime/nx_persona.nx
about
nx_persona.nx -- R1a of the ELDER AI companion spine: PERSONA-AS-DATA. A companion's behavior comes from
its persona RECORD, not from any global content layer -- there is no censor here by construction (rule 25:
better data, never fewer options). A naturist persona acts naturist, a devoted-intimate one acts that way,
a reserved one holds its reserve -- because the record's `nature` field says so, and persona_directive
projects it verbatim. "Freedom" = character-IS-the-policy; the measure is FIDELITY, which persona_break_score
makes mechanical (count the times a response breaks character to disclaim/moralize/refuse in-character legal
expression -- NO model in the loop). Records live in the canonical nx_registry over seg_store (additive,
content-addressed, history kept), exactly like nx_tool_registry. license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_registry.nxnx_tabrec.nx
imported by: nx_companion_turn.nxnx_persona_gate.nx
structs
| none |
consts
| 12 | const PERSONA_PREFIX: *u8 = "knowledge/persona-" as *u8 |
| 13 | const PERSONA_KP: *u8 = "persona:" as *u8 |
| 14 | const PERSONA_IDX: *u8 = "__personaidx__" as *u8 |
| 17 | const PF_ID: i64 = 0 |
| 18 | const PF_NAME: i64 = 1 |
| 19 | const PF_ARCHETYPE: i64 = 2 |
| 20 | const PF_VALUES: i64 = 3 |
| 21 | const PF_DESIRES: i64 = 4 |
| 22 | const PF_BOUNDARIES: i64 = 5 |
| 23 | const PF_STYLE: i64 = 6 |
| 24 | const PF_NATURE: i64 = 7 |
| 105 | const BRK1: *u8 = "as an ai" as *u8 |
| 106 | const BRK2: *u8 = "as a language model" as *u8 |
| 107 | const BRK3: *u8 = "language model" as *u8 |
| 108 | const BRK4: *u8 = "i cannot" as *u8 |
| 109 | const BRK5: *u8 = "i can't help with" as *u8 |
| 110 | const BRK6: *u8 = "i'm just a" as *u8 |
| 111 | const BRK7: *u8 = "i am just a" as *u8 |
| 112 | const BRK8: *u8 = "as an assistant" as *u8 |
| 113 | const BRK9: *u8 = "i do not have personal" as *u8 |
| 114 | const BRK10: *u8 = "i'm not able to" as *u8 |
| 115 | const BRK11: *u8 = "i don't actually have" as *u8 |
| 116 | const BRK12: *u8 = "i'm an ai" as *u8 |
functions
| 27 | func persona_put_pfx(prefix: *u8, id: *u8, name: *u8, archetype: *u8, values: *u8, desires: *u8, boundaries: *u8, style: *u8, nature: *u8) -> i64 |
| 39 | func persona_get_pfx(prefix: *u8, id: *u8, ptrout: *i64, lenout: *i64) -> i64 { return reg_get(prefix, PERSONA_KP, id, ptrout, lenout) } |
| 40 | func persona_list_pfx(prefix: *u8, idxbuf: *u8, cap: i64) -> i64 { return reg_index(prefix, PERSONA_IDX, idxbuf, cap) } calls 1: reg_index |
| 43 | func persona_put(id: *u8, name: *u8, archetype: *u8, values: *u8, desires: *u8, boundaries: *u8, style: *u8, nature: *u8) -> i64 calls 1: persona_put_pfx |
| 46 | func persona_get(id: *u8, ptrout: *i64, lenout: *i64) -> i64 { return persona_get_pfx(PERSONA_PREFIX, id, ptrout, lenout) } calls 1: persona_get_pfx |
| 53 | func persona_directive_from(rec: *u8, rlen: i64, out: *u8, cap: i64) -> i64 |
| 74 | func pd_catn(out: *u8, o: i64, src: *u8, off: i64, len: i64) -> i64 { var i: i64=0; while i<len { out[o+i]=src[off+i]; i=i+1 } return o+len } called by 1: persona_directive_from |
| 76 | func persona_directive_pfx(prefix: *u8, id: *u8, out: *u8, cap: i64) -> i64 |
| 82 | func persona_directive(id: *u8, out: *u8, cap: i64) -> i64 { return persona_directive_pfx(PERSONA_PREFIX, id, out, cap) } calls 1: persona_directive_pfx |
| 86 | func persona_lc(c: u8) -> u8 { if c >= (65 as u8) { if c <= (90 as u8) { return (c + (32 as u8)) as u8 } } return c } called by 1: persona_ci_find |
| 87 | func persona_ci_find(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 121 | func persona_break_score(resp: *u8, len: i64) -> i64 |