nx_crm.nx
buildroot/runtime/nx_crm.nx
about
nx_crm.nx -- PROFESSIONAL CRM PIPELINE (rung 2 of Nishi CRM/Relationships to SOTA). Operator 2026-07-08:
"clients like andelinwest.com can use a state of the art crm". The sales/deal layer on top of the nx_relate
entity graph: an ACCOUNT is a company entity you do business with; an OPPORTUNITY (deal) has an amount, a close
date, and a PIPELINE-STAGE; each stage carries a win PROBABILITY + a forecast category, so the DASHBOARD shows a
weighted forecast (Salesforce OpportunityStage model, verified 2026-07-08). Plus ACTIVITY (tasks/calls/meetings on
a record) + SEQUENCE (a follow-up cadence that auto-stops on reply). Composes with nx_relate (accounts + contacts
are entities) + nx_send (reach any contact) + nx_vizsla (timeline/reminders).
NOTE (research reframe): long-term these become object/edge DEFINITIONS on the flexible nx_relate engine, not a
hardcoded silo -- this focused organ ships the value now + is refactorable to engine-config (rework-not-retire).
Pure logic + a self-test gate (argless = selftest). Persistence = next rung.
Commands: stages | account <tenant> <name> | opp <tenant> <name> <account> <amount> <stage> | activity <tenant> <record> <type> <subject> | sequence <name> <steps> | dashboard | selftest
expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_crm_gate.nxnx_crm_store.nx
structs
| none |
consts
| 14 | const K_MAGIC_50000: i64 = 50000 |
| 15 | const K_MAGIC_120000: i64 = 120000 |
| 16 | const K_MAGIC_30000: i64 = 30000 |
| 17 | const K_MAGIC_20000: i64 = 20000 |
| 18 | const K_MAGIC_10000: i64 = 10000 |
| 19 | const K_MAGIC_122500: i64 = 122500 |
functions
| 21 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 22 | func p(s: *u8) -> i64 { sys_write(1, s, slen(s)); return 0 } |
| 23 | func pn(v: i64) -> i64 |
| 29 | func seq(a: *u8, b: *u8) -> i64 |
| 37 | func stage_valid(s: *u8) -> i64 |
| 46 | func stage_prob(s: *u8) -> i64 |
| 55 | func stage_forecast(s: *u8) -> *u8 |
| 64 | func stage_open(s: *u8) -> i64 |
| 70 | func cmd_stages() -> i64 |
| 82 | func cmd_account(tenant: *u8, name: *u8) -> i64 |
| 85 | func cmd_opp(tenant: *u8, name: *u8, account: *u8, amount: i64, stage: *u8) -> i64 |
| 94 | func cmd_activity(tenant: *u8, record: *u8, kind: *u8, subject: *u8) -> i64 |
| 104 | func cmd_sequence(name: *u8, steps: i64) -> i64 |
| 112 | func cmd_dashboard() -> i64 |
| 137 | func cmd_selftest() -> i64 |
| 172 | func cm_cli(argc: i64, argv: *i64) -> i64 |