nx_relate_store.nx
buildroot/runtime/nx_relate_store.nx
about
nx_relate_store.nx -- PERSISTENCE for the relationship graph (turns nx_relate from pure logic into a REAL
stored data layer). Entities + edges are saved as content-addressed canon records on the sovereign APPEND-ONLY
seg_store: additive (never delete -> tombstone), tamper-evident (content-addressed CID), on YOUR hardware. This is
the CRM "sovereign exceed" (E9) made concrete for the graph, not just the notify ledger. Proves: persist a graph,
read it back byte-exact, and additivity (a second commit preserves the first). Composes nx_canon_cid + nx_seg_store
(the exact pattern proven in nx_vizsla_notify).
Records: key "ent:"+cid, fields {kind=ent, type, name, tenant} ; key "edg:"+cid, fields {kind=edg, from, rel, to, ctx, role}.
Commands: selftest (argless -- persist+readback+additive gate). Durable use = same calls with a knowledge/ prefix.
expect_exit: 0 license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.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
| 13 | const K_MAGIC_2048: i64 = 2048 |
functions
| 15 | func p(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 16 | func pn(v: i64) -> i64 |
| 22 | func rs_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: rs_kmemeq |
| 23 | func rs_eq(a: *u8, b: *u8) -> i64 called by 1: rs_count |
| 29 | func rs_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } |
| 30 | func rs_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 37 | func rs_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64 |
| 43 | func rs_iskind(b: *u8, koff: i64, kl: i64, pfx: *u8) -> i64 |
| 48 | func rs_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64 |
| 68 | func rs_save_entity(w: *i64, etype: *u8, name: *u8, tenant: *u8) -> i64 |
| 78 | func rs_save_edge(w: *i64, from: *u8, rel: *u8, to: *u8, ctx: *u8, role: *u8) -> i64 |
| 90 | func rs_count(prefix: *u8, kpfx: *u8, wantname: *u8, foundp: *i64) -> i64 |
| 123 | func main() -> i64 |