code wiki / _hdl_build / nx_vizsla_dedup.nx
nx_vizsla_dedup.nx
buildroot/runtime/_hdl_build/nx_vizsla_dedup.nx
about
nx_vizsla_dedup.nx -- NISHI VIZSLA: DEDUP / MERGE (PRM/CRM depth). Operator 2026-06-23: real-system depth +
"import my linkedin my email my phone" -- imports from multiple sources create DUPLICATES of the same person.
A real CRM detects them and merges into one canonical contact WITHOUT losing data. This:
detect <prefix> <key> contacts sharing the same CURRENT value for <key> (e.g. email) =
duplicate candidates (>=2 distinct ids on one value).
merge <prefix> <survivor> <loser> <date> record a merge as an ADDITIVE "mrg:" record (rule 13:
NEVER deletes the loser -- history sacred, soft-merge, reversible).
canonical <prefix> <id> resolve the merge chain (transitive, latest-by-date) to the survivor.
view <prefix> <id> the UNIFIED profile: resolve to canonical, union the fields of the
survivor + every merged-in loser (latest-value-per-key wins).
Composes the fld: store (nx_vizsla_contact) for fields; mrg: records for the merge graph. Local, no cloud.
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
| 16 | const K_MAGIC_1970: i64 = 1970 |
| 17 | const K_MAGIC_146097: i64 = 146097 |
| 18 | const K_MAGIC_719468: i64 = 719468 |
| 19 | const K_MAGIC_4096: i64 = 4096 |
| 20 | const K_MAGIC_1024: i64 = 1024 |
| 21 | const K_MAGIC_65536: i64 = 65536 |
| 22 | const K_MAGIC_2048: i64 = 2048 |
functions
| 24 | func vd_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 25 | func vd_p(s: *u8) -> i64 { sys_write(1, s, vd_slen(s)); return 0 } |
| 27 | func vd_eq(a: *u8, b: *u8) -> i64 |
| 34 | func vd_dup(s: *u8) -> *u8 |
| 42 | func vd_cpy(out: *u8, cap: i64, s: *u8) -> i64 |
| 50 | func vd_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 56 | func vd_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 69 | func vd_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64 |
| 76 | func vd_iskind(b: *u8, koff: i64, kl: i64, pfx: *u8) -> i64 |
| 82 | func vd_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64 |
| 106 | func vd_datedays(s: *u8) -> i64 |
| 142 | func vd_collect_fld(prefix: *u8, rct: *i64, rkey: *i64, rval: *i64, rdate: *i64) -> i64 |
| 184 | func vd_latest_fld(rct: *i64, rkey: *i64, rval: *i64, rdate: *i64, n: i64, contact: *u8, key: *u8, out: *u8, cap: i64) -> i64 |
| 198 | func vd_collect_mrg(prefix: *u8, ml: *i64, ms: *i64, md: *i64) -> i64 called by 2: vd_cmd_canonicalvd_cmd_view calls 9: sys_mmapss_manifestvd_catss_readallss_r32vd_iskind+3 |
| 239 | func vd_canonical(ml: *i64, ms: *i64, md: *i64, m: i64, id: *u8, out: *u8, cap: i64) -> i64 |
| 261 | func vd_cmd_detect(argc: i64, argv: *i64) -> i64 |
| 327 | func vd_cmd_merge(argc: i64, argv: *i64) -> i64 |
| 374 | func vd_cmd_canonical(argc: i64, argv: *i64) -> i64 |
| 393 | func vd_cmd_view(argc: i64, argv: *i64) -> i64 |
| 451 | func main(argc: i64, argv: *i64) -> i64 |