code wiki / (root) / nx_identity_persist.nx

nx_identity_persist.nx

buildroot/runtime/nx_identity_persist.nx

4219 B88 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic identity
docsdependenciesstructsconstsfunctions

about

nx_identity_persist.nx -- SOVEREIGN identity-persistence drift-catcher. The #1 old-system failure (census BEHIND, disasters.json): a render can be great QUALITY but the WRONG PERSON ("canonical Elara is platinum blonde; this is a brunette"). The old platform caught it with a triangulation panel = face_embedding + hair_color + caption_check -> 0/3 PASS = drift. This is the sovereign, no-3rd-party version: at PROMPT stage it runs the two TEXT checks (hair_color: no forbidden hair terms; caption: all required identity tokens present) so a wrong-identity prompt is REJECTED BEFORE a gen is wasted -- this alone catches the exact brunette error I made. The 3rd check (face_embedding on the RENDERED image) wires to nx_sovereign_image_fr (our own LBP face recognition, no 3rd-party lib) post-render. Identity spec (required/forbidden tokens) is DATA per persona (rule 11/25). license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_identity_persist.nx nx_identity_persist_gate.nx

imports: nx_syscalls.nx

imported by: nx_identity_persist_gate.nx

structs

none

consts

13const IDP_PRESERVED: i64 = 2 // both text checks pass -> identity preserved (proceed)
14const IDP_DRIFT: i64 = 0 // a check failed -> DRIFT (reject/regenerate)

functions

16func idp_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
17func idp_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: idp_ci_find
19func idp_ci_find(hay: *u8, hlen: i64, needle: *u8, nl: i64) -> i64
called by 2: idp_list_anyidp_list_all calls 1: idp_lc
32func idp_item_at(list: *u8, llen: i64, idx: i64, out2: *i64) -> i64
42func idp_item_count(list: *u8, llen: i64) -> i64 { if llen<=0 {return 0} var c: i64=1; var i: i64=0; while i<llen { if list[i]==(0x7C as u8){c=c+1} i=i+1 } return c }
45func idp_list_any(text: *u8, tlen: i64, list: *u8) -> i64
59func idp_list_all(text: *u8, tlen: i64, list: *u8) -> i64
75func idp_prompt_verdict(prompt: *u8, plen: i64, required: *u8, forbidden: *u8, out2: *i64) -> i64
84func idp_prompt_ok(prompt: *u8, plen: i64, required: *u8, forbidden: *u8) -> i64
called by 1: main calls 2: sys_mmapidp_prompt_verdict