nx_relate.nx
buildroot/runtime/nx_relate.nx
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
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
structs
| none |
consts
| none |
functions
| 21 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: p |
| 22 | func p(s: *u8) -> i64 { sys_write(1, s, slen(s)); return 0 } |
| 23 | func seq(a: *u8, b: *u8) -> i64 |
| 29 | func is_empty(s: *u8) -> i64 { if s[0] == (0 as u8) { return 1 } return 0 } called by 1: cmd_field |
| 32 | func re_valid_type(t: *u8) -> i64 |
| 40 | func re_valid_kind(k: *u8) -> i64 |
| 52 | func re_valid_context(c: *u8) -> i64 |
| 61 | func re_edge_ok(fromType: *u8, kind: *u8, toType: *u8) -> i64 |
| 71 | func cmd_entity(tenant: *u8, t: *u8, name: *u8) -> i64 |
| 76 | func cmd_edge(tenant: *u8, fromType: *u8, fromName: *u8, kind: *u8, toType: *u8, toName: *u8, context: *u8, role: *u8) -> i64 |
| 91 | func cmd_field(tenant: *u8, entity: *u8, key: *u8, val: *u8) -> i64 |
| 97 | func cmd_selftest() -> i64 |
| 151 | func main(argc: i64, argv: *i64) -> i64 |