code wiki / _hdl_build / nx_vizsla_segment.nx

nx_vizsla_segment.nx

buildroot/runtime/_hdl_build/nx_vizsla_segment.nx

18147 B461 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind tooltopic vizsla
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_vizsla_segment.nx

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

main vg_p sys_write vg_slen vg_eq vg_cmd_define vg_p ↻ vg_datedays sys_mmap sys_mmap ↻ vg_cat canon_encode sys_mmap ↻ cc_cmp cc_w32 cc_len sys_munmap cid_of sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word sha256_final blk_set_byte ↻ sha256_compress ↻ cid_from_digest sys_munmap ↻ ss_get_idx sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn sys_mmap ↻

structs

none

consts

15const K_MAGIC_1970: i64 = 1970
16const K_MAGIC_146097: i64 = 146097
17const K_MAGIC_719468: i64 = 719468
18const K_MAGIC_4096: i64 = 4096
19const K_MAGIC_2048: i64 = 2048
20const K_MAGIC_1024: i64 = 1024
21const K_MAGIC_65536: i64 = 65536

functions

23func vg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
24func vg_p(s: *u8) -> i64 { sys_write(1, s, vg_slen(s)); return 0 }
26func vg_eq(a: *u8, b: *u8) -> i64
33func vg_dup(s: *u8) -> *u8
41func vg_atoi(s: *u8) -> i64
48func vg_cat(dst: *u8, off: i64, s: *u8) -> i64
54func vg_catn(dst: *u8, off: i64, v: i64) -> i64
67func vg_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64
called by 2: vg_iskindvg_field calls 1: vg_slen
74func vg_iskind(b: *u8, koff: i64, kl: i64, pfx: *u8) -> i64
80func vg_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64
104func vg_datedays(s: *u8) -> i64
140func vg_flush(kb: *u8, ko: i64, vb: *u8, vo: i64, ck: *i64, cv: *i64, ncp: *i64) -> i64
called by 1: vg_parse_crit calls 1: vg_dup
148func vg_parse_crit(crit: *u8, ck: *i64, cv: *i64) -> i64
called by 1: vg_cmd_apply calls 2: sys_mmapvg_flush
175func vg_collect(prefix: *u8, rct: *i64, rkey: *i64, rval: *i64, rdate: *i64) -> i64
217func vg_latest(rct: *i64, rkey: *i64, rval: *i64, rdate: *i64, n: i64, contact: *u8, key: *u8, out: *u8, cap: i64) -> i64
called by 1: vg_matches calls 1: vg_eq
236func vg_matches(rct: *i64, rkey: *i64, rval: *i64, rdate: *i64, n: i64, contact: *u8, ck: *i64, cv: *i64, nc: i64) -> i64
called by 1: vg_cmd_apply calls 3: sys_mmapvg_latestvg_eq
250func vg_seg_latest(prefix: *u8, name: *u8, critout: *u8, cap: i64) -> i64
292func vg_cmd_define(argc: i64, argv: *i64) -> i64
355func vg_cmd_apply(argc: i64, argv: *i64) -> i64
399func vg_cmd_list(argc: i64, argv: *i64) -> i64
453func main(argc: i64, argv: *i64) -> i64