code wiki / _hdl_build / nx_vizsla_segment.nx
nx_vizsla_segment.nx
buildroot/runtime/_hdl_build/nx_vizsla_segment.nx
about
nx_vizsla_segment.nx -- NISHI VIZSLA: SAVED SEGMENTS / SMART VIEWS (PRM/CRM depth). Operator 2026-06-23:
real-system depth. A real CRM lets you NAME and SAVE a multi-criteria filter ("Dallas leads", "colleagues
I haven't talked to") and re-run it as the data changes. This stores named segment definitions as ADDITIVE
CID records on the sovereign seg_store plane (latest-by-date wins per name; history kept, tamper-evident,
idempotent) and APPLIES them against the live "fld:" contact-field store (the same store nx_vizsla_contact
writes) with AND semantics over up to 3 criteria, latest-value-per-(contact,key) wins. Computed locally; no
cloud, no data sale. Deterministic (no clock in stdout).
define <prefix> <name> <date> <k1> <v1> [<k2> <v2> [<k3> <v3>]] -> "seg:" record {name,date,crit}
apply <prefix> <name> contacts whose CURRENT fields match ALL criteria of the latest def of <name>
list <prefix> every saved segment (latest def per name) + its criteria
crit packed "k1=v1|k2=v2|k3=v3" (keys/values are single tokens). 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
| 15 | const K_MAGIC_1970: i64 = 1970 |
| 16 | const K_MAGIC_146097: i64 = 146097 |
| 17 | const K_MAGIC_719468: i64 = 719468 |
| 18 | const K_MAGIC_4096: i64 = 4096 |
| 19 | const K_MAGIC_2048: i64 = 2048 |
| 20 | const K_MAGIC_1024: i64 = 1024 |
| 21 | const K_MAGIC_65536: i64 = 65536 |
functions
| 23 | func vg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 24 | func vg_p(s: *u8) -> i64 { sys_write(1, s, vg_slen(s)); return 0 } |
| 26 | func vg_eq(a: *u8, b: *u8) -> i64 |
| 33 | func vg_dup(s: *u8) -> *u8 |
| 41 | func vg_atoi(s: *u8) -> i64 |
| 48 | func vg_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 54 | func vg_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 67 | func vg_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64 |
| 74 | func vg_iskind(b: *u8, koff: i64, kl: i64, pfx: *u8) -> i64 |
| 80 | func vg_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64 |
| 104 | func vg_datedays(s: *u8) -> i64 |
| 140 | func vg_flush(kb: *u8, ko: i64, vb: *u8, vo: i64, ck: *i64, cv: *i64, ncp: *i64) -> i64 |
| 148 | func vg_parse_crit(crit: *u8, ck: *i64, cv: *i64) -> i64 |
| 175 | func vg_collect(prefix: *u8, rct: *i64, rkey: *i64, rval: *i64, rdate: *i64) -> i64 |
| 217 | func vg_latest(rct: *i64, rkey: *i64, rval: *i64, rdate: *i64, n: i64, contact: *u8, key: *u8, out: *u8, cap: i64) -> i64 |
| 236 | func vg_matches(rct: *i64, rkey: *i64, rval: *i64, rdate: *i64, n: i64, contact: *u8, ck: *i64, cv: *i64, nc: i64) -> i64 |
| 250 | func vg_seg_latest(prefix: *u8, name: *u8, critout: *u8, cap: i64) -> i64 |
| 292 | func vg_cmd_define(argc: i64, argv: *i64) -> i64 |
| 355 | func vg_cmd_apply(argc: i64, argv: *i64) -> i64 |
| 399 | func vg_cmd_list(argc: i64, argv: *i64) -> i64 |
| 453 | func main(argc: i64, argv: *i64) -> i64 |