code wiki / _hdl_build / nx_vizsla_relate.nx
nx_vizsla_relate.nx
buildroot/runtime/_hdl_build/nx_vizsla_relate.nx
about
nx_vizsla_relate.nx -- NISHI VIZSLA V4: the relationships / PRM keystone.
Operator directive 2026-06-14: "build the project management and PRM ... help
us manage our contacts, thank yous". This is the sovereign home of the old
nishi-prm "Tom Hagen consigliere" design: proactive counsel, a BIDIRECTIONAL
obligation ledger (debts I owe AND credits owed to me), and thank-you tracking
as a managed obligation -- folded onto the VIZSLA substrate (CID records on
seg_store, civil-date math, idempotent-by-construction) inherited from V2c.
THEORY AS DATA (law 11/25): relationship tiers + their desired touch cadence,
and the "coming up soon" window, all live in contacts.txt -- refining the
model (a new tier, a tighter cadence) is a data edit, never a recompile.
Commands (argv[1]):
load <relate_log> <prefix> [segid] TOUCH/OBLIGATION/SETTLE/THANKS/SENT
rows -> canonical records -> CID keys
"rel:nxc1-..." on seg_store = additive,
idempotent-by-construction (law 10).
cadence <prefix> <contacts> <today> per contact: LATEST touch date vs its
TIER cadence -> FRESH / DUE(reconnect) /
NEW(introduce). today via argv =
deterministic stdout.
ledger <prefix> <contacts> bidirectional obligation ledger: open
OWE (I owe) + open DUE (owed to me)
after applying SETTLE; per-direction
counts + cent totals. Closing is an
ADDITIVE settle event, never a delete.
thanks <prefix> <contacts> <today> open thank-yous (THANKS with no matching
SENT): days owed, PENDING(<=soon_days) /
OVERDUE. Gratitude as a tracked debt.
brief <prefix> <contacts> <today> the CONSIGLIERE daily brief: follow-ups
due + birthdays within soon_days + open
thank-yous + open obligations, composed
into one "what to do today".
File formats (line records, # comments):
contacts: CONF soon_days <n>
TIER <name> <cadence_days>
CONTACT <id> <display> <tier> <birthday> (birthday MM-DD or "-")
relate_log:
TOUCH <date> <contact> <note>
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
| 64 | const K_MAGIC_1970: i64 = 1970 |
| 65 | const K_MAGIC_146097: i64 = 146097 |
| 66 | const K_MAGIC_719468: i64 = 719468 |
| 67 | const K_MAGIC_4096: i64 = 4096 |
| 68 | const K_MAGIC_2048: i64 = 2048 |
| 69 | const K_MAGIC_65536: i64 = 65536 |
| 70 | const K_MAGIC_131072: i64 = 131072 |
functions
| 72 | func rl_slen(s: *u8) -> i64 |
| 78 | func rl_p(s: *u8) -> i64 called by 6: rl_cmd_loadrl_cmd_cadencerl_cmd_ledgerrl_cmd_thanksrl_cmd_briefmain calls 2: sys_writerl_slen |
| 83 | func rl_eq(a: *u8, b: *u8) -> i64 |
| 94 | func rl_dup(s: *u8) -> *u8 called by 5: rl_load_contactsrl_cmd_loadrl_latest_touchrl_collect_obligsrl_collect_thanks calls 2: rl_slensys_mmap |
| 102 | func rl_atoi(s: *u8) -> i64 |
| 113 | func rl_isws(c: i64) -> i64 called by 1: rl_tok |
| 120 | func rl_tok(b: *u8, off: i64, lend: i64, dst: *u8, cap: i64) -> i64 |
| 142 | func rl_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 148 | func rl_catn(dst: *u8, off: i64, v: i64) -> i64 called by 7: rl_bday_untilrl_logrl_cmd_loadrl_cmd_cadencerl_cmd_ledgerrl_cmd_thanks+1 calls 1: sys_mmap |
| 161 | func rl_find(list: *i64, n: i64, s: *u8) -> i64 called by 5: rl_load_contactsrl_cmd_loadrl_latest_touchrl_collect_obligsrl_collect_thanks calls 1: rl_eq |
| 170 | func rl_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64 |
| 181 | func rl_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64 |
| 208 | func rl_isrel(b: *u8, koff: i64, kl: i64) -> i64 |
| 214 | func rl_datedays(s: *u8) -> i64 called by 6: rl_bday_untilrl_cmd_loadrl_latest_touchrl_cmd_cadencerl_cmd_thanksrl_cmd_brief calls 1: sys_mmap |
| 256 | func rl_yearof(s: *u8) -> i64 called by 1: rl_bday_until |
| 270 | func rl_bday_until(today: *u8, today_days: i64, mmdd: *u8) -> i64 |
| 294 | func rl_log(lpath: *u8, tag: *u8, rep: *u8, o: i64) -> i64 |
| 310 | func rl_prefixlog(prefix: *u8, out: *u8) -> i64 |
| 321 | func rl_load_contacts(cpath: *u8) -> *i64 called by 4: rl_cmd_cadencerl_cmd_ledgerrl_cmd_thanksrl_cmd_brief calls 7: sys_mmapss_readallrl_tokrl_eqrl_atoirl_dup+1 |
| 393 | func rl_cmd_load(argc: i64, argv: *i64) -> i64 |
| 534 | func rl_latest_touch(prefix: *u8, cf: *i64, a_days: *i64, a_date: *i64) -> i64 called by 2: rl_cmd_cadencerl_cmd_brief calls 11: sys_mmapss_manifestrl_catss_readallss_r32rl_isrel+5 |
| 587 | func rl_cmd_cadence(argc: i64, argv: *i64) -> i64 |
| 653 | func rl_collect_obligs(prefix: *u8) -> *i64 called by 2: rl_cmd_ledgerrl_cmd_brief calls 10: sys_mmapss_manifestrl_catss_readallss_r32rl_isrel+4 |
| 740 | func rl_cmd_ledger(argc: i64, argv: *i64) -> i64 |
| 798 | func rl_collect_thanks(prefix: *u8) -> *i64 called by 2: rl_cmd_thanksrl_cmd_brief calls 10: sys_mmapss_manifestrl_catss_readallss_r32rl_isrel+4 |
| 875 | func rl_cmd_thanks(argc: i64, argv: *i64) -> i64 |
| 931 | func rl_cmd_brief(argc: i64, argv: *i64) -> i64 |
| 1046 | func main(argc: i64, argv: *i64) -> i64 |