code wiki / (root) / nx_relate.nx

nx_relate.nx

buildroot/runtime/nx_relate.nx

10509 B171 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic relate
docsdependenciesstructsconstsfunctions

about

nx_relate.nx -- THE UNIFIED RELATIONSHIP GRAPH (rung 1 of Nishi CRM/Relationships to SOTA). Operator 2026-07-08: "more than just crm ... a personal AND a professional aka network of people so relationships across everything can be managed -- even church or other orgs or whatever". ONE graph, typed: ENTITY-TYPE : person | company | org | household (people AND the things they belong to) REL-EDGE : typed relationship between two entities (works-at | member-of | family | reports-to | donor-to | friend | colleague) -- semantics-checked (works-at needs a company, member-of needs an org/household, family needs two people, ...) REL-ROLE : the role on that edge (title / position / ministry) -- e.g. Managing Partner, Relief Society President REL-CONTEXT : which world the relationship lives in (personal | professional | church | civic | community) HOUSEHOLD : a family/household is a first-class entity that groups people CUSTOM-FIELD: arbitrary key=value on any entity (flexible schema, Attio-style) TENANT : every entity is scoped to a workspace/tenant, so clients like andelinwest get isolation So one person can be family + a church member + an employee at once -- across everything, in ONE graph. Integrates with nx_send (a send-intent targets any entity) + Vizsla contacts/timeline/reminders. Pure logic + a self-test gate (argless = selftest). Persistence + UI = next rungs. Commands: entity <tenant> <type> <name> | edge <tenant> <fromType> <fromName> <kind> <toType> <toName> <context> [role] | field <tenant> <entity> <key> <value> | selftest expect_exit: 0 license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_relate.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main cmd_selftest p sys_write slen re_valid_type seq re_valid_kind seq ↻ re_valid_context seq ↻ re_edge_ok re_valid_kind ↻ seq ↻ cmd_entity re_valid_type ↻ p ↻ cmd_edge re_valid_type ↻ re_valid_kind ↻ re_valid_context ↻ re_edge_ok ↻ p ↻ cmd_field is_empty p ↻ seq ↻ p ↻ cmd_entity ↻ cmd_edge ↻ cmd_field ↻

structs

none

consts

none

functions

21func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: p
22func p(s: *u8) -> i64 { sys_write(1, s, slen(s)); return 0 }
23func seq(a: *u8, b: *u8) -> i64
29func is_empty(s: *u8) -> i64 { if s[0] == (0 as u8) { return 1 } return 0 }
called by 1: cmd_field
32func re_valid_type(t: *u8) -> i64
called by 3: cmd_entitycmd_edgecmd_selftest calls 1: seq
40func re_valid_kind(k: *u8) -> i64
called by 3: re_edge_okcmd_edgecmd_selftest calls 1: seq
52func re_valid_context(c: *u8) -> i64
called by 2: cmd_edgecmd_selftest calls 1: seq
61func re_edge_ok(fromType: *u8, kind: *u8, toType: *u8) -> i64
71func cmd_entity(tenant: *u8, t: *u8, name: *u8) -> i64
called by 2: cmd_selftestmain calls 2: re_valid_typep
76func cmd_edge(tenant: *u8, fromType: *u8, fromName: *u8, kind: *u8, toType: *u8, toName: *u8, context: *u8, role: *u8) -> i64
91func cmd_field(tenant: *u8, entity: *u8, key: *u8, val: *u8) -> i64
called by 2: cmd_selftestmain calls 2: is_emptyp
97func cmd_selftest() -> i64
151func main(argc: i64, argv: *i64) -> i64